Skip to content
Snippets Groups Projects
Commit ba08b20f authored by Iris Mestres Pascual's avatar Iris Mestres Pascual
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 #17702 passed
...@@ -29,7 +29,7 @@ against one or more regions specified in a BED file.\n" ...@@ -29,7 +29,7 @@ against one or more regions specified in a BED file.\n"
author <- "Author: Alexander Kanitz" author <- "Author: Alexander Kanitz"
affiliation <- "Affiliation: Biozentrum, University of Basel" affiliation <- "Affiliation: Biozentrum, University of Basel"
email <- "Email: alexander.kanitz@alumni.ethz.ch" email <- "Email: alexander.kanitz@alumni.ethz.ch"
version <- "1.1.1" version <- "1.2.1"
version_formatted <- paste("Version:", version, sep=" ") version_formatted <- paste("Version:", version, sep=" ")
requirements <- c("optparse", "rtracklayer", "GenomicAlignments", "tools") requirements <- c("optparse", "rtracklayer", "GenomicAlignments", "tools")
requirements_txt <- paste("Requires:", paste(requirements, collapse=", "), sep=" ") requirements_txt <- paste("Requires:", paste(requirements, collapse=", "), sep=" ")
...@@ -124,6 +124,15 @@ option_list <- list( ...@@ -124,6 +124,15 @@ option_list <- list(
help="Character to denote insertions and deletions in alignments. [default \"%default\"]", help="Character to denote insertions and deletions in alignments. [default \"%default\"]",
metavar="char" metavar="char"
), ),
make_option(
"--prefix",
action="store",
type="character",
default=NULL,
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( make_option(
c("-h", "--help"), c("-h", "--help"),
action="store_true", action="store_true",
...@@ -154,6 +163,7 @@ fl.bam <- cli$args[2:length(cli$args)] ...@@ -154,6 +163,7 @@ fl.bam <- cli$args[2:length(cli$args)]
fl.ref <- cli$options[["reference"]] fl.ref <- cli$options[["reference"]]
fl.anno <- cli$options[["annotations"]] fl.anno <- cli$options[["annotations"]]
dir.out <- cli$options[["output-directory"]] dir.out <- cli$options[["output-directory"]]
prefix.out <- cli$options[["prefix"]]
width.max <- cli$options[["maximum-region-width"]] width.max <- cli$options[["maximum-region-width"]]
collapse <- ! cli$options[["do-not-collapse-alignments"]] collapse <- ! cli$options[["do-not-collapse-alignments"]]
count.min <- cli$options[["minimum-count"]] count.min <- cli$options[["minimum-count"]]
...@@ -186,8 +196,8 @@ bed <- import(con=fl.query) ...@@ -186,8 +196,8 @@ bed <- import(con=fl.query)
if (! is.null(fl.ref)) {ref <- FaFile(fl.ref)} if (! is.null(fl.ref)) {ref <- FaFile(fl.ref)}
if (! is.null(fl.anno)) {anno <- import(con=fl.anno)} if (! is.null(fl.anno)) {anno <- import(con=fl.anno)}
# Get file prefix from BAM files # Get file prefix from BAM files or from CLI argument
fl.prefix <- paste(basename(file_path_sans_ext(fl.bam)), collapse=".") fl.prefix <- if (! is.null(prefix.out)) prefix.out else paste(basename(file_path_sans_ext(fl.bam)), collapse=".")
#---> <---# #---> <---#
# Print status message # 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