changeset 13:729e90f1e874 draft

remove group.metadata from datatypes, remove add_value from rarefaction.shared until lib issue solved, have mothur_wrapper.py special case count.groups
author Jim Johnson <jj@umn.edu>
date Mon, 03 Dec 2012 09:09:43 -0600
parents 2088a8d469c9
children 216bf44bf185
files mothur/datatypes_conf.xml mothur/tools/mothur/mothur_wrapper.py mothur/tools/mothur/rarefaction.shared.xml
diffstat 3 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mothur/datatypes_conf.xml	Fri Nov 30 11:46:37 2012 -0600
+++ b/mothur/datatypes_conf.xml	Mon Dec 03 09:09:43 2012 -0600
@@ -13,7 +13,9 @@
         <datatype extension="relabund" type="galaxy.datatypes.metagenomics:RelAbund" display_in_upload="true"/>
         <datatype extension="names" type="galaxy.datatypes.metagenomics:Names" display_in_upload="true"/>
         <datatype extension="design" type="galaxy.datatypes.metagenomics:Design" display_in_upload="true"/>
+        <!--
         <datatype extension="group.metadata" type="galaxy.datatypes.metagenomics:GroupMetadata" display_in_upload="true"/>
+        -->
         <datatype extension="summary" type="galaxy.datatypes.metagenomics:Summary" display_in_upload="true"/>
         <datatype extension="groups" type="galaxy.datatypes.metagenomics:Group" display_in_upload="true"/>
         <datatype extension="oligos" type="galaxy.datatypes.metagenomics:Oligos" display_in_upload="true"/>
--- a/mothur/tools/mothur/mothur_wrapper.py	Fri Nov 30 11:46:37 2012 -0600
+++ b/mothur/tools/mothur/mothur_wrapper.py	Mon Dec 03 09:09:43 2012 -0600
@@ -206,7 +206,7 @@
     cmd_dict['cooccurrence'] = dict({'required' : ['shared'], 'optional' : ['iters','metric','matrixmodel','groups','label']})
 
     cmd_dict['corr.axes'] = dict({'required' : [['shared','relabund','metadata'],'axes'], 'optional' : ['label','groups','method','numaxes']})
-    cmd_dict['count.groups'] = dict({'required' : ['group','shared','count'], 'optional' : ['accnos','groups']})
+    cmd_dict['count.groups'] = dict({'required' : [['group','shared','count']], 'optional' : ['accnos','groups']})
     cmd_dict['count.seqs'] = dict({'required' : ['name'], 'optional' : ['group','groups','large']})
 
     cmd_dict['create.database'] = dict({'required' : [['list','shared'],'repfasta','repname','contaxonomy'], 'optional' : ['group','label']})
@@ -658,10 +658,21 @@
                 if re.match(pattern,line):
                     chimera_count += 1
             info += "Chimeras: %d" % chimera_count
+        elif options.cmd == 'count.groups':
+            fh = open(os.path.join(outputdir,'tmp.groups.count'),'w')
+            for line in tmp_stdout:
+                m = re.match('(.+) contains (\d+)\.',line)
+                if m and len(m.groups()) == 2:
+                    info += line  
+                    print >> fh, "%s\t%s\n" % (m.group(1),m.group(2))
+            fh.close()
         else:
             found_begin = False
             info_chars = 0
             for line in tmp_stdout:
+                if re.match('mothur > ' + options.cmd + '\(.*\)', line):
+                    found_begin = True
+                    continue
                 if line.find(outputdir) >= 0:
                     continue
 	        if line.startswith('**************'):
@@ -676,18 +687,19 @@
                     continue
                 if re.match('.*\.\.\.\s*$',line):
                     continue
-                if re.match('^\d*\s*$',line):
+                if re.match('^\d*\s*$',line) and not line.find(' contains '):
                     continue
                 # if re.match('^(unique|[0-9.]*)(\t\d+)+',line):  # abundance from cluster commands 
-                if not options.cmd.startswith('unifrac') and re.match('^(unique|[0-9.]+)(\t\d+)*',line):  # abundance from cluster commands, allow unique line into info
+                if (not (options.cmd.startswith('unifrac') or options.cmd.startswith('count.groups')) 
+                    and re.match('^(unique|[0-9.]+)(\t\d+)*',line)):  # abundance from cluster commands, allow unique line into info
                     continue
                 if re.match('Output .*',line):
                     break
+		if re.match('mothur > quit()',line):
+                    break
                 if found_begin and info_chars < 200:
                     info += "%s" % line
                     info_chars += len(line)
-                if re.match('mothur > ' + options.cmd + '\(.*\)', line):
-                    found_begin = True
         tmp_stdout.close()
         print >> sys.stdout, info
         # Collect output files
--- a/mothur/tools/mothur/rarefaction.shared.xml	Fri Nov 30 11:46:37 2012 -0600
+++ b/mothur/tools/mothur/rarefaction.shared.xml	Mon Dec 03 09:09:43 2012 -0600
@@ -49,7 +49,9 @@
    <help>All groups will be analyzed by default if none are selected</help>
    <options>
     <filter type="data_meta" ref="otu" key="groups" />
+    <!--
     <filter type="add_value" name="all" value="all" />
+    -->
    </options>
   </param>
   <conditional name="design">