Skip to content

Commit

Permalink
Merge pull request #426 from broadinstitute/dp-cdc
Browse files Browse the repository at this point in the history
lofreq task portability, misc other edits
  • Loading branch information
dpark01 authored Jun 9, 2022
2 parents 440e47e + 6171e49 commit 2bfde65
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 9 deletions.
20 changes: 16 additions & 4 deletions pipes/WDL/tasks/tasks_intrahost.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,25 @@ task lofreq {

lofreq version | grep version | sed 's/.* \(.*\)/\1/g' | tee LOFREQ_VERSION

samtools faidx "~{reference_fasta}"
samtools index "~{aligned_bam}"
# make local copies because CWD is writeable but localization dir isn't always
cp "~{reference_fasta}" reference.fasta
cp "~{aligned_bam}" aligned.bam

# samtools faidx fails if fasta is empty
if [ $(grep -v '^>' reference.fasta | tr -d '\nNn' | wc -c) == "0" ]; then
touch "~{out_basename}.vcf"
exit 0
fi

# index for lofreq
samtools faidx reference.fasta
samtools index aligned.bam

# lofreq
lofreq call \
-f "~{reference_fasta}" \
-f reference.fasta \
-o "~{out_basename}.vcf" \
"~{aligned_bam}"
aligned.bam
>>>

output {
Expand Down
2 changes: 1 addition & 1 deletion pipes/WDL/tasks/tasks_ncbi.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ task prepare_genbank {
}
}
task package_genbank_ftp_submission {
task package_sc2_genbank_ftp_submission {
meta {
description: "Prepares a zip and xml file for FTP-based NCBI Genbank submission according to instructions at https://www.ncbi.nlm.nih.gov/viewvc/v1/trunk/submit/public-docs/genbank/SARS-CoV-2/."
}
Expand Down
1 change: 1 addition & 0 deletions pipes/WDL/workflows/metagenomic_denovo.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ workflow metagenomic_denovo {
input:
contigs_fasta = assemble.contigs_fasta,
reads_bam = dehosted_bam,
sample_name = sample_name,
reference_genome_fasta = reference_genome_fasta
}

Expand Down
4 changes: 2 additions & 2 deletions pipes/WDL/workflows/sarscov2_genbank.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ workflow sarscov2_genbank {
defaults_yaml = author_sbt_defaults_yaml,
j2_template = author_sbt_j2_template
}
call ncbi.package_genbank_ftp_submission as passing_package_genbank {
call ncbi.package_sc2_genbank_ftp_submission as passing_package_genbank {
input:
sequences_fasta = passing_fasta.combined,
source_modifier_table = passing_source_modifiers.genbank_source_modifier_table,
Expand Down Expand Up @@ -159,7 +159,7 @@ workflow sarscov2_genbank {
assembly_stats_tsv = assembly_stats_tsv,
filter_to_ids = weird_ids.ids_txt
}
call ncbi.package_genbank_ftp_submission as weird_package_genbank {
call ncbi.package_sc2_genbank_ftp_submission as weird_package_genbank {
input:
sequences_fasta = weird_fasta.combined,
source_modifier_table = weird_source_modifiers.genbank_source_modifier_table,
Expand Down
2 changes: 1 addition & 1 deletion pipes/WDL/workflows/sarscov2_illumina_full.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ workflow sarscov2_illumina_full {
sequences = submittable_filter.filtered_fasta,
keep_list = [biosample_to_genbank.sample_ids]
}
call ncbi.package_genbank_ftp_submission {
call ncbi.package_sc2_genbank_ftp_submission as package_genbank_ftp_submission {
input:
sequences_fasta = submit_genomes.filtered_fasta,
source_modifier_table = biosample_to_genbank.genbank_source_modifier_table,
Expand Down
2 changes: 1 addition & 1 deletion pipes/WDL/workflows/sarscov2_sra_to_genbank.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ workflow sarscov2_sra_to_genbank {
assembly_stats_tsv = write_tsv(flatten([[['SeqID','Assembly Method','Coverage','Sequencing Technology']],select_all(assembly_cmt)])),
filter_to_ids = write_lines(select_all(submittable_id))
}
call ncbi.package_genbank_ftp_submission {
call ncbi.package_sc2_genbank_ftp_submission as package_genbank_ftp_submission {
input:
sequences_fasta = submit_genomes.combined,
source_modifier_table = biosample_to_genbank.genbank_source_modifier_table,
Expand Down

0 comments on commit 2bfde65

Please sign in to comment.