Skip to content

Commit

Permalink
added the visualization task
Browse files Browse the repository at this point in the history
  • Loading branch information
yueyaog committed Jun 17, 2024
1 parent c82669a commit 46c7934
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion CoverageProfiler/CoverageProfiler.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ workflow coverageProfile {
File referenceDict
File referenceFai
File intervals
File interval_GCcontent_track
Int MinBaseQuality = 20
Int MinMappingQuality = 20
}
Expand All @@ -27,6 +28,12 @@ workflow coverageProfile {
minBaseQuality = MinBaseQuality,
minMappingQuality = MinMappingQuality
}
call CovProfileViz {
input:
sampleName = sampleName,
SamtoolsDepthProfile = SamtoolsDepth.depth_profile,
GCcontentTrack = interval_GCcontent_track
}
}
if (coverageTool == "DepthOfCoverage") {
call DepthOfCoverage {
Expand Down Expand Up @@ -161,4 +168,40 @@ workflow coverageProfile {
docker: samtools_docker
disks: "local-disk 500 SSD"
}
}
}
task CovProfileViz {
input {
File SamtoolsDepthProfile
File GCcontentTrack
String sampleName
String CovProfileViz_docker = "us-central1-docker.pkg.dev/tag-team-160914/gptag-dockers/covprofileviz:0.0.0"
String? mem_gb
Int? cpu
}
command <<<
set -e
mkdir output
# Run the coverage profile visualization script
conda run --no-capture-output \
-n env_viz \
python3 /BaseImage/CovProfileViz/scripts/plot_samtoolsDepths_by_chr.py \
-s ~{sampleName} \
-d ~{SamtoolsDepthProfile} \
-g ~{GCcontentTrack} \
-o output

mv output/*_samtools_cov_with_gc.png output/sample_coverage_profile.png
mv output/*_avg_cov_std.txt output/per_chr_cov_std.txt
mv output/*_avg_cov_per_chr.csv output/per_chr_avg_cov.csv
>>>
output {
File cov_profile_plot = "output/sample_coverage_profile.png"
Float avg_chr_cov_std = read_float("output/per_chr_cov_std.txt")
File avg_chr_cov_per_chr = "output/per_chr_avg_cov.csv"
}
runtime {
memory: select_first([mem_gb, 7]) * 1000 + " MB"
cpu: select_first([cpu, 1])
docker: CovProfileViz_docker
}
}

0 comments on commit 46c7934

Please sign in to comment.