Skip to content

Commit

Permalink
format: maximum/None (240 or zero)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-frantz committed Jan 15, 2025
1 parent d3d7a23 commit 95fd444
Show file tree
Hide file tree
Showing 37 changed files with 331 additions and 682 deletions.
12 changes: 4 additions & 8 deletions data_structures/flag_filter.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,10 @@ workflow validate_flag_filter {
FlagFilter flags
}

call validate_string_is_12bit_oct_dec_or_hex as validate_include_if_any {
input: number = flags.include_if_any }
call validate_string_is_12bit_oct_dec_or_hex as validate_include_if_all {
input: number = flags.include_if_all }
call validate_string_is_12bit_oct_dec_or_hex as validate_exclude_if_any {
input: number = flags.exclude_if_any }
call validate_string_is_12bit_oct_dec_or_hex as validate_exclude_if_all {
input: number = flags.exclude_if_all }
call validate_string_is_12bit_oct_dec_or_hex as validate_include_if_any { input: number = flags.include_if_any }
call validate_string_is_12bit_oct_dec_or_hex as validate_include_if_all { input: number = flags.include_if_all }
call validate_string_is_12bit_oct_dec_or_hex as validate_exclude_if_any { input: number = flags.exclude_if_any }
call validate_string_is_12bit_oct_dec_or_hex as validate_exclude_if_all { input: number = flags.exclude_if_all }

