Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial IGV_HaplotypeViz WDL workflow for generating IGV screenshots #468

Draft
wants to merge 43 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
43774f0
Add initial IGV_HaplotypeViz WDL workflow for generating IGV screenshots
shadizaheri Sep 5, 2024
7cb3c7e
Add new workflow for parallel processing of large BED files
shadizaheri Sep 5, 2024
27f85d6
fix the workflow name
shadizaheri Sep 5, 2024
6249a7c
update the docker
shadizaheri Sep 6, 2024
c2ac959
updating docker and fixing the igv command
shadizaheri Sep 6, 2024
dd2dfc9
fixing the docker and igv command
shadizaheri Sep 6, 2024
c0fa633
fixing the runtime
shadizaheri Sep 6, 2024
fafa429
fixing the runtime
shadizaheri Sep 6, 2024
9f0d53b
new wdl for taking the igv screenshots
shadizaheri Sep 8, 2024
9682125
update docker and the script to use only one bam
shadizaheri Sep 9, 2024
f574936
Updated Python script and WDL for IGV snapshot automation
shadizaheri Sep 9, 2024
1c11914
Update WDL and Python script to support IGV 2.18.2 with igv.sh
shadizaheri Sep 9, 2024
d10a140
update the directory to the python script
shadizaheri Sep 9, 2024
09154ed
update bai
shadizaheri Sep 9, 2024
4aedff1
checking for bai
shadizaheri Sep 9, 2024
bd53b9c
new wdl-the script has been tested on the vm
shadizaheri Sep 10, 2024
d533e40
technically the same script as IGV_HaplotypeViz but will locate the i…
shadizaheri Sep 10, 2024
76009fe
modify the runtime attributes
shadizaheri Sep 10, 2024
11f78ee
fixing the issue with bai
shadizaheri Sep 10, 2024
0b70896
fix the issue with output directory
shadizaheri Sep 10, 2024
7ac3c54
fix bai
shadizaheri Sep 10, 2024
3f7005d
updates for bai
shadizaheri Sep 10, 2024
c36a899
reverting baclk
shadizaheri Sep 10, 2024
6b9baf7
playing with bai definition
shadizaheri Sep 10, 2024
889c1fd
fai
shadizaheri Sep 10, 2024
b2c0836
fai
shadizaheri Sep 10, 2024
814c24e
updated the cmmand section
shadizaheri Sep 10, 2024
1fa0947
modify fai
shadizaheri Sep 10, 2024
965bf77
fix
shadizaheri Sep 10, 2024
4712c35
gs input
shadizaheri Sep 10, 2024
ce84cab
fix output
shadizaheri Sep 11, 2024
37fb974
fixing the output-the screenshots were created
shadizaheri Sep 11, 2024
f8a18c1
fixing the output-the screenshots were created
shadizaheri Sep 11, 2024
cd7c769
fixing the output-the screenshots were created
shadizaheri Sep 11, 2024
2b23838
fixing ...
shadizaheri Sep 11, 2024
5d8fb8d
output directory
shadizaheri Sep 11, 2024
793fddf
again
shadizaheri Sep 11, 2024
d98e0fa
dixing the output
shadizaheri Sep 11, 2024
f200192
removed mkdir
shadizaheri Sep 11, 2024
7e69291
updated the docker and output directory in the docker /cromwell_root/…
shadizaheri Sep 11, 2024
bfd534b
mv -- *.png output/IGV_Snapshots/
shadizaheri Sep 11, 2024
d60a716
SSD
shadizaheri Sep 11, 2024
28a6185
output fix
shadizaheri Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions wdl/pipelines/PacBio/Utility/IGV_HaplotypeViz.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
version 1.0

workflow IGVScreenshotWorkflow {

input {
File aligned_bam_hap1
File aligned_bam_hap1_bai
File aligned_bam_hap2
File aligned_bam_hap2_bai
File alignments
File alignments_bai
File bed_file
File fasta_file
File fasta_file_fai
String sample_name
Int image_height = 500
Int memory_mb = 4000
Int disk_gb = 100 # Disk size in GB, default to 100 GB
String docker_image = "us.gcr.io/broad-dsp-lrma/igv_screenshot_docker:v982024" # The Docker image to use
}

call RunIGVScreenshot {
input:
aligned_bam_hap1 = aligned_bam_hap1,
aligned_bam_hap1_bai = aligned_bam_hap1_bai,
aligned_bam_hap2 = aligned_bam_hap2,
aligned_bam_hap2_bai = aligned_bam_hap2_bai,
alignments = alignments,
alignments_bai = alignments_bai,
bed_file = bed_file,
fasta_file = fasta_file,
fasta_file_fai = fasta_file_fai,
sample_name = sample_name,
image_height = image_height,
memory_mb = memory_mb,
disk_gb = disk_gb,
docker_image = docker_image
}

output {
Array[File] snapshots = RunIGVScreenshot.snapshots
}
}

