Mercurial > repos > pieterlukasse > prims_metabolomics2
diff GCMS/combine_output.py @ 14:346ff9ad8c7a
fix for rankfilter, removed pfd read functional
author | linda.bakker@wur.nl <linda.bakker@wur.nl> |
---|---|
date | Fri, 20 Mar 2015 17:10:04 +0100 |
parents | 4393f982d18f |
children | fe4682eb938c |
line wrap: on
line diff
--- a/GCMS/combine_output.py Thu Mar 19 15:04:56 2015 +0100 +++ b/GCMS/combine_output.py Fri Mar 20 17:10:04 2015 +0100 @@ -81,7 +81,6 @@ # The ID in the RankFilter output contains the following 5 fields: rf_id = rankfilter['ID'].split('-') try: - name, formula = _remove_formula(rankfilter['Name']) hit = [rf_id[0], # Centrotype rf_id[1], # cent.Factor rf_id[2], # scan nr @@ -89,8 +88,8 @@ rf_id[4], # nr. Peaks # Appending other fields rankfilter['R.T.'], - name, - caslookup['FORMULA'] if not formula else formula, + rankfilter['Name'], + rankfilter['Formula'], rankfilter['Library'].strip(), rankfilter['CAS'].strip(), rankfilter['Forward'], @@ -120,18 +119,7 @@ return hit -def _remove_formula(name): - ''' - The RankFilter Name field often contains the Formula as well, this function removes it from the Name - @param name: complete name of the compound from the RankFilter output - ''' - name = name.split() - poss_formula = name[-1] - match = re.match("^(([A-Z][a-z]{0,2})(\d*))+$", poss_formula) - if match: - return ' '.join(name[:-1]), poss_formula - else: - return ' '.join(name), False + def _get_default_caslookup():