changeset 2:bc6a7eeb7c32 draft

Uploaded
author bgruening
date Fri, 26 Apr 2013 09:58:33 -0400
parents dbf93116a809
children 287892c9c9db
files molecules.py repository_dependencies.xml tool_dependencies.xml
diffstat 3 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/molecules.py	Tue Mar 26 13:00:19 2013 -0400
+++ b/molecules.py	Fri Apr 26 09:58:33 2013 -0400
@@ -70,6 +70,19 @@
     def get_mime(self):
         return 'text/plain'
 
+class MOL( GenericMolFile ):
+    file_ext = "mol"
+    def sniff( self, filename ):
+        if count_special_lines("^M\s*END", filename) = 1:
+            return True
+        else:
+            return False
+
+    def set_meta( self, dataset, **kwd ):
+        """
+        Set the number molecules, in the case of MOL its always one.
+        """
+        dataset.metadata.number_of_molecules = 1
 
 
 class SDF( GenericMolFile ):
@@ -82,9 +95,9 @@
 
     def set_meta( self, dataset, **kwd ):
         """
-        Set the number of lines of data in dataset.
+        Set the number of molecules in dataset.
         """
-        dataset.metadata.number_of_molecules = count_special_lines("^\$\$\$\$", dataset.file_name)#self.count_data_lines(dataset.file_name)
+        dataset.metadata.number_of_molecules = count_special_lines("^\$\$\$\$", dataset.file_name)
 
     def split( cls, input_datasets, subdir_generator_function, split_params):
         """
--- a/repository_dependencies.xml	Tue Mar 26 13:00:19 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<repositories description="This requires the OpenBabel binaries and python bindings (e.g. obabel, obgrep).">
-    <repository toolshed="http://testtoolshed.g2.bx.psu.edu/" name="package_openbabel_2_3" owner="bgruening" changeset_revision="9e07452137da" />
-</repositories>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Fri Apr 26 09:58:33 2013 -0400
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<repositories description="This requires the OpenBabel binaries and python bindings (e.g. obabel, obgrep).">
+    <repository toolshed="http://testtoolshed.g2.bx.psu.edu/" name="package_openbabel_2_3" owner="bgruening" changeset_revision="9e07452137da" />
+</repositories>