Mercurial > repos > recetox > recetox_aplcms_align_features
view mzml_id_getter.py @ 9:7b42ee54d757 draft
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox_aplcms commit 0873c036d734782d2647b0eea84cd1a0658f5e58
author | recetox |
---|---|
date | Wed, 19 Jul 2023 00:27:03 +0000 |
parents | abe783e0daca |
children |
line wrap: on
line source
#!/usr/bin/env python import argparse import sys from pymzml.run import Reader def main(argv): parser = argparse.ArgumentParser(description='Get run ID from an mzML file.') parser.add_argument('mzml_file', help='Path to an mzML file to get run ID from.') args = parser.parse_args() mzml = Reader(args.mzml_file) id = mzml.info['run_id'] if id is not None: with open("sample_name.txt", mode='x') as f: f.write(id) if __name__ == '__main__': main(sys.argv[1:])