Exemplo n.º 1
0
 def validate_run(self, log, info, exit_code, stdout):
     if "Warning - no spectra searched" in stdout:
         raise RuntimeError("No spectra in mzXML!")
     check_stdout(log, stdout)
     check_exitcode(log, exit_code)
     check_xml(log, info[Keys.PEPXML])
     return info
Exemplo n.º 2
0
    def validate_run(self, log, info, exit_code, stdout):
        # Double check "Spectrast finished ..."
        if not " without error." in stdout:
            raise RuntimeError("SpectraST finished with some error!")

        validation.check_exitcode(log, exit_code)
        validation.check_file(log, info['SPLIB'])
        return info
Exemplo n.º 3
0
    def validate_run(self, log, info, exit_code, out):
        validation.check_exitcode(log, exit_code)

        if 'Valid models = 0' in out:
            raise RuntimeError('No valid model found')

        validation.check_xml(log, info[Keys.PEPXML])
        return info
Exemplo n.º 4
0
 def validate_run(self, log, info, run_code, out):
     if "No decoys with label DECOY_ were found" in out:
         raise RuntimeError(
             "No DECOY_s found in fasta. Please use other fasta!")
     validation.check_stdout(log, out)
     validation.check_exitcode(log, run_code)
     validation.check_xml(log, info[Keys.PEPXML])
     return info
Exemplo n.º 5
0
    def validate_run(self, log, info, exit_code, stdout):
        if exit_code == -8:
            raise RuntimeError(
                "iProphet failed most probably because too few peptides were found in the search before"
            )
        for line in stdout.splitlines():
            if 'fin: error opening' in line:
                raise RuntimeError("Could not read the input file " + line)

        validation.check_exitcode(log, exit_code)
        validation.check_xml(log, info[Keys.PEPXML])
        return info
Exemplo n.º 6
0
    def validate_run(self, log, info, exit_code, stdout):
        check_exitcode(log, exit_code)

        weblogoexe = info['WEBLOGO']

        weblogoinputs = []
        for file in self.outfiles:
            weblogoinputs += fixStupidGibbsclusterFile(file, file + "out")

        commands = runweblogo_on_files(weblogoexe, weblogoinputs)
        self.execute_run(log, info, commands)

        return info
Exemplo n.º 7
0
    def validate_run(self, log, info, exit_code, stdout):
        validation.check_exitcode(log, exit_code)

        for msg in [
                'Error:',
                'did not find any InterProphet results in input data!',
                'no data - quitting', 'WARNING: No database referenced'
        ]:
            if msg in stdout:
                raise RuntimeError('ProteinProphet error [%s]' % msg)

        validation.check_xml(log, info[Keys.PROTXML])
        return info
    def validate_run(self, log, info, exit_code, stdout):
        if info['RUNRT'] == 'True':
            # Spectrast imports sample *whitout error* when no iRTs are found. Thus look for "Comment:" entries without
            # iRT= attribute in splib
            notenough = set()
            for line in open(info['SPLIB']).readlines():
                if "Comment:" in line and not "iRT=" in line:
                    samplename = re.search("RawSpectrum=([^\.]*)\.",
                                           line).group(1)
                    notenough.add(samplename)
            if notenough:
                log.error("No/not enough iRT peptides found in sample(s): " +
                          ", ".join(notenough))

            #when irt.txt not readable: PEPXML IMPORT: Cannot read landmark table. No RT normalization will be performed.
            rtcalibfailed = False
            for line in open(info['SPLOG']).readlines():
                if "Cannot read landmark table" in line:
                    log.error("Problem with reading rtkit file %s!" %
                              info['RTKIT'])
                    rtcalibfailed = True

            # Parse logfile to see whether R^2 is high enough. Example log for failed calibration (line 3 only when <0.9):
            # PEPXML IMPORT: RT normalization by linear regression. Found 10 landmarks in MS run "CHLUD_L110830_21".
            # PEPXML_IMPORT: Final fitted equation: iRT = (rRT - 1758) / (8.627); R^2 = 0.5698; 5 outliers removed.
            # ERROR PEPXML_IMPORT: R^2 still too low at required coverage. No RT normalization performed. Consider...
            rsqlow = False
            for line in open(info['SPLOG']).readlines():
                if "Final fitted equation:" in line:
                    samplename = prevline.strip().split(" ")[-1]
                    rsq = line.split()[-4].replace(";", "")
                    if float(rsq) < float(info['RSQ_THRESHOLD']):
                        log.error("R^2 of %s is below threshold of %s for %s" %
                                  (rsq, info['RSQ_THRESHOLD'], samplename))
                        rsqlow = True
                    else:
                        log.debug("R^2 of %s is OK for %s" % (rsq, samplename))
                else:
                    prevline = line

            # Raise only here to have all errors shown
            if rsqlow or rtcalibfailed or notenough:
                raise RuntimeError("Error in iRT calibration.")

        # Double check "Spectrast finished ..."
        if not " without error." in stdout:
            raise RuntimeError("SpectraST finished with some error!")

        validation.check_exitcode(log, exit_code)
        validation.check_file(log, info['SPLIB'])
        return info
Exemplo n.º 9
0
    def validate_run(self, log, info, exit_code, stdout):
        check_exitcode(log, exit_code)
        check_xml(log, info[Keys.PEPXML])

        #https://groups.google.com/forum/#!topic/spctools-discuss/dV8LSaE60ao
        shutil.move(info[Keys.PEPXML], info[Keys.PEPXML] + '.broken')
        fout = open(info[Keys.PEPXML], 'w')
        for line in open(info[Keys.PEPXML] + '.broken').readlines():
            if 'spectrumNativeID' in line:
                line = re.sub('spectrumNativeID="[^"]*"', '', line)
            fout.write(line)
        fout.close()

        return info
Exemplo n.º 10
0
 def validate_run(self, log, info, exit_code, stdout):
     validation.check_stdout(log, stdout)
     validation.check_exitcode(log, exit_code)
     validation.check_file(log, info['SPLIB'])
     validation.check_file(log, info['TSV'])
     return info