output {
String check = "passed"
Expand Down
129 changes: 43 additions & 86 deletions data_structures/read_group.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -81,38 +81,24 @@ task read_group_to_string {
command <<<
{
echo -n "~{"ID:~{read_group.ID}"}" # required field. All others optional
echo -n "~{if defined(read_group.BC) then " BC:~{
read_group.BC}" else ""}"
echo -n "~{if defined(read_group.CN) then " CN:~{
read_group.CN}" else ""}"
echo -n "~{if defined(read_group.DS) then " DS:~{
read_group.DS}" else ""}"
echo -n "~{if defined(read_group.DT) then " DT:~{
read_group.DT}" else ""}"
echo -n "~{if defined(read_group.FO) then " FO:~{
read_group.FO}" else ""}"
echo -n "~{if defined(read_group.KS) then " KS:~{
read_group.KS}" else ""}"
echo -n "~{if defined(read_group.LB) then " LB:~{
read_group.LB}" else ""}"
echo -n "~{if defined(read_group.PG) then " PG:~{
read_group.PG}" else ""}"
echo -n "~{if defined(read_group.PI) then " PI:~{
read_group.PI}" else ""}"
echo -n "~{if defined(read_group.PL) then " PL:~{
read_group.PL}" else ""}"
echo -n "~{if defined(read_group.PM) then " PM:~{
read_group.PM}" else ""}"
echo -n "~{if defined(read_group.PU) then " PU:~{
read_group.PU}" else ""}"
echo "~{if defined(read_group.SM) then " SM:~{
read_group.SM}" else ""}"
echo -n "~{if defined(read_group.BC) then " BC:~{read_group.BC}" else ""}"
echo -n "~{if defined(read_group.CN) then " CN:~{read_group.CN}" else ""}"
echo -n "~{if defined(read_group.DS) then " DS:~{read_group.DS}" else ""}"
echo -n "~{if defined(read_group.DT) then " DT:~{read_group.DT}" else ""}"
echo -n "~{if defined(read_group.FO) then " FO:~{read_group.FO}" else ""}"
echo -n "~{if defined(read_group.KS) then " KS:~{read_group.KS}" else ""}"
echo -n "~{if defined(read_group.LB) then " LB:~{read_group.LB}" else ""}"
echo -n "~{if defined(read_group.PG) then " PG:~{read_group.PG}" else ""}"
echo -n "~{if defined(read_group.PI) then " PI:~{read_group.PI}" else ""}"
echo -n "~{if defined(read_group.PL) then " PL:~{read_group.PL}" else ""}"
echo -n "~{if defined(read_group.PM) then " PM:~{read_group.PM}" else ""}"
echo -n "~{if defined(read_group.PU) then " PU:~{read_group.PU}" else ""}"
echo "~{if defined(read_group.SM) then " SM:~{read_group.SM}" else ""}"
} > out.txt
>>>

output {
String stringified_read_group = read_string("out.txt"
)
String stringified_read_group = read_string("out.txt")
}

runtime {
Expand Down Expand Up @@ -164,8 +150,7 @@ task get_read_groups {
>>>
output {
Array[ReadGroup] read_groups = read_json("read_groups.json"
)
Array[ReadGroup] read_groups = read_json("read_groups.json")
}
runtime {
Expand Down Expand Up @@ -225,15 +210,13 @@ task validate_read_group {
|| [[ ~{read_group.ID} =~ ~{restrictive_pattern} ]]
then
>&2 echo "ID (~{read_group.ID}) must not match patterns:"
>&2 echo "'~{id_pattern}' or '~{
restrictive_pattern}'"
>&2 echo "'~{id_pattern}' or '~{restrictive_pattern}'"
error=1
fi
fi
if [[ ! "~{read_group.ID}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "ID must match pattern ~{
sam_spec_pattern}"
>&2 echo "ID must match pattern ~{sam_spec_pattern}"
error=1
fi
if [ $(echo "~{sep(" ", required_fields)}" | grep -Ewc "SM") -eq 1 ]
Expand All @@ -248,22 +231,17 @@ task validate_read_group {
then
if [[ ~{restrictive} == "true" ]]
then
if [[ "~{read_group.SM}" =~ ^~{
sample_pattern}$ ]] \
|| [[ "~{read_group.SM}" =~ ~{
restrictive_pattern} ]]
if [[ "~{read_group.SM}" =~ ^~{sample_pattern}$ ]] \
|| [[ "~{read_group.SM}" =~ ~{restrictive_pattern} ]]
then
>&2 echo "SM must not match patterns:"
>&2 echo "'~{sample_pattern}' or '~{
restrictive_pattern}'"
>&2 echo "'~{sample_pattern}' or '~{restrictive_pattern}'"
error=1
fi
fi
if [[ ! "~{read_group.SM}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.SM}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "SM must match pattern ~{
sam_spec_pattern}"
>&2 echo "SM must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand All @@ -277,11 +255,9 @@ task validate_read_group {
fi
if [ "~{defined(read_group.BC)}" == "true" ]
then
if [[ ! "~{read_group.BC}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.BC}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "BC must match pattern ~{
sam_spec_pattern}"
>&2 echo "BC must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand All @@ -295,11 +271,9 @@ task validate_read_group {
fi
if [ "~{defined(read_group.CN)}" == "true" ]
then
if [[ ! "~{read_group.CN}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.CN}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "CN must match pattern ~{
sam_spec_pattern}"
>&2 echo "CN must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand All @@ -313,11 +287,9 @@ task validate_read_group {
fi
if [ "~{defined(read_group.DS)}" == "true" ]
then
if [[ ! "~{read_group.DS}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.DS}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "DS must match pattern ~{
sam_spec_pattern}"
>&2 echo "DS must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand All @@ -331,11 +303,9 @@ task validate_read_group {
fi
if [ "~{defined(read_group.DT)}" == "true" ]
then
if [[ ! "~{read_group.DT}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.DT}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "DT must match pattern ~{
sam_spec_pattern}"
>&2 echo "DT must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand All @@ -357,20 +327,17 @@ task validate_read_group {
fi
if [ $(echo "~{sep(" ", required_fields)}" | grep -Ewc "KS") -eq 1 ]
then
if [ -z "~{if defined(read_group.KS) then read_group.KS
else ""}" ]
if [ -z "~{if defined(read_group.KS) then read_group.KS else ""}" ]
then
>&2 echo "KS is required"
error=1
fi
fi
if [ "~{defined(read_group.KS)}" == "true" ]
then
if [[ ! "~{read_group.KS}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.KS}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "KS must match pattern ~{
sam_spec_pattern}"
>&2 echo "KS must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand All @@ -384,11 +351,9 @@ task validate_read_group {
fi
if [ "~{defined(read_group.LB)}" == "true" ]
then
if [[ ! "~{read_group.LB}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.LB}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "LB must match pattern ~{
sam_spec_pattern}"
>&2 echo "LB must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand All @@ -402,11 +367,9 @@ task validate_read_group {
fi
if [ "~{defined(read_group.PG)}" == "true" ]
then
if [[ ! "~{read_group.PG}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.PG}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "PG must match pattern ~{
sam_spec_pattern}"
>&2 echo "PG must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand Down Expand Up @@ -436,11 +399,9 @@ task validate_read_group {
fi
if [ "~{defined(read_group.PL)}" == "true" ]
then
if [[ ! "~{read_group.PL}" =~ ^~{sep("|", platforms
)}$ ]]
if [[ ! "~{read_group.PL}" =~ ^~{sep("|", platforms)}$ ]]
then
>&2 echo "PL must match pattern ~{sep("|", platforms
)}"
>&2 echo "PL must match pattern ~{sep("|", platforms)}"
error=1
fi
fi
Expand All @@ -454,11 +415,9 @@ task validate_read_group {
fi
if [ "~{defined(read_group.PM)}" == "true" ]
then
if [[ ! "~{read_group.PM}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.PM}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "PM must match pattern ~{
sam_spec_pattern}"
>&2 echo "PM must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand All @@ -472,11 +431,9 @@ task validate_read_group {
fi
if [ "~{defined(read_group.PU)}" == "true" ]
then
if [[ ! "~{read_group.PU}" =~ ^~{
sam_spec_pattern}$ ]]
if [[ ! "~{read_group.PU}" =~ ^~{sam_spec_pattern}$ ]]
then
>&2 echo "PU must match pattern ~{
sam_spec_pattern}"
>&2 echo "PU must match pattern ~{sam_spec_pattern}"
error=1
fi
fi
Expand Down
39 changes: 13 additions & 26 deletions tools/arriba.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -202,38 +202,28 @@ task arriba {
}

Int bam_size_gb = ceil(size(bam, "GiB"))
Int disk_size_gb = bam_size_gb + ceil(size(gtf, "GiB"))
+ ceil(size(reference_fasta_gz, "GiB")) + modify_disk_size_gb
Int disk_size_gb = bam_size_gb + ceil(size(gtf, "GiB")) + ceil(size(reference_fasta_gz, "GiB")) + modify_disk_size_gb
Int memory_gb = bam_size_gb + modify_memory_gb

command <<<
arriba \
-x ~{bam} \
~{if defined(chimeric_sam) then "-c " + chimeric_sam
else ""} \
~{if defined(chimeric_sam) then "-c " + chimeric_sam else ""} \
-o ~{prefix}.tsv \
-O ~{prefix}.discarded.tsv \
-a ~{reference_fasta_gz} \
-g ~{gtf} \
-G "~{feature_name}" \
~{if defined(exclude_list) then "-b " + exclude_list
else ""} \
~{if defined(known_fusions) then "-k " + known_fusions
else ""} \
~{if defined(annotate_fusions) then "-t " + annotate_fusions
else ""} \
~{if defined(protein_domains) then "-p " + protein_domains
else ""} \
~{if defined(wgs_svs) then "-d " + wgs_svs else ""
} \
~{if defined(exclude_list) then "-b " + exclude_list else ""} \
~{if defined(known_fusions) then "-k " + known_fusions else ""} \
~{if defined(annotate_fusions) then "-t " + annotate_fusions else ""} \
~{if defined(protein_domains) then "-p " + protein_domains else ""} \
~{if defined(wgs_svs) then "-d " + wgs_svs else ""} \
-D ~{max_genomic_breakpoint_distance} \
-s ~{strandedness} \
~{(if length(interesting_contigs) > 0 then "-i "
+ sep(",", interesting_contigs) else "")} \
~{if length(viral_contigs) > 0 then "-v " + sep(
",", viral_contigs) else ""} \
~{(if length(disable_filters) > 0 then "-f " + sep(
",", disable_filters) else "")} \
~{(if length(interesting_contigs) > 0 then "-i " + sep(",", interesting_contigs) else "")} \
~{if length(viral_contigs) > 0 then "-v " + sep(",", viral_contigs) else ""} \
~{(if length(disable_filters) > 0 then "-f " + sep(",", disable_filters) else "")} \
-E ~{max_e_value} \
-S ~{min_supporting_reads} \
-m ~{max_mismappers} \
Expand All @@ -254,8 +244,7 @@ task arriba {
-z ~{min_itd_allele_fraction} \
-Z ~{min_itd_supporting_reads} \
~{if mark_duplicates then "" else "-u"} \
~{if report_additional_columns then "-X" else ""
} \
~{if report_additional_columns then "-X" else ""} \
~{if fill_gaps then "-I" else ""}
>>>

Expand Down Expand Up @@ -296,8 +285,7 @@ task arriba_tsv_to_vcf {
}

Int input_size_gb = ceil(size(fusions, "GiB"))
Int disk_size_gb = ceil(input_size_gb) + (ceil(size(
reference_fasta, "GiB")) * 3) + modify_disk_size_gb
Int disk_size_gb = ceil(input_size_gb) + (ceil(size(reference_fasta, "GiB")) * 3) + modify_disk_size_gb

command <<<
set -euo pipefail
Expand Down Expand Up @@ -362,8 +350,7 @@ task arriba_extract_fusion_supporting_alignments {

output {
Array[File] fusion_bams = glob("~{prefix}_*.bam")
Array[File] fusion_bam_indexes = glob("~{prefix}_*.bam.bai"
)
Array[File] fusion_bam_indexes = glob("~{prefix}_*.bam.bai")
}

runtime {
Expand Down
Loading

0 comments on commit 95fd444

Please sign in to comment.