Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
output_filename="{}".format(params['output_filename']),
write_mode=write_mode,
)
if 'mgf' in params['output_filetype']:
logging.info("Writing MGF file")
spectrum_output.write_mgf(
all_preds,
peprec=peprec_batch,
output_filename="{}".format(params['output_filename']),
write_mode=write_mode
)
if 'bibliospec' in params['output_filetype']:
logging.info("Writing BiblioSpec SSL and MS2 files")
spectrum_output.write_bibliospec(
all_preds,
peprec_batch,
ms2pip_params,
output_filename="{}".format(params['output_filename']),
write_mode=write_mode
)
if 'spectronaut' in params['output_filetype']:
logging.info("Writing Spectronaut CSV file")
spectrum_output.write_spectronaut(
all_preds,
peprec_batch,
ms2pip_params,
output_filename="{}".format(params['output_filename']),
write_mode=write_mode
)
if not return_results:
if "mgf" in out_formats:
print("writing MGF file {}_predictions.mgf...".format(output_filename))
spectrum_output.write_mgf(
all_preds, peprec=data, output_filename=output_filename
)
if "msp" in out_formats:
print("writing MSP file {}_predictions.msp...".format(output_filename))
spectrum_output.write_msp(
all_preds, data, output_filename=output_filename
)
if "bibliospec" in out_formats:
print("writing SSL/MS2 files...")
spectrum_output.write_bibliospec(
all_preds, data, params, output_filename=output_filename
)
if "spectronaut" in out_formats:
print("writing Spectronaut CSV files...")
spectrum_output.write_spectronaut(
all_preds, data, params, output_filename=output_filename
)
if "csv" in out_formats:
print("writing CSV {}_predictions.csv...".format(output_filename))
all_preds.to_csv(
"{}_predictions.csv".format(output_filename), index=False
)
sys.stdout.write("done!\n")