Example #1
0
 def identify(self):
     idx=self.acTree.selectedIndexes()[0]
     
     if not idx.isValid():
         print "Error, index is not valid"
         return
     p = idx.parent()
     if p.data().toString() in ("fragments/adducts:","isotopic cluster:"):
         p = idx.parent().parent().parent()
     sample=self.currentSample[1 if self.acTree is self.view.treeView_2 else 2]#self.model.sample(p.data().toString(), fullNameEntry=False)
     if sample is None:
         print "Error, sample not found %s"%sample.shortName()
         return
     #data=None
     if len(idx.data().toString().split('/')) > 2:
         data=idx.data().toString().split('/')[:-1]
     else:
         data=idx.data().toString().split('/')
     peak=sample.peakAt(*map(float, data))
     if peak is None:
         self.view.showErrorMessage("Error", "Unable to find the corresponding peak...")
     
     spl=MSSampleList()
     s=MSSample("None")
     s.rawPeaks=MSPeakList([peak], sample=s)
     spl.addSample(s) 
     
     dial=MSIdentificationDialog(parent=self.view)
     dial.setAttribute(Qt.WA_DeleteOnClose)
     controller=MSIdentificationController(spl, dial, False, showDirectResult=True)
Example #2
0
def merge(filenames):
    sampleList = MSSampleList(kind='MRM')
    n = [s.split('-')[-1].split('.')[0][1:] for s in filenames]
    print n
    for f in filenames:
        s = MSSample(os.path.normcase(f), kind='MRM')
        s.loadMZXMLData()
        sampleList.append(s)

    mergedSampleName = "-".join(n) + ".mzXML"
    createMergedXml(mergedSampleName, sampleList)
Example #3
0
def merge(filenames):
    sampleList = MSSampleList(kind='MRM')
    n = [s.split('-')[-1].split('.')[0][1:] for s in filenames]
    print n
    for f in filenames:
        s = MSSample(os.path.normcase(f), kind='MRM')
        s.loadMZXMLData()
        sampleList.append(s)
   
    mergedSampleName = "-".join(n)+".mzXML"
    createMergedXml(mergedSampleName, sampleList)
Example #4
0
    def identify(self):
        idx = self.acTree.selectedIndexes()[0]

        if not idx.isValid():
            print "Error, index is not valid"
            return
        p = idx.parent()
        if p.data().toString() in ("fragments/adducts:", "isotopic cluster:"):
            p = idx.parent().parent().parent()
        sample = self.currentSample[
            1 if self.acTree is self.view.treeView_2 else
            2]  #self.model.sample(p.data().toString(), fullNameEntry=False)
        if sample is None:
            print "Error, sample not found %s" % sample.shortName()
            return
        #data=None
        if len(idx.data().toString().split('/')) > 2:
            data = idx.data().toString().split('/')[:-1]
        else:
            data = idx.data().toString().split('/')
        peak = sample.peakAt(*map(float, data))
        if peak is None:
            self.view.showErrorMessage(
                "Error", "Unable to find the corresponding peak...")

        spl = MSSampleList()
        s = MSSample("None")
        s.rawPeaks = MSPeakList([peak], sample=s)
        spl.addSample(s)

        dial = MSIdentificationDialog(parent=self.view)
        dial.setAttribute(Qt.WA_DeleteOnClose)
        controller = MSIdentificationController(spl,
                                                dial,
                                                False,
                                                showDirectResult=True)