In [1]:
import sys
import os
import re

%matplotlib notebook
# %matplotlib inline
%config InlineBackend.figure_format = 'retina'
from matplotlib import pylab as plt
import sys
import glob, os


curr_ld_lib_path = ''
os.environ['LD_LIBRARY_PATH'] = curr_ld_lib_path + ':/project/projectdirs/openmsi/jupyterhub_libs/boost_1_55_0/lib' + ':/project/projectdirs/openmsi/jupyterhub_libs/lib'
import sys
# sys.path.remove('/anaconda/lib/python2.7/site-packages')
sys.path.append('/global/project/projectdirs/openmsi/jupyterhub_libs/anaconda/lib/python2.7/site-packages')

sys.path.insert(0,'/global/project/projectdirs/metatlas/anaconda/lib/python2.7/site-packages' )

from metatlas import metatlas_objects as metob
from metatlas import h5_query as h5q
from metatlas import mzml_to_hdf


sys.path.append('/project/projectdirs/openmsi/projects/meta-iq/pactolus/pactolus')

import score_frag_dag

In [14]:
# import seaborn as sns
# %matplotlib notebook
# # %matplotlib inline
# %config InlineBackend.figure_format = 'retina'
# from matplotlib import pylab as plt
# import sys
# sys.path.insert(0,'/global/project/projectdirs/metatlas/anaconda/lib/python2.7/site-packages' )
# from metatlas import metatlas_objects as metob
# from metatlas import h5_query as h5q
# from metatlas import mzml_to_hdf
# import glob, os

In [2]:
import tables

import numpy as np

In [3]:
my_run = metob.retrieve('lcmsrun', name='%20150910_C18_MeOH_NEG_MSMS_Scoelicolor_media_Ref_TwoNine_Day3_3of4___Run53%')
print my_run


[{'creation_time': '2015-09-20T03:35:03',
 'description': u'20150914_actinorhodin_finalset_50mm 20150910_C18_MeOH_NEG_MSMS_Scoelicolor_media_Ref_TwoNine_Day3_3of4___Run53.mzML',
 'hdf5_file': u'/project/projectdirs/metatlas/raw_data/kblouie/20150914_actinorhodin_finalset_50mm/20150910_C18_MeOH_NEG_MSMS_Scoelicolor_media_Ref_TwoNine_Day3_3of4___Run53.h5',
 'head_id': u'ac236419df994a32902c3cd37072d127',
 'last_modified': '2015-10-08T18:32:38',
 'method': None,
 'mzml_file': u'/project/projectdirs/metatlas/raw_data/kblouie/20150914_actinorhodin_finalset_50mm/20150910_C18_MeOH_NEG_MSMS_Scoelicolor_media_Ref_TwoNine_Day3_3of4___Run53.mzML',
 'name': u'20150910_C18_MeOH_NEG_MSMS_Scoelicolor_media_Ref_TwoNine_Day3_3of4___Run53.mzML',
 'prev_uid': u'origin',
 'sample': None,
 'unique_id': u'ac236419df994a32902c3cd37072d127',
 'username': u'kblouie'}]

In [4]:
with tables.open_file(my_run[0].hdf5_file) as fid:
    data = h5q.get_data(fid,2,0,min_rt = 5.1,max_rt = 7.9,min_precursor_MZ=633.12,max_precursor_MZ = 633.2)
print data['rt']


[ 7.5419445   7.5419445   7.5419445   7.5419445   7.5419445   7.5419445
  7.5419445   7.5419445   7.5419445   7.5419445   7.5419445   7.5419445
  7.5419445   7.5419445   7.5419445   7.5419445   7.5419445   7.5419445
  7.5419445   7.5419445   7.5419445   7.5419445   7.5419445   7.5419445
  7.5419445   7.5419445   7.5419445   7.5419445   7.5419445   7.5419445
  7.5419445   7.5419445   7.5419445   7.5419445   7.5419445   7.5419445
  7.5419445   7.5419445   7.5419445   7.5419445   7.5419445   7.5419445
  7.5419445   7.5419445   7.5419445   7.5419445   7.72450113  7.72450113
  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113
  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113
  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113
  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113
  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113  7.72450113
  7.72450113]

