Esempio n. 1
0
def testLoadMap():
    from_ = u"data/SHORT_MS2_FILE.mzXML"
    ds = ms.loadPeakMap(from_)
    assert osp.basename(ds.meta.get("source")) ==  osp.basename(from_)

    # with unicode
    ms.storePeakMap(ds, u"temp_output/utilstest.mzML")
    ds2 = ms.loadPeakMap(u"temp_output/utilstest.mzML")
    assert len(ds)==len(ds2)

    # without unicode
    ms.storePeakMap(ds2, "temp_output/utilstest.mzData")
    ds3 = ms.loadPeakMap("temp_output/utilstest.mzData")
    assert len(ds)==len(ds3)
Esempio n. 2
0
 def write(self, result, destinationDir, path):
     basename, ext = os.path.splitext(os.path.basename(path))
     savePath = os.path.join(destinationDir, basename+"_centroided.mzML")
     print "save to ", savePath
     ms.storePeakMap(result, savePath)