Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
)
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)