In [5]:
def get_unique_scan_data(data):
    """
    Input:
    data - numpy nd array containing MSMS data
    
    Output:
    rt - retention time of scan
    pmz - precursor m/z of scan
    Both are sorted by descending precursor ion intensity
    
    for data returned from h5query.get_data(),
    return the retention time and precursor m/z
    sorted by descending precursor ion intensity
    """
    urt,idx = np.unique(data['rt'],return_index=True)
    idx
    sx = np.argsort(data['precursor_intensity'][idx])[::-1]
    prt = data['rt'][idx[sx]]
    pmz = data['precursor_MZ'][idx[sx]]
    return prt,pmz


def get_non_redundant_precursor_list(prt,pmz,rt_cutoff,mz_cutoff):
    """
    Input:
    rt - retention time of scan
    pmz - precursor m/z of scan
    Both are sorted by descending precursor ion intensity
    rt_cutoff - 
    mz_cutoff - 
    
    Output:
    list_of_prt - list of 
    list_of_pmz - list of 
    """
    
    list_of_pmz = [] #contains list of precursor m/z [pmz1,pmz2,...,pmz_n]
    list_of_prt = [] #contains list of precursor rt [prt1,prt2,...,prt_n]
    
    for i in range(len(prt)):
        if len(list_of_pmz) == 0:
            # none are in the list yet; so there is nothing to check
            list_of_pmz.append(pmz[i])
            list_of_prt.append(prt[i])
        else:
            # check if new rt qualifies for inclusion
            if min(abs(list_of_prt - prt[i])) > rt_cutoff or min(abs(list_of_pmz - pmz[i])) > mz_cutoff:
                list_of_pmz.append(pmz[i])
                list_of_prt.append(prt[i])
    return list_of_prt,list_of_pmz

In [6]:
prt,pmz = get_unique_scan_data(data)

rt_cutoff = 0.23
mz_cutoff = 0.05
list_of_prt,list_of_pmz = get_non_redundant_precursor_list(prt,pmz,rt_cutoff,mz_cutoff)

In [7]:
#setup data format for searching
pactolus_input = {}
pactolus_input['spectra'] = []
pactolus_input['precursor_mz'] = []
for i,(prt,pmz) in enumerate(zip(list_of_prt,list_of_pmz)):
    idx = np.argwhere((data['precursor_MZ'] == pmz) & (data['rt'] == prt )).flatten()
    arr = np.array([data['mz'][idx], data['i'][idx]]).T
    pactolus_input['spectra'].append(arr)
    pactolus_input['precursor_mz'].append(pmz)
    
pactolus_input


