Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/samtools.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ task merge {
Array[File] bams
String prefix
File? new_header
String region = ""
String? region
Boolean attach_rg = true
Boolean name_sorted = false
Boolean combine_rg = true
Expand Down Expand Up @@ -585,7 +585,7 @@ task merge {
--threads "$n_cores" \
~{"-h \"" + new_header + "\""} \
~{if name_sorted then "-n" else ""} \
~{if (region != "") then "-R \"" + region + "\"" else ""} \
~{"-R \"" + region + "\""} \
~{if attach_rg then "-r" else ""} \
~{if combine_rg then "-c" else ""} \
~{if combine_pg then "-p" else ""} \
Expand Down
19 changes: 9 additions & 10 deletions workflows/rnaseq/rnaseq-core.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ workflow rnaseq_core {
Array[File] read_one_fastqs_gz
Array[File] read_two_fastqs_gz
Array[String] read_groups
String strandedness
String? strandedness
Boolean enable_read_trimming
Boolean mark_duplicates
Boolean cleanse_xenograft
Expand Down Expand Up @@ -162,15 +162,15 @@ workflow rnaseq_core {
Int chim_score_drop_max = 30
}

Map[String, String] htseq_strandedness_mapping = {
Map[String?, String] htseq_strandedness_mapping = {
"Stranded-Reverse": "reverse",
"Stranded-Forward": "yes",
"Unstranded": "no",
"Inconclusive": "undefined", # THIS WILL ERRROR (intentional)
"": "undefined",
None: "undefined",
}

String provided_strandedness = strandedness
String? provided_strandedness = strandedness

scatter (fq in read_one_fastqs_gz) {
String read_one_names = basename(fq)
Expand Down Expand Up @@ -253,7 +253,7 @@ workflow rnaseq_core {
}

String htseq_strandedness = (
if (provided_strandedness != "")
if defined(provided_strandedness)
then htseq_strandedness_mapping[provided_strandedness]
else htseq_strandedness_mapping[ngsderive_strandedness.strandedness_string]
)
Expand All @@ -263,11 +263,10 @@ workflow rnaseq_core {
gtf,
strandedness = htseq_strandedness,
prefix = basename(alignment_post.processed_bam, "bam")
+ (
if provided_strandedness == ""
then ngsderive_strandedness.strandedness_string
else provided_strandedness
),
+ select_first([
provided_strandedness,
ngsderive_strandedness.strandedness_string
]),
pos_sorted = true,
}

Expand Down
20 changes: 10 additions & 10 deletions workflows/rnaseq/rnaseq-standard-fastq.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ workflow rnaseq_standard_fastq {
warning: "See `data_structures/read_group.wdl` for more information and help formatting your input JSON.",
}
contaminant_db: "A compressed reference database corresponding to the aligner chosen with `xenocp_aligner` for the contaminant genome"
strandedness: {
description: "Strandedness protocol of the RNA-Seq experiment. If unspecified, strandedness will be inferred by `ngsderive`.",
choices: [
"",
"Stranded-Reverse",
"Stranded-Forward",
"Unstranded",
],
}
prefix: {
description: "Prefix for output files",
help: "See `../../README.md` for more information on the default prefix evaluation.",
Expand All @@ -49,15 +58,6 @@ workflow rnaseq_standard_fastq {
"star",
],
}
strandedness: {
description: "Strandedness protocol of the RNA-Seq experiment. If unspecified, strandedness will be inferred by `ngsderive`.",
choices: [
"",
"Stranded-Reverse",
"Stranded-Forward",
"Unstranded",
],
}
enable_read_trimming: "Enable read trimming with `fastp`?"
mark_duplicates: "Add SAM flag to computationally determined duplicate reads?"
cleanse_xenograft: "Use XenoCP to unmap reads from contaminant genome?"
Expand All @@ -73,13 +73,13 @@ workflow rnaseq_standard_fastq {
Array[File] read_two_fastqs_gz
Array[ReadGroup] read_groups
File? contaminant_db
String? strandedness
String prefix = sub(
basename(read_one_fastqs_gz[0]),
"(([_.][rR](?:ead)?[12])((?:[_.-][^_.-]*?)*?))?\\.(fastq|fq)(\\.gz)?$",
"" # Once replacing with capturing groups is supported, replace with group 3
)
String xenocp_aligner = "star"
String strandedness = ""
Boolean enable_read_trimming = false
Boolean mark_duplicates = false
Boolean cleanse_xenograft = false
Expand Down
23 changes: 11 additions & 12 deletions workflows/rnaseq/rnaseq-standard.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ workflow rnaseq_standard {
gtf: "Gzipped GTF feature file"
star_db: "Database of reference files for the STAR aligner. Can be generated by `star-db-build.wdl`"
contaminant_db: "A compressed reference database corresponding to the aligner chosen with `xenocp_aligner` for the contaminant genome"
prefix: "Prefix for output files"
xenocp_aligner: {
description: "Aligner to use to map reads to the host genome for detecting contamination",
choices: [
"bwa aln",
"bwa mem",
"star",
],
}
strandedness: {
description: "Strandedness protocol of the RNA-Seq experiment. If unspecified, strandedness will be inferred by `ngsderive`.",
choices: [
Expand All @@ -49,6 +40,15 @@ workflow rnaseq_standard {
"Unstranded",
],
}
prefix: "Prefix for output files"
xenocp_aligner: {
description: "Aligner to use to map reads to the host genome for detecting contamination",
choices: [
"bwa aln",
"bwa mem",
"star",
],
}
enable_read_trimming: "Enable read trimming with `fastp`?"
mark_duplicates: "Add SAM flag to computationally determined duplicate reads?"
cleanse_xenograft: "Use XenoCP to unmap reads from contaminant genome?"
Expand All @@ -62,9 +62,9 @@ workflow rnaseq_standard {
File gtf
File star_db
File? contaminant_db
String? strandedness
String prefix = basename(bam, ".bam")
String xenocp_aligner = "star"
String strandedness = ""
Boolean enable_read_trimming = false
Boolean mark_duplicates = false
Boolean cleanse_xenograft = false
Expand Down Expand Up @@ -147,7 +147,6 @@ task parse_input {
strand: {
description: "Provided strandedness protocol of the RNA-Seq experiment",
choices: [
"",
"Stranded-Reverse",
"Stranded-Forward",
"Unstranded",
Expand All @@ -158,7 +157,7 @@ task parse_input {
}

input {
String strand
String? strand
Boolean cleanse_xenograft
Boolean contaminant_db
}
Expand Down
Loading