Skip to content
Snippets Groups Projects
Commit ec34d1b9 authored by deliaBlue's avatar deliaBlue
Browse files

feat: add output prefix assignment

parent a5c6a4a0
No related branches found
No related tags found
1 merge request!10feat: add output prefix assignment
Pipeline #17698 passed
......@@ -124,6 +124,15 @@ option_list <- list(
help="Character to denote insertions and deletions in alignments. [default \"%default\"]",
metavar="char"
),
make_option(
"--prefix",
action="store",
type="character",
default="",
help="Prefix to be used in the output file name(s). If not provided
the input BAM file(s) name will be used instead,",
metavar="string"
),
make_option(
c("-h", "--help"),
action="store_true",
......@@ -154,6 +163,7 @@ fl.bam <- cli$args[2:length(cli$args)]
fl.ref <- cli$options[["reference"]]
fl.anno <- cli$options[["annotations"]]
dir.out <- cli$options[["output-directory"]]
prefix.out <- cli$options[["prefix"]]
width.max <- cli$options[["maximum-region-width"]]
collapse <- ! cli$options[["do-not-collapse-alignments"]]
count.min <- cli$options[["minimum-count"]]
......@@ -186,8 +196,8 @@ bed <- import(con=fl.query)
if (! is.null(fl.ref)) {ref <- FaFile(fl.ref)}
if (! is.null(fl.anno)) {anno <- import(con=fl.anno)}
# Get file prefix from BAM files
fl.prefix <- paste(basename(file_path_sans_ext(fl.bam)), collapse=".")
# Get file prefix from BAM files or from CLI argument
fl.prefix <- if (prefix.out != "") prefix.out else paste(basename(file_path_sans_ext(fl.bam)), collapse=".")
#---> <---#
# Print status message
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment