示例#1
0
文件: datfile.py 项目: hdinkel/isob
    def __init__(self, filedic, hdf5, cfg, logs, searchID, quantMethod):
        '''
        @brief initialise the Datfile object
        @param filedic <dictionary>: containig the full path to the dat file and other file data
        @param hdf5 <hdf5 object>: containing all the writing methods for hdf5 output
        @param cfg <cfg object>: containing all the running parameters
        @param dbobj <db object>: linking to the meet database
        '''
        self.filedic = filedic
        self.searchid = searchID
        self.quantMethod = quantMethod
        datfilename = filedic['dat']
        if datfilename == str(None):
            raise ExHa.FileNotFoundException('no resulting datfile found with search')
        self.datfilename = datfilename
        self.cfg = cfg
        self.logs = logs
        self.hdfMascot = hdf5
        self.dataDir = filedic['datpath'].parent

        self.spectra = {}
        self.peptidecounter = 0
        self.failedsequences = 0
        self.sequences = {}
        self.seq2acc = {}
        self.hookpeps = []
        self.hookppm = []

        self.analtimes = dict(first=40, last=0, early=[])
        self.stats = dict(numpeps=0, numfailedpeps=0, numspectra_nopeps=0)
示例#2
0
            msg = 'merged sample'
        else:
            isMerged = False
            msg = 'single sample'

        importer = DATimporter(cfg, logger)
        logger.log.info(msg)
        searchDict = {}
        for idx, hdf5file in enumerate(searches):
            searchData = {}
            searchData['hdf5name'] = hdf5file
            searchData['archivepath'] = cfg.parameters['runtime']['datadir']
            fullPath = searchData['archivepath']
            fi = fullPath.joinpath(searchData['hdf5name'])
            if not fi.exists():
                raise ExHa.FileNotFoundException('Missing file: %s' % str(fi))
            logger.log.info('Reading: %s' % str(fi))
            importer.addHDFfile(fi, idx + 1, logger)
        sw.rec('file loading')
        fdrthreshold = cfg.parameters['general']['fdrthreshold']
        peptidescoreatthreshold, score2fdr = importer.calculateFDR(
            importer.setsManager.FDRdata, fdrthreshold)
        importer.importData.score2fdr = score2fdr

        importer.finaliseProteins(peptidescoreatthreshold)
        proteinscoreatthreshold, score2fdr = importer.calculateFDR(
            importer.setsManager.proteinFDRdata, fdrthreshold)

        importer.importData.proteinscore2fdr = score2fdr

        finalMessage = importer.updateHDF5()