@@ -48,7 +48,7 @@ def read_molecular_formulae(filename, separator="\t", calculate=True, filename_a
48
48
49
49
if calculate :
50
50
path_nist_database = os .path .join (os .path .dirname (os .path .abspath (__file__ )), 'data' , 'nist_database.txt' )
51
- nist_db = nist_database_to_pyteomics (path_nist_database )
51
+ nist_database = nist_database_to_pyteomics (path_nist_database )
52
52
53
53
df = read_csv (filename , sep = separator , float_precision = "round_trip" )
54
54
records = []
@@ -60,7 +60,7 @@ def read_molecular_formulae(filename, separator="\t", calculate=True, filename_a
60
60
sum_CHNOPS = sum ([comp [e ] for e in comp if e in ["C" , "H" , "N" , "O" , "P" , "S" ]])
61
61
record ["CHNOPS" ] = sum_CHNOPS == sum (list (comp .values ()))
62
62
if calculate :
63
- record ["exact_mass" ] = round (pyteomics_mass .mass .calculate_mass (formula = str (row .molecular_formula ), mass_data = nist_db ), 6 )
63
+ record ["exact_mass" ] = round (pyteomics_mass .mass .calculate_mass (formula = str (row .molecular_formula ), mass_data = nist_database ), 6 )
64
64
else :
65
65
record ["exact_mass" ] = float (row .exact_mass )
66
66
record .update (HC_HNOPS_rules (str (row .molecular_formula )))
@@ -77,7 +77,7 @@ def read_compounds(filename, separator="\t", calculate=True, filename_atoms=""):
77
77
78
78
if calculate :
79
79
path_nist_database = os .path .join (os .path .dirname (os .path .abspath (__file__ )), 'data' , 'nist_database.txt' )
80
- nist_db = nist_database_to_pyteomics (path_nist_database )
80
+ nist_database = nist_database_to_pyteomics (path_nist_database )
81
81
82
82
df = read_csv (filename , sep = separator , float_precision = "round_trip" )
83
83
records = []
@@ -89,7 +89,7 @@ def read_compounds(filename, separator="\t", calculate=True, filename_atoms=""):
89
89
sum_CHNOPS = sum ([comp [e ] for e in comp if e in ["C" , "H" , "N" , "O" , "P" , "S" ]])
90
90
record ["CHNOPS" ] = sum_CHNOPS == sum (list (comp .values ()))
91
91
if calculate :
92
- record ["exact_mass" ] = round (pyteomics_mass .calculate_mass (formula = str (str (row .molecular_formula )), mass_data = nist_db ),6 )
92
+ record ["exact_mass" ] = round (pyteomics_mass .calculate_mass (formula = str (str (row .molecular_formula )), mass_data = nist_database ),6 )
93
93
else :
94
94
record ["exact_mass" ] = float (row .exact_mass )
95
95
record ["compound_id" ] = row .compound_id
0 commit comments