Skip to content

Commit

Permalink
chore(workflows): use genome ID for fasta filename base
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Dec 6, 2023
1 parent 93e2242 commit bbd55ad
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bento_reference_service/workflows/wdls/fasta_ref.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ workflow fasta_ref {

call uncompress_fasta_and_generate_fai_if_needed as s1 {
input:
genome_id = genome_id,
genome_fasta = genome_fasta
}

Expand Down Expand Up @@ -47,22 +48,23 @@ workflow fasta_ref {

task uncompress_fasta_and_generate_fai_if_needed {
input {
String genome_id
File genome_fasta
}

command <<<
if [[ '~{genome_fasta}' == *.gz ]]; then
gunzip -c '~{genome_fasta}' > genome.fasta
gunzip -c '~{genome_fasta}' > '~{genome_id}.fasta'
rm '~{genome_fasta}'
else
mv '~{genome_fasta}' genome.fasta
mv '~{genome_fasta}' '~{genome_id}.fasta'
fi
samtools faidx genome.fasta --fai-idx genome.fasta.fai
samtools faidx '~{genome_id}.fasta' --fai-idx '~{genome_id}.fasta.fai'
>>>

output {
File fasta = "genome.fasta"
File fai = "genome.fasta.fai"
File fasta = "${genome_id}.fasta"
File fai = "${genome_id}.fasta.fai"
}
}

Expand Down

0 comments on commit bbd55ad

Please sign in to comment.