Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…l_genomics into main
  • Loading branch information
kevinlibuit committed May 21, 2021
2 parents d229836 + 57c6912 commit 527e62a
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 15 deletions.
23 changes: 14 additions & 9 deletions tasks/task_read_clean.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ task ncbi_scrub_pe {
File read1
File read2
String samplename
String docker = "ncbi/sra-human-scrubber:1.0.2021-04-19"
String docker = "ncbi/sra-human-scrubber:1.0.2021-05-05"

}
String r1_filename = basename(read1)
Expand All @@ -25,7 +25,7 @@ task ncbi_scrub_pe {
fi

# dehost reads
/opt/scrubber/scripts/scrub.sh ${read1_unzip}
/opt/scrubber/scripts/scrub.sh -n ${read1_unzip} |& tail -n1 | awk -F" " '{print $1}' > FWD_SPOTS_REMOVED

# gzip dehosted reads
gzip ${read1_unzip}.clean -c > ~{samplename}_R1_dehosted.fastq.gz
Expand All @@ -41,24 +41,27 @@ task ncbi_scrub_pe {
fi

# dehost reads
/opt/scrubber/scripts/scrub.sh ${read2_unzip}
/opt/scrubber/scripts/scrub.sh -n ${read2_unzip} |& tail -n1 | awk -F" " '{print $1}' > REV_SPOTS_REMOVED

# gzip dehosted reads
gzip ${read2_unzip}.clean -c > ~{samplename}_R2_dehosted.fastq.gz
gzip ${read2_unzip}.clean -c > ~{samplename}_R2_dehosted.fastq.gz


>>>

output {
File read1_dehosted = "~{samplename}_R1_dehosted.fastq.gz"
File read2_dehosted = "~{samplename}_R2_dehosted.fastq.gz"
Int read1_human_spots_removed = read_int("FWD_SPOTS_REMOVED")
Int read2_human_spots_removed = read_int("REV_SPOTS_REMOVED")
String ncbi_scrub_docker = docker

}

runtime {
docker: "~{docker}"
memory: "8 GB"
cpu: 2
cpu: 4
disks: "local-disk 100 SSD"
preemptible: 0
}
Expand All @@ -68,7 +71,7 @@ task ncbi_scrub_se {
input {
File read1
String samplename
String docker = "ncbi/sra-human-scrubber:1.0.2021-04-19"
String docker = "ncbi/sra-human-scrubber:1.0.2021-05-05"

}
String r1_filename = basename(read1)
Expand All @@ -87,7 +90,7 @@ task ncbi_scrub_se {
fi

# dehost reads
/opt/scrubber/scripts/scrub.sh ${read1_unzip}
/opt/scrubber/scripts/scrub.sh -n ${read1_unzip} |& tail -n1 | awk -F" " '{print $1}' > FWD_SPOTS_REMOVED

# gzip dehosted reads
gzip ${read1_unzip}.clean -c > ~{samplename}_R1_dehosted.fastq.gz
Expand All @@ -96,13 +99,15 @@ task ncbi_scrub_se {

output {
File read1_dehosted = "~{samplename}_R1_dehosted.fastq.gz"
Int read1_human_spots_removed = read_int("FWD_SPOTS_REMOVED")
String ncbi_scrub_docker = docker

}

runtime {
docker: "~{docker}"
memory: "8 GB"
cpu: 2
cpu: 4
disks: "local-disk 100 SSD"
preemptible: 0
}
Expand Down Expand Up @@ -168,7 +173,7 @@ task trimmomatic {
File read2
String samplename
String docker="staphb/trimmomatic:0.39"
Int? trimmomatic_minlen = 15
Int? trimmomatic_minlen = 75
Int? trimmomatic_window_size=4
Int? trimmomatic_quality_trim_score=30
Int? threads = 4
Expand Down
2 changes: 2 additions & 0 deletions workflows/wf_ncbi_scrub_pe.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ workflow dehost_pe {
output {
File read1_dehosted = ncbi_scrub_pe.read1_dehosted
File read2_dehosted = ncbi_scrub_pe.read2_dehosted
Int read1_human_sports_removed = ncbi_scrub_pe.read1_human_spots_removed
Int read2_human_sports_removed = ncbi_scrub_pe.read2_human_spots_removed
String ncbi_scrub_docker = ncbi_scrub_pe.ncbi_scrub_docker

Float kraken_human_dehosted = kraken2.percent_human
Expand Down
1 change: 1 addition & 0 deletions workflows/wf_ncbi_scrub_se.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ workflow dehost_se {
output {
File reads_dehosted = ncbi_scrub_se.read1_dehosted
String ncbi_scrub_docker = ncbi_scrub_se.ncbi_scrub_docker
Int human_sports_removed = ncbi_scrub_se.read1_human_spots_removed

Float kraken_human_dehosted = kraken2.percent_human
Float kraken_sc2_dehosted = kraken2.percent_sc2
Expand Down
24 changes: 22 additions & 2 deletions workflows/wf_read_QC_trim.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ workflow read_QC_trim {
Int? trimmomatic_quality_trim_score = 30
Int? trimmomatic_window_size = 4
}
call read_clean.trimmomatic {
call read_clean.ncbi_scrub_pe {
input:
samplename = samplename,
read1 = read1_raw,
read2 = read2_raw,
read2 = read2_raw
}
call read_clean.trimmomatic {
input:
samplename = samplename,
read1 = ncbi_scrub_pe.read1_dehosted,
read2 = ncbi_scrub_pe.read2_dehosted,
trimmomatic_minlen = trimmomatic_minlen,
trimmomatic_quality_trim_score = trimmomatic_quality_trim_score,
trimmomatic_window_size = trimmomatic_window_size
Expand All @@ -48,7 +54,18 @@ workflow read_QC_trim {
read1 = read1_raw,
read2 = read2_raw
}
call taxonID.kraken2 as kraken2_dehosted {
input:
samplename = samplename,
read1 = ncbi_scrub_pe.read1_dehosted,
read2 = ncbi_scrub_pe.read2_dehosted
}
output {
File read1_dehosted = ncbi_scrub_pe.read1_dehosted
File read2_dehosted = ncbi_scrub_pe.read2_dehosted
Int read1_human_spots_removed = ncbi_scrub_pe.read1_human_spots_removed
Int read2_human_spots_removed = ncbi_scrub_pe.read2_human_spots_removed

File read1_clean = bbduk.read1_clean
File read2_clean = bbduk.read2_clean

Expand All @@ -64,6 +81,9 @@ workflow read_QC_trim {
Float kraken_human = kraken2_raw.percent_human
Float kraken_sc2 = kraken2_raw.percent_sc2
String kraken_report = kraken2_raw.kraken_report
Float kraken_human_dehosted = kraken2_dehosted.percent_human
Float kraken_sc2_dehosted = kraken2_dehosted.percent_sc2
String kraken_report_dehosted = kraken2_dehosted.kraken_report

String fastqc_version = fastqc_raw.version
String bbduk_docker = bbduk.bbduk_docker
Expand Down
24 changes: 22 additions & 2 deletions workflows/wf_titan_clearlabs.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,24 @@ workflow titan_clearlabs {
input:
read1 = clear_lab_fastq
}
call read_clean.ncbi_scrub_se {
input:
samplename = samplename,
read1 = clear_lab_fastq
}
call qc_utils.fastqc_se as fastqc_se_clean {
input:
read1 = ncbi_scrub_se.read1_dehosted
}
call taxon_ID.kraken2 as kraken2_dehosted {
input:
samplename = samplename,
read1 = ncbi_scrub_se.read1_dehosted
}
call medaka.consensus {
input:
samplename = samplename,
filtered_reads = clear_lab_fastq,
filtered_reads = ncbi_scrub_se.read1_dehosted,
artic_primer_version = artic_primer_version,
normalise = normalise
}
Expand Down Expand Up @@ -69,12 +83,18 @@ workflow titan_clearlabs {
output {
String seq_platform = seq_method

Int fastqc_raw = fastqc_se_raw.number_reads
File dehosted_reads = ncbi_scrub_se.read1_dehosted

Int fastqc_raw = fastqc_se_raw.number_reads
Int fastqc_clean = fastqc_se_clean.number_reads

String kraken_version = kraken2_raw.version
Float kraken_human = kraken2_raw.percent_human
Float kraken_sc2 = kraken2_raw.percent_sc2
String kraken_report = kraken2_raw.kraken_report
Float kraken_human_dehosted = kraken2_dehosted.percent_human
Float kraken_sc2_dehosted = kraken2_dehosted.percent_sc2
String kraken_report_dehosted = kraken2_dehosted.kraken_report

File aligned_bam = consensus.trim_sorted_bam
File aligned_bai = consensus.trim_sorted_bai
Expand Down
7 changes: 6 additions & 1 deletion workflows/wf_titan_illumina_pe.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ workflow titan_illumina_pe {
output {

String seq_platform = seq_method


File read1_dehosted = read_QC_trim.read1_dehosted
File read2_dehosted = read_QC_trim.read2_dehosted
File read1_clean = read_QC_trim.read1_clean
File read2_clean = read_QC_trim.read2_clean
Int fastqc_raw1 = read_QC_trim.fastqc_raw1
Expand All @@ -102,6 +104,9 @@ workflow titan_illumina_pe {
Float kraken_human = read_QC_trim.kraken_human
Float kraken_sc2 = read_QC_trim.kraken_sc2
String kraken_report = read_QC_trim.kraken_report
Float kraken_human_dehosted = read_QC_trim.kraken_human_dehosted
Float kraken_sc2_dehosted = read_QC_trim.kraken_sc2_dehosted
String kraken_report_dehosted = read_QC_trim.kraken_report_dehosted

String bwa_version = bwa.bwa_version
String sam_version = bwa.sam_version
Expand Down
18 changes: 17 additions & 1 deletion workflows/wf_titan_ont.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,25 @@ workflow titan_ont {
input:
read1 = demultiplexed_reads
}
call read_clean.ncbi_scrub_se {
input:
samplename = samplename,
read1 = demultiplexed_reads
}
call medaka.read_filtering {
input:
demultiplexed_reads = demultiplexed_reads,
demultiplexed_reads = ncbi_scrub_se.read1_dehosted,
samplename = samplename
}
call qc_utils.fastqc_se as fastqc_se_clean {
input:
read1 = read_filtering.filtered_reads
}
call taxon_ID.kraken2 as kraken2_dehosted {
input:
samplename = samplename,
read1 = ncbi_scrub_se.read1_dehosted
}
call medaka.consensus {
input:
samplename = samplename,
Expand Down Expand Up @@ -79,13 +89,19 @@ workflow titan_ont {
output {

String seq_platform = seq_method

File reads_dehosted = ncbi_scrub_se.read1_dehosted

Int fastqc_raw = fastqc_se_raw.number_reads
Int fastqc_clean = fastqc_se_clean.number_reads

String kraken_version = kraken2_raw.version
Float kraken_human = kraken2_raw.percent_human
Float kraken_sc2 = kraken2_raw.percent_sc2
String kraken_report = kraken2_raw.kraken_report
Float kraken_human_dehosted = kraken2_dehosted.percent_human
Float kraken_sc2_dehosted = kraken2_dehosted.percent_sc2
String kraken_report_dehosted = kraken2_dehosted.kraken_report

File aligned_bam = consensus.trim_sorted_bam
File aligned_bai = consensus.trim_sorted_bai
Expand Down

0 comments on commit 527e62a

Please sign in to comment.