Beispiel #1
0
    def test_fdr(self):
        iprob, fdr = get_iprob_for_fdr("0.004",
                                       "mayu-mFDR",
                                       mayuout='mayuout_main_1.07.csv')
        assert iprob == 0.916488

        iprob, fdr = get_iprob_for_fdr("0.025",
                                       "mayu-pepFDR",
                                       mayuout='mayuout_main_1.07.csv')
        assert iprob == 0.75728

        iprob, fdr = get_iprob_for_fdr("0.05",
                                       "mayu-protFDR",
                                       mayuout='mayuout_main_1.07.csv')
        assert iprob == 0.803986

        iprob, fdr = get_iprob_for_fdr("0.025",
                                       "iprophet-pepFDR",
                                       pepxml="iprophet.pep.xml")
        assert iprob == 0.6524

        self.assertRaises(RuntimeError,
                          get_iprob_for_fdr,
                          "0.1234",
                          "iprophet-pepFDR",
                          pepxml="iprophet.pep.xml")
Beispiel #2
0
    def test_fdr(self):
        iprob, fdr = get_iprob_for_fdr("0.004", "mayu-mFDR", mayuout='mayuout_main_1.07.csv')
        assert iprob == 0.916488

        iprob, fdr = get_iprob_for_fdr("0.025", "mayu-pepFDR", mayuout='mayuout_main_1.07.csv')
        assert iprob == 0.75728

        iprob, fdr = get_iprob_for_fdr("0.05", "mayu-protFDR", mayuout='mayuout_main_1.07.csv')
        assert iprob == 0.803986

        iprob, fdr = get_iprob_for_fdr("0.025", "iprophet-pepFDR", pepxml="iprophet.pep.xml")
        assert iprob == 0.6524

        self.assertRaises(RuntimeError, get_iprob_for_fdr, "0.1234", "iprophet-pepFDR", pepxml="iprophet.pep.xml")
    def prepare_run(self, log, info):
        wd = info[Keys.WORKDIR]
        # get iProb corresponding FDR for IDFilter
        info['IPROB'], info['FDR'] = get_iprob_for_fdr(info['FDR_CUTOFF'], info['FDR_TYPE'], mayuout=info.get('MAYUOUT'),
                                                      pepxml=info[Keys.PEPXML])

        # required because openbis requires prot.xml and openms protXML
        peplink = os.path.join(wd, 'iprophet.pepXML')
        os.symlink(info[Keys.PEPXML], peplink)
        info[Keys.PEPXML] = peplink
        info['MZNAME'] = os.path.splitext(os.path.basename(info[Keys.MZXML]))[0]

        tpl = os.path.join(wd, 'part1_pp_ff.toppas')
        templates.read_mod_write(info, templates.get_tpl_of_class(self), tpl)
        #add toppas file path, will be added in dropbox
        info["TOPPASFILES"] = tpl

        rawfeatxml = os.path.join(wd, 'TOPPAS_out/012-IDConflictResolver/*.featureXML')
        info['FEATUREXML'] = os.path.join(wd, os.path.splitext(os.path.basename(info[Keys.MZXML]))[0] + '.featureXML')

        command = 'ExecutePipeline -in %s -out_dir %s  | grep -v "^WARNING" && chmod -R g+w %s && ' \
                  'mv -v %s %s' % (
                      tpl, wd, wd,
                      rawfeatxml, info['FEATUREXML'])
        return info, command
Beispiel #4
0
    def prepare_run(self, log, info):
        if isinstance(info[Keys.PEPXML], list):
            raise RuntimeError("This ProteinProphet only takes one iProphet inputfile!")

        info['IPROB'],info['FDR'] = get_iprob_for_fdr(info['FDR_CUTOFF'], info['FDR_TYPE'], mayuout=info.get('MAYUOUT'),
                                                      pepxml=info[Keys.PEPXML])

        info['PROTEINPROPHET'] = 'IPROPHET MINPROB%s' % info['IPROB']
        wd = info[Keys.WORKDIR]
        info['PROTXML'] = os.path.join(wd, 'ProteinProphet.prot.xml')
        exe = info.get(Keys.EXECUTABLE, 'ProteinProphet')
        command = '%s %s %s %s' % (exe, info[Keys.PEPXML], info['PROTXML'], info['PROTEINPROPHET'])
        return info, command
Beispiel #5
0
    def prepare_run(self, log, info):
        # symlink the pepxml and mzxml files first into a single directory
        peplink = os.path.join(info[Keys.WORKDIR], os.path.basename(info[Keys.PEPXML]))
        log.debug('create symlink [%s] -> [%s]' % (info[Keys.PEPXML], peplink))
        os.symlink(info[Keys.PEPXML], peplink)

        if isinstance(info[Keys.MZXML], list):
            mzxmlslinks = info[Keys.MZXML]
        else:
            mzxmlslinks = [info[Keys.MZXML]]
        for f in mzxmlslinks:
            dest = os.path.join(info[Keys.WORKDIR], os.path.basename(f))
            log.debug('create symlink [%s] -> [%s]' % (f, dest))
            os.symlink(f, dest)

        info['SPLOG'] = os.path.join(info[Keys.WORKDIR], 'spectrast.log')

        # get iProb corresponding FDR for IDFilter
        info['IPROB'], info['FDR'] = get_iprob_for_fdr(info['FDR_CUTOFF'], info['FDR_TYPE'],
                                                       mayuout=info.get('MAYUOUT'),
                                                       pepxml=info.get(Keys.PEPXML))

        if info.get("RUNRT") == "True":
            rtcorrect = "-c_IRT%s -c_IRR" % info['RTKIT']
        else:
            rtcorrect = ""

        rtcalib_base = os.path.join(info[Keys.WORKDIR], 'RTcalib')
        rtcalib = rtcalib_base + '.splib'

        consensustype = ""
        if info['CONSENSUS_TYPE'] == "Consensus":
            consensustype = "C"
        elif info['CONSENSUS_TYPE'] == "Best replicate":
            consensustype = "B"

        consensus_base = os.path.join(info[Keys.WORKDIR], 'consensus')
        consensus = consensus_base + '.splib'
        info['SPLIB'] = consensus

        command = "spectrast -L%s -c_RDYDECOY -cI%s -cP%s %s -cN%s %s && " \
                  "spectrast -L%s -c_BIN! -cA%s -cN%s %s" % (
                      info['SPLOG'], info['MS_TYPE'], info['IPROB'], rtcorrect, rtcalib_base, peplink,
                      info['SPLOG'], consensustype, consensus_base, rtcalib)

        return info, command
Beispiel #6
0
    def prepare_run(self, log, info):
        if isinstance(info[Keys.PEPXML], list):
            raise RuntimeError(
                "This ProteinProphet only takes one iProphet inputfile!")

        info['IPROB'], info['FDR'] = get_iprob_for_fdr(
            info['FDR_CUTOFF'],
            info['FDR_TYPE'],
            mayuout=info.get('MAYUOUT'),
            pepxml=info[Keys.PEPXML])

        info['PROTEINPROPHET'] = 'IPROPHET MINPROB%s' % info['IPROB']
        wd = info[Keys.WORKDIR]
        info['PROTXML'] = os.path.join(wd, 'ProteinProphet.prot.xml')
        exe = info.get(Keys.EXECUTABLE, 'ProteinProphet')
        command = '%s %s %s %s' % (exe, info[Keys.PEPXML], info['PROTXML'],
                                   info['PROTEINPROPHET'])
        return info, command