How to use the ms2pip.ms2pipC.run function in ms2pip

To help you get started, we’ve selected a few ms2pip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github compomics / ms2pip_c / fasta2speclib / fasta2speclib.py View on Github external
logging.debug("Adding charge states %s", str(params['charges']))
        peprec_batch = add_charges(peprec_batch)

        if type(params['peprec_filter']) == str:
            logging.debug("Removing peptides present in peprec filter")
            peprec_filter = pd.read_csv(params['peprec_filter'], sep=' ')
            peprec_batch = remove_from_peprec_filter(peprec_batch, peprec_filter)

        # Write ptm/charge-extended peprec from this batch to H5 file:
        peprec_batch.astype(str).to_hdf(
            '{}_expanded.peprec.hdf'.format(params['output_filename']), key='table',
            format='table', complevel=3, complib='zlib', mode='a'
        )

        logging.info("Running MS2PIPc for %d peptides", len(peprec_batch))
        all_preds = run(peprec_batch, num_cpu=params['num_cpu'], output_filename=params['output_filename'],
                        params=ms2pip_params, return_results=True)

        if b_count == 1:
            write_mode = 'w'
            append = False
        else:
            write_mode = 'a'
            append = True

        if 'hdf' in params['output_filetype']:
            logging.info("Writing predictions to %s_predictions.hdf", params['output_filename'])
            all_preds.astype(str).to_hdf(
                '{}_predictions.hdf'.format(params['output_filename']),
                key='table', format='table', complevel=3, complib='zlib',
                mode=write_mode, append=append, min_itemsize=50
            )
github compomics / ms2pip_c / ms2pip / __main__.py View on Github external
def main():
	print_logo()
	pep_file, spec_file, vector_file, config_file, num_cpu, correlations, tableau = argument_parser()
	params = load_configfile(config_file)
	run(pep_file, spec_file=spec_file, vector_file=vector_file, params=params,
	num_cpu=num_cpu, compute_correlations=correlations, tableau=tableau)