Out[7]:
{'precursor_mz': [633.12708],
 'spectra': [array([[  6.02219849e+01,   5.13611426e+03],
         [  6.45197067e+01,   5.31844141e+03],
         [  6.98501816e+01,   5.67258447e+03],
         [  7.65564728e+01,   5.86723633e+03],
         [  1.02837791e+02,   6.63435449e+03],
         [  1.95310944e+02,   6.94508936e+03],
         [  1.95346817e+02,   5.35564795e+03],
         [  2.30951797e+02,   6.08355859e+03],
         [  2.58053192e+02,   1.16679834e+04],
         [  2.59062347e+02,   4.59729961e+04],
         [  2.73077271e+02,   7.24596094e+04],
         [  2.85077332e+02,   2.16664453e+04],
         [  3.07239838e+02,   5.24816797e+03],
         [  4.58103638e+02,   4.89963672e+04],
         [  4.60081451e+02,   3.66318633e+04],
         [  4.66106598e+02,   9.99861328e+03],
         [  4.67118042e+02,   7.16287158e+03],
         [  4.81088440e+02,   9.08090332e+03],
         [  4.83109131e+02,   1.46352406e+05],
         [  4.84119049e+02,   8.25898203e+04],
         [  4.85128876e+02,   4.34224219e+04],
         [  4.86096375e+02,   1.41140562e+05],
         [  4.88110260e+02,   1.09656885e+04],
         [  4.91111481e+02,   7.50981738e+03],
         [  4.98096252e+02,   3.90590703e+04],
         [  5.01120361e+02,   2.49719703e+05],
         [  5.02124176e+02,   2.99160117e+04],
         [  5.03139282e+02,   2.03241855e+04],
         [  5.04109619e+02,   7.30114531e+04],
         [  5.09125122e+02,   1.39737781e+05],
         [  5.12112244e+02,   1.30703898e+05],
         [  5.15095886e+02,   1.27436611e+04],
         [  5.27135925e+02,   6.96762938e+05],
         [  5.30123108e+02,   2.17331531e+05],
         [  5.31119324e+02,   6.42012109e+03],
         [  5.43092346e+02,   1.09529971e+04],
         [  5.45154175e+02,   2.32297984e+05],
         [  5.46117981e+02,   6.22249805e+04],
         [  5.47124756e+02,   1.38596689e+04],
         [  5.48097168e+02,   2.43663344e+05],
         [  5.71124634e+02,   1.05528477e+05],
         [  5.74113586e+02,   9.96611719e+04],
         [  5.89136414e+02,   2.05418075e+06],
         [  5.90123657e+02,   4.34102188e+04],
         [  6.33126465e+02,   1.17730050e+06],
         [  6.34134155e+02,   9.05391094e+04]], dtype=float32)]}

In [8]:
%matplotlib inline
plt.vlines(pactolus_input['spectra'][0][:,0],
           np.zeros(pactolus_input['spectra'][0][:,1].shape),
           pactolus_input['spectra'][0][:,1],
           color='k',linestyles='solid')
plt.show()



In [10]:
# # print data['precursor_MZ']
# # print data['rt']
# # data['mz']
# # data['i']
# # data['precursor_MZ']
# # idx = np.argsort(data['precursor_intensity'])[::-1]
# # data['precursor_intensity'][idx]
# # data['collision_energy']
print list_of_pmz
print list_of_prt
# print len(pmz)


[633.12671]
[7.6977539]

In [71]:
# print len(list_of_pmz_rt)
# print list_of_pmz_rt

In [72]:
# arr = np.array([data['mz'], data['i']]).T
# 
# other_arr = np.array([other_data['mz'], other_data['i']]).T

In [60]:
# all_my_h5_files = glob.glob('/project/projectdirs/openmsi/projects/pactolus_trees/*VTIKDEXOEJDMJP-WYUUTHIRSA-L*.h5')
for f in all_my_h5_files:
    if "VTIKDEXOEJDMJP" in f:
        print f

In [66]:
tree_table = np.load(maxdepth_5_table)
for t in tree_table:
    if abs(t[1] - 634.132255544) < 1:
        print t


('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_CCDRPBGPIXPGRW-UHFFFAOYSA-N.h5', 634.4080834360016)
('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_WJMMBVSOQPALFO-BHYGPSQDSA-N.h5', 634.4080834360016)
('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_NARQRJFIZNOSJV-UHFFFAOYSA-N.h5', 634.4080834360016)
('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_GJIGVPBRJFOUGD-SSQLMYNASA-N.h5', 634.4749812240018)
('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_HRUXIQZFNLQZQA-UHFFFAOYSA-N.h5', 635.0877176640005)

In [9]:
pos_mode_neutralizations = [-1.00727646677, -(1.00727646677+1.00782504), +5.4857990946e-4,]
neg_mode_neutralizations = [-el for el in pos_mode_neutralizations]

# make lookup table
# path_to_trees = '/project/projectdirs/openmsi/projects/pactolus_trees/'
# all_my_h5_files = glob.glob('/project/projectdirs/openmsi/projects/pactolus_trees/*_hdf5_5_*.h5')

path_to_trees = '/project/projectdirs/openmsi/projects/ben_trees/'
all_my_h5_files = glob.glob('/project/projectdirs/openmsi/projects/ben_trees/*_hdf5_5_*.h5')