task RunIGVScreenshot {

input {
File aligned_bam_hap1
File aligned_bam_hap1_bai
File aligned_bam_hap2
File aligned_bam_hap2_bai
File alignments
File alignments_bai
File bed_file
File fasta_file
File fasta_file_fai
String sample_name
Int image_height
Int memory_mb
Int disk_gb
String docker_image
}

command <<<
set -euo pipefail

# Ensure the snapshots directory exists
mkdir -p 'output/IGV_Snapshots'

# Start a virtual frame buffer to allow IGV to render
Xvfb :1 -screen 0 1024x768x16 &> xvfb.log &
export DISPLAY=:1

# Run the IGV screenshot script with the provided inputs
python3 /opt/IGV_Linux_2.18.2/make_igv_screenshot.py \
~{aligned_bam_hap1} ~{aligned_bam_hap2} ~{alignments} \
-r ~{bed_file} \
-ht ~{image_height} \
-bin /opt/IGV_Linux_2.18.2/igv.sh \
-mem ~{memory_mb} \
--fasta_file ~{fasta_file} \
--sample_name ~{sample_name}

# Move the screenshots to the IGV_Snapshots directory
#mv -- *.png 'output/IGV_Snapshots/'
>>>

runtime {
docker: docker_image
memory: "~{memory_mb} MB"
cpu: 2
disks: "local-disk ~{disk_gb} SSD"
}

output {
Array[File] snapshots = glob("output/IGV_Snapshots/*.png")
}
}
99 changes: 99 additions & 0 deletions wdl/pipelines/PacBio/Utility/IGV_HaplotypeViz_bai_try.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
version 1.0

workflow IGVScreenshotWorkflow {

input {
File aligned_bam_hap1
File aligned_bam_hap1_bai
File aligned_bam_hap2
File aligned_bam_hap2_bai
File alignments
File alignments_bai
File bed_file
File fasta_file
File fasta_file_fai # Include the .fai file
String sample_name
Int image_height = 500
Int memory_mb = 4000
Int disk_gb = 100 # Disk size in GB, default to 100 GB
String docker_image = "us.gcr.io/broad-dsp-lrma/igv_screenshot_docker:v982024" # The Docker image to use
}

call RunIGVScreenshot {
input:
aligned_bam_hap1 = aligned_bam_hap1,
aligned_bam_hap1_bai = aligned_bam_hap1_bai,
aligned_bam_hap2 = aligned_bam_hap2,
aligned_bam_hap2_bai = aligned_bam_hap2_bai,
alignments = alignments,
alignments_bai = alignments_bai,
bed_file = bed_file,
fasta_file = fasta_file,
fasta_file_fai = fasta_file_fai,
sample_name = sample_name,
image_height = image_height,
memory_mb = memory_mb,
disk_gb = disk_gb,
docker_image = docker_image
}

output {
Array[File] snapshots = RunIGVScreenshot.snapshots
}
}

task RunIGVScreenshot {

input {
File aligned_bam_hap1
File aligned_bam_hap1_bai
File aligned_bam_hap2
File aligned_bam_hap2_bai
File alignments
File alignments_bai
File bed_file
File fasta_file
File fasta_file_fai
String sample_name
Int image_height
Int memory_mb
Int disk_gb
String docker_image
}

command <<<
set -euo pipefail

# Ensure the snapshots directory exists under the mounted disk path
mkdir -p 'output/IGV_Snapshots/'
#mkdir snap_out

# Start a virtual frame buffer to allow IGV to render
Xvfb :1 -screen 0 1024x768x16 &> xvfb.log &
export DISPLAY=:1

# Run the IGV screenshot script with the provided inputs, no --snapshot-dir
python3 /opt/IGV_Linux_2.18.2/make_igv_screenshot.py \
~{aligned_bam_hap1} ~{aligned_bam_hap2} ~{alignments} \
-r ~{bed_file} \
-ht ~{image_height} \
-bin /opt/IGV_Linux_2.18.2/igv.sh \
-mem ~{memory_mb} \
--fasta_file ~{fasta_file} \
--sample_name ~{sample_name}

# Move the screenshots to the output directory
# mv -- *.png 'output/IGV_Snapshots/'
>>>

runtime {
docker: docker_image
memory: "~{memory_mb} MB"
cpu: 2
disks: "local-disk ~{disk_gb} SSD"
}

output {
Array[File] snapshots = glob("output/IGV_Snapshots/*.png")
}
}
Loading