diff --git a/create_metagene_profile.py b/create_metagene_profile.py index 79c495b908762b5edf5014195306c3fe905e854a..3b185a4c5e0ed53d1e1ea7bd84e1a73d201c2a39 100755 --- a/create_metagene_profile.py +++ b/create_metagene_profile.py @@ -72,6 +72,7 @@ import sys import warnings from copy import deepcopy from pathlib import Path +from shutil import copyfile from tempfile import NamedTemporaryFile from collections import defaultdict # from itertools import chain @@ -310,6 +311,10 @@ def main(): help="Path to a file containing one gene identifier per line.\n" "The metagene profile will only take into account those genes.\n" "This should not be used at the same time as option -c") + parser.add_argument( + "-k", "--keep_bed", + help="Path to a file where bed coordinates of the genes " + "listed whith option -g are to be saved.") parser.add_argument( "-c", "--bed_coordinates", help="Path to a file containing the coordinates of the features " @@ -380,6 +385,9 @@ def main(): args.bigwig_files, bed_filename, plot_filename=args.profile_plot, **extra_parameters) if args.gene_list: + if args.keep_bed: + copyfile(bed_filename, args.keep_bed) + print(f"bed coordinates saved in: {args.keep_bed}") os.unlink(bed_filename) return 0