my_tree_filename = 'metacyc_max_depth_5'

if not os.path.isfile(os.path.join(path_to_trees, my_tree_filename + '.npy')):
    score_frag_dag.make_file_lookup_table_by_MS1_mass(all_my_h5_files, 
                                                      path=path_to_trees, 
                                                      save_result='metacyc_max_depth_5')

maxdepth_5_table = os.path.join(path_to_trees, my_tree_filename + '.npy')

params = {'file_lookup_table': maxdepth_5_table,
          'ms1_mass_tol': 0.05,
          'ms2_mass_tol': 0.05,
          'neutralizations': neg_mode_neutralizations,
          'max_depth': 5,
              }

print neg_mode_neutralizations


---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-9-eb132c0add26> in <module>()
     14     score_frag_dag.make_file_lookup_table_by_MS1_mass(all_my_h5_files, 
     15                                                       path=path_to_trees,
---> 16                                                       save_result='metacyc_max_depth_5')
     17 
     18 maxdepth_5_table = os.path.join(path_to_trees, my_tree_filename + '.npy')

/project/projectdirs/openmsi/projects/meta-iq/pactolus/pactolus/score_frag_dag.pyc in make_file_lookup_table_by_MS1_mass(tree_files, path, save_result)
    237     order = np.argsort(tree_files_by_ms1_mass['ms1_mass'])
    238     if save_result:
--> 239         np.save(os.path.join(path, save_result), tree_files_by_ms1_mass[order])
    240     return tree_files_by_ms1_mass[order]
    241 

//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.pyc in save(file, arr)
    444         if not file.endswith('.npy'):
    445             file = file + '.npy'
--> 446         fid = open(file, "wb")
    447         own_fid = True
    448     else:

IOError: [Errno 2] No such file or directory: '/global/homes/b/bpb/trees/gen_tree_result_neutralized_metacyc/metacyc_max_depth_5.npy'

In [49]:
pactolus_input


Out[49]:
{'precursor_mz': [633.12708],
 'spectra': [array([[  6.02219849e+01,   5.13611426e+03],
         [  6.45197067e+01,   5.31844141e+03],
         [  6.98501816e+01,   5.67258447e+03],
         [  7.65564728e+01,   5.86723633e+03],
         [  1.02837791e+02,   6.63435449e+03],
         [  1.95310944e+02,   6.94508936e+03],
         [  1.95346817e+02,   5.35564795e+03],
         [  2.30951797e+02,   6.08355859e+03],
         [  2.58053192e+02,   1.16679834e+04],
         [  2.59062347e+02,   4.59729961e+04],
         [  2.73077271e+02,   7.24596094e+04],
         [  2.85077332e+02,   2.16664453e+04],
         [  3.07239838e+02,   5.24816797e+03],
         [  4.58103638e+02,   4.89963672e+04],
         [  4.60081451e+02,   3.66318633e+04],
         [  4.66106598e+02,   9.99861328e+03],
         [  4.67118042e+02,   7.16287158e+03],
         [  4.81088440e+02,   9.08090332e+03],
         [  4.83109131e+02,   1.46352406e+05],
         [  4.84119049e+02,   8.25898203e+04],
         [  4.85128876e+02,   4.34224219e+04],
         [  4.86096375e+02,   1.41140562e+05],
         [  4.88110260e+02,   1.09656885e+04],
         [  4.91111481e+02,   7.50981738e+03],
         [  4.98096252e+02,   3.90590703e+04],
         [  5.01120361e+02,   2.49719703e+05],
         [  5.02124176e+02,   2.99160117e+04],
         [  5.03139282e+02,   2.03241855e+04],
         [  5.04109619e+02,   7.30114531e+04],
         [  5.09125122e+02,   1.39737781e+05],
         [  5.12112244e+02,   1.30703898e+05],
         [  5.15095886e+02,   1.27436611e+04],
         [  5.27135925e+02,   6.96762938e+05],
         [  5.30123108e+02,   2.17331531e+05],
         [  5.31119324e+02,   6.42012109e+03],
         [  5.43092346e+02,   1.09529971e+04],
         [  5.45154175e+02,   2.32297984e+05],
         [  5.46117981e+02,   6.22249805e+04],
         [  5.47124756e+02,   1.38596689e+04],
         [  5.48097168e+02,   2.43663344e+05],
         [  5.71124634e+02,   1.05528477e+05],
         [  5.74113586e+02,   9.96611719e+04],
         [  5.89136414e+02,   2.05418075e+06],
         [  5.90123657e+02,   4.34102188e+04],
         [  6.33126465e+02,   1.17730050e+06],
         [  6.34134155e+02,   9.05391094e+04]], dtype=float32)]}

