Exemplo n.º 1
0
        for isotopelabel_id, data in allsumionratiodata.iteritems():
            allfractionbgratios[isotopelabel_id] = np.median(data)
        # second normalization so that the bg-ratios all add to 1
        for isotopelabel_id, data in allfractionbgratios.iteritems():
            allfractionbgratios[isotopelabel_id] = data / sum(allfractionbgratios.values())
        logger.log.debug(('allfractionbgratios are %s' % str(allfractionbgratios)))
        for corrects2iquantob in corrects2iquantoblist:
            # perform correction for each of the analyzed .hdf5 files.
            s2icorrecteddata = corrects2iquantob.performS2Icorrection(allfractionbgratios)
            corrects2iquantob.hdf5corrects2iquant.updates2ivalues(s2icorrecteddata)
            hdf5corrects2iquant.close()

    except ExHa.czException as czEx:
        ExHa.reformatException(czEx)
        ExHa.addContext(czEx, 'Error during corrects2iquant run')
        ExHa.exportError2File(czEx, cfg.parameters['runtime']['datadir'] / Path('errors.error'))
        if logger:
            logger.log.warning(ExHa.oneLineRepr(czEx))
        else:
            print ExHa.multiLineRepr(czEx)

    except Exception as genEx:

        ExHa.reformatException(genEx)
        ExHa.addContext(genEx, 'Error during corrects2iquant run')
        ExHa.exportError2File(genEx, cfg.parameters['runtime']['datadir'] / 'errors.error')
        if logger:
            logger.log.warning(ExHa.oneLineRepr(genEx))
        else:
            print ExHa.multiLineRepr(genEx)
Exemplo n.º 2
0
Arquivo: mgf.py Projeto: hdinkel/isob
        for f in dataDir.glob(fileFilter):
            if not f.is_file():
                # skip any directories
                continue

            # if f.name[:4] in ['6528', '1814', '2032']: continue
            mgf = mgftools(f)
            logger.log.info('Filename:     %s' % f.name)
            if hcdOnly:
                logger.log.info('Export HCD data only')
            else:
                logger.log.info('Using filters: %s' % str(mgf.usefilts))
            rtn = mgf.export(hcdOnly)
            mgf.close()
        if f == 0:
            raise ExHa.MGFprocessingError('no files found for: %s' %
                                          str(dataDir / fileFilter))

    except ExHa.UsageError as useEx:
        ExHa.reformatException(useEx)
        logger.log.info(useEx.context)
    except Exception, genEx:
        ExHa.reformatException(genEx)
        if f:
            ExHa.exportError2File(genEx, f.parent.joinpath(f.stem + '.error'))
        else:
            ExHa.exportError2File(genEx, dataDir.joinpath('errors.error'))
        logger.log.info(ExHa.multiLineRepr(genEx))

    logger.log.info('finished')