-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a WDL to run ExpansionHunter on multiple samples (#253)
* Add a WDL to run ExpansionHunter on multiple inputs. * Add output prefix arg, defaults to input filename. * Rename docker var in EH WDLs to 'expansion_hunter_docker' * Add an optional list of per sample output prefix.
- Loading branch information
Showing
2 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
version 1.0 | ||
|
||
import "Structs.wdl" | ||
import "ExpansionHunter.wdl" as ExpansionHunter | ||
|
||
workflow ExpansionHunterScatter { | ||
|
||
input { | ||
Array[File] bams_or_crams | ||
Array[File]? bams_or_crams_indexes | ||
Array[String]? sample_ids | ||
File reference_fasta | ||
File? reference_fasta_index | ||
File variant_catalog | ||
String expansion_hunter_docker | ||
RuntimeAttr? runtime_attr | ||
} | ||
scatter (i in range(length(bams_or_crams))) { | ||
File bam_or_cram_ = bams_or_crams[i] | ||
Boolean is_bam = | ||
basename(bam_or_cram_, ".bam") + ".bam" == basename(bam_or_cram_) | ||
File bam_or_cram_index_ = | ||
if defined(bams_or_crams_indexes) then | ||
select_first([bams_or_crams_indexes])[i] | ||
else | ||
bam_or_cram_ + if is_bam then ".bai" else ".crai" | ||
File reference_fasta_index_ = select_first([ | ||
reference_fasta_index, reference_fasta + ".fai"]) | ||
|
||
String output_prefix = | ||
if defined(sample_ids) then | ||
select_first([sample_ids])[i] | ||
else | ||
if is_bam then | ||
basename(bam_or_cram_, ".bam") | ||
else | ||
basename(bam_or_cram_, ".cram") | ||
|
||
call ExpansionHunter.ExpansionHunter as expanionHunter { | ||
input: | ||
bam_or_cram=bam_or_cram_, | ||
bam_or_cram_index=bam_or_cram_index_, | ||
reference_fasta=reference_fasta, | ||
reference_fasta_index=reference_fasta_index_, | ||
variant_catalog=variant_catalog, | ||
output_prefix=output_prefix, | ||
expansion_hunter_docker=expansion_hunter_docker, | ||
runtime_attr=runtime_attr | ||
} | ||
} | ||
output { | ||
Array[File] jsons = expanionHunter.json | ||
Array[File] vcfs = expanionHunter.vcf | ||
Array[File] overlapping_reads = expanionHunter.overlapping_reads | ||
} | ||
} |