In [12]:
foo = score_frag_dag.score_scan_list_against_trees(pactolus_input['spectra'], pactolus_input['precursor_mz'], params)
np.argmax(foo)


Out[12]:
0

In [33]:
my_db = '/project/projectdirs/openmsi/projects/meta-iq/pactolus/data/' + 'MetaCyc.mdb'
pactolus_results = score_frag_dag.make_pactolus_hit_table(foo, maxdepth_5_table, original_db=my_db)

In [37]:
for r in pactolus_results:
    if len(r)>0:
        print r[0]


(0.7875834703445435, 'MetaCyC_10461', 'ethyl red', 297.1477355957031, 0, 0)
(0.9809126853942871, 'MetaCyC_7413', 'emodin', 270.0528259277344, 0, 0)
(0.0572817325592041, 'MetaCyC_1181', '(1<i>S</i>,6<i>R</i>)-2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate', 240.06338500976562, 0, 0)
(0.23310670256614685, 'MetaCyC_1416', 'tetrachloroethene', 163.8754119873047, 0, 0)
(0.5957505702972412, 'MetaCyC_8529', 'levoglucosan', 162.05282592773438, 0, 0)
(0.0007101739174686372, 'MetaCyC_6396', '2-12:0-lysoPG', 428.217529296875, 0, 0)
(0.33812853693962097, 'MetaCyC_752', 'pentachloroethane', 199.85208129882812, 0, 0)
(0.7275602221488953, 'MetaCyC_9299', 'cortolone', 366.2406311035156, 0, 0)
(1.4161595106124878, 'MetaCyC_7168', '1D-<i>chiro</i>-inositol', 180.06338500976562, 0, 0)
(0.12381210178136826, 'MetaCyC_6694', "3-(2'-methylthio)ethylmalic-acid", 208.04054260253906, 0, 0)
(0.21038520336151123, 'MetaCyC_7088', '3-dehydroteasterone', 446.339599609375, 0, 0)
(0.8556255102157593, 'MetaCyC_7758', 'L-serine-phosphoethanolamine', 228.05111694335938, 0, 0)
(1.1637345552444458, 'MetaCyC_1023', 'all-<i>trans</i>-geranylgeranylcysteine', 393.2701416015625, 0, 0)
(0.1808895319700241, 'MetaCyC_6502', '1-20:2-2-18:2-phosphatidylethanolamine', 767.5465087890625, 0, 0)
(0.4854579269886017, 'MetaCyC_4595', 'methyl pyruvate', 102.03169250488281, 0, 0)
(0.7690903544425964, 'MetaCyC_208', 'glucuronamide', 193.0586395263672, 0, 0)
(0.906912624835968, 'MetaCyC_3299', 'sodium dodecyl sulfate', 266.1551818847656, 0, 0)
(0.9160449504852295, 'MetaCyC_802', 'reduced 3-acetylpyridine adenine dinucleotide', 664.1295166015625, 0, 0)
(0.9478674530982971, 'MetaCyC_8110', 'UDP-2,4-diacetamido-2,4,6-trideoxy-&beta;-L-altropyranose', 632.1132202148438, 0, 0)
(0.6281113028526306, 'MetaCyC_5382', '(R)-3,4-dihydroxymandelonitrile', 165.04258728027344, 0, 0)
(0.3608606159687042, 'MetaCyC_9406', '7-dehydroporiferasterol', 410.3548583984375, 0, 0)
(0.02890894003212452, 'MetaCyC_1629', '1,1,1,2-tetrachloroethane', 165.8910675048828, 0, 0)
(0.082353875041008, 'MetaCyC_9446', '4&alpha;-hydroxymethyl,4&beta;,14&alpha;-dimethyl-9&beta;,19-cyclo-5&alpha;-ergost-24(24<sup>1</sup>', 456.396728515625, 0, 0)
(0.7915668487548828, 'MetaCyC_8521', 'D-glyceraldehyde', 90.03169250488281, 0, 0)
(0.644523561000824, 'MetaCyC_1281', 'EHNA', 277.19024658203125, 0, 0)
(0.26264336705207825, 'MetaCyC_3059', '2-(hydroxymethyl)-3-(acetamidomethylene)succinate', 217.0586395263672, 0, 0)
(0.9409633874893188, 'MetaCyC_4010', 'questin', 284.0684814453125, 0, 0)
(0.09281157702207565, 'MetaCyC_7053', '(+)-7-<i>iso</i>-jasmonoyl-L-isoleucine', 323.20965576171875, 0, 0)
(0.7696071267127991, 'MetaCyC_5079', 'L-palmitoylcarnitine', 399.3348693847656, 0, 0)
(0.5365105271339417, 'MetaCyC_7572', 'parabanate', 114.00653839111328, 0, 0)
(0.04719662666320801, 'MetaCyC_302', 'porphobilinogen', 226.09535217285156, 0, 0)
(0.5514329671859741, 'MetaCyC_123', '12-hydroxydihydrochelirubine', 379.1055908203125, 0, 0)
(0.2572994828224182, 'MetaCyC_250', '(25<i>R</i>)-3&alpha;,7&alpha;-dihydroxy-5&beta;-cholestan-26-al', 418.3446960449219, 0, 0)
(1.6318769454956055, 'MetaCyC_563', '(3R)-3-(2,4-dihydroxyphenyl)-3,4-dihydro-2H-1-benzopyran-4,7-diol', 274.0841369628906, 0, 0)
(0.3252941071987152, 'MetaCyC_1254', 'chloroform', 117.91438293457031, 0, 0)
(0.7353898286819458, 'MetaCyC_6936', '17-hydroxy-octadecenoate', 298.25079345703125, 0, 0)
(0.006075924262404442, 'MetaCyC_7782', '<i>N</i>-(3-oxododecanoyl)-L-homoserine', 315.2045593261719, 0, 0)
(0.5478740930557251, 'MetaCyC_3660', 'calcitroate', 374.2456970214844, 0, 0)
(0.8381285071372986, 'MetaCyC_4351', 'freon 11', 135.90496826171875, 0, 0)
(0.07402956485748291, 'MetaCyC_6563', 'psychosine', 461.33526611328125, 0, 0)
(1.1601364612579346, 'MetaCyC_2324', 'CMP-<i>N</i>-glycoloyl-&beta;-neuraminate', 630.1422119140625, 0, 0)
(0.1694522202014923, 'MetaCyC_1462', '1,1,1-trichloroethane', 131.93003845214844, 0, 0)
(0.48392340540885925, 'MetaCyC_2289', '2-deoxyribonolactone', 132.04225158691406, 0, 0)
(0.5110822916030884, 'MetaCyC_6421', '1-18:2-2-18:2-phosphatidate', 696.4730224609375, 0, 0)
(0.7400855422019958, 'MetaCyC_4316', 'ascopyrone M', 144.04225158691406, 0, 0)
(0.05742281302809715, 'MetaCyC_110', '17-O-deacetylvindoline', 414.2154846191406, 0, 0)
(0.2741040587425232, 'MetaCyC_114', 'aurachin-C', 379.2511291503906, 0, 0)
(0.3488742709159851, 'MetaCyC_9459', '7-dehydrodesmosterol', 382.3235778808594, 0, 0)
(1.112168788909912, 'MetaCyC_8111', 'UDP-2,3-diacetamido-2,3-dideoxy-&alpha;-D-mannuronate', 662.08740234375, 0, 0)
(0.6653583645820618, 'MetaCyC_1211', 'norajmaline', 312.18377685546875, 0, 0)
(0.5750381350517273, 'MetaCyC_4707', 'dephospho-CoA', 687.1488647460938, 0, 0)
(0.0004771294188685715, 'MetaCyC_7744', 'L-threonine O-3-phosphate', 199.02456665039062, 0, 0)
(0.9018236398696899, 'MetaCyC_6315', 'zealexin A1', 234.1619873046875, 0, 0)
(0.5939044952392578, 'MetaCyC_8182', 'GDP-4-amino-4,6-dideoxy-&alpha;-D-<i>N</i>-acetylglucosamine', 629.124755859375, 0, 0)
(0.9020643830299377, 'MetaCyC_7881', 'L-proline', 115.0633316040039, 0, 0)
(0.0688503235578537, 'MetaCyC_486', 'secologanin', 388.1369323730469, 0, 0)
(0.07784868776798248, 'MetaCyC_2614', 'demethylsulochrin', 318.0739440917969, 0, 0)
(0.5517419576644897, 'MetaCyC_2145', '15-hydroxypentadecanoate', 258.219482421875, 0, 0)
(0.3632138669490814, 'MetaCyC_6031', '10&beta;,14&beta;-dihydroxytaxa-4(20),11-dien-5&alpha;-yl acetate', 362.2456970214844, 0, 0)
(0.7515400648117065, 'MetaCyC_920', '(+)-larreatricin', 284.1412353515625, 0, 0)
(0.31099697947502136, 'MetaCyC_8016', 'arbekacin', 552.3118896484375, 0, 0)
(0.304311603307724, 'MetaCyC_781', '3-pyridinesulfonate', 158.99900817871094, 0, 0)
(0.4679942727088928, 'MetaCyC_5529', '3-nitro-1-propionate', 119.02185821533203, 0, 0)
(0.2907801568508148, 'MetaCyC_4490', '2,5-dichloro-<i>p</i>-quinone', 175.9431915283203, 0, 0)
(0.0681682750582695, 'MetaCyC_9464', '4&alpha;-hydroxymethyl-4&beta;-methyl-5&alpha;-cholesta-8,24-dien-3&beta;-ol', 428.36541748046875, 0, 0)
(0.21706172823905945, 'MetaCyC_5867', 'medicagenate', 502.3294372558594, 0, 0)
(0.42557573318481445, 'MetaCyC_3559', '10&beta;-hydroxytaxa-4(20),11-dien-5&alpha;-yl acetate', 346.25079345703125, 0, 0)

In [50]:
233.15416+1.00727646677


Out[50]:
234.16143646677

In [51]:
234.161979944-234.16143646677


Out[51]:
0.0005434772299963697

In [68]:
foo = np.load(maxdepth_5_table)

In [69]:
foo


Out[69]:
array([ ('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_OOXWYYGXTJLWHA-UHFFFAOYSA-N.h5', 40.031300128),
       ('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_XZMCDFZZKTWFGF-UHFFFAOYSA-N.h5', 42.021798063999995),
       ('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_QQONPFPTGQHPMA-UHFFFAOYSA-N.h5', 42.046950192),
       ...,
       ('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_NTXGVHCCXVHYCL-UHFFFAOYSA-N.h5', 926.6318285440028),
       ('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_HMTFXPJOBPIOIN-UHFFFAOYSA-N.h5', 952.7187878080008),
       ('/project/projectdirs/openmsi/projects/pactolus_trees/FragTreeLibrary_test_hdf5_5_RGHRJBIKIYUHEV-UHFFFAOYSA-N.h5', 952.7187878080008)], 
      dtype=[('filename', 'S400'), ('ms1_mass', '<f8')])

In [ ]: