comparison mothur/lib/galaxy/datatypes/metagenomics.py @ 32:ec8df51e841a

Fixes courtesy of Peter Briggs: metagenomics.py: - Groups class: Fix for when second column not present - Axes class: make 'sniff' method more sensitive to try and restrict arbitrary tabular data uploads being sniffed as this type mothur_wrapper.py: - update cmd_dict['chimera.perseus'], to use correct inputs - add --beta option (needed for chimera.perseus tool) - add function for converting input floats from scientific notation (e.g. 1e-6, which mothur can't handle) to decimal format (e.g. 0.00001, which it can) chimera.perseus.xml: - add output data item for the "accnos" file (not previous captured in the history) trim.flows.xml: - cosmetic change: base name for additional output data items is now "trim.flows", rather than "logfile" (clarifies history items) shhh.flows.xml: - cosmetic change: update default value specified in help for mindiff to be consistent with that given in the mothur documentation
author Jim Johnson <jj@umn.edu>
date Wed, 04 Sep 2013 10:51:34 -0500
parents a90d1915a176
children 95d75b35e4d2
comparison
equal deleted inserted replaced
31:a3eed59297ea 32:ec8df51e841a
687 group_names = set() 687 group_names = set()
688 try: 688 try:
689 fh = open( dataset.file_name ) 689 fh = open( dataset.file_name )
690 for line in fh: 690 for line in fh:
691 fields = line.strip().split('\t') 691 fields = line.strip().split('\t')
692 group_names.add(fields[1]) 692 try:
693 group_names.add(fields[1])
694 except IndexError:
695 # Ignore missing 2nd column
696 pass
693 dataset.metadata.groups = [] 697 dataset.metadata.groups = []
694 dataset.metadata.groups += group_names 698 dataset.metadata.groups += group_names
695 finally: 699 finally:
696 fh.close() 700 fh.close()
697 701
1200 if len(fields) != col_cnt : 1204 if len(fields) != col_cnt :
1201 return False 1205 return False
1202 try: 1206 try:
1203 for i in range(1, col_cnt): 1207 for i in range(1, col_cnt):
1204 check = float(fields[i]) 1208 check = float(fields[i])
1209 # Check abs value is <= 1.0
1210 if abs(check) > 1.0:
1211 return False
1205 # Also test for whether value is an integer 1212 # Also test for whether value is an integer
1206 try: 1213 try:
1207 check = int(fields[i]) 1214 check = int(fields[i])
1208 except ValueError: 1215 except ValueError:
1209 all_integers = False 1216 all_integers = False