Преглед на файлове

add samtools to build bam index

master
junshang преди 4 години
родител
ревизия
7e0ccd0eac
променени са 5 файла, в които са добавени 50 реда и са изтрити 11 реда
  1. +2
    -0
      defaults
  2. +2
    -2
      inputs
  3. +7
    -5
      tasks/batch.wdl
  4. +28
    -0
      tasks/samtools.wdl
  5. +11
    -4
      workflow.wdl

+ 2
- 0
defaults Целия файл

@@ -2,6 +2,8 @@
"fasta": "oss://pgx-reference-data/GRCh38.d1.vd1/GRCh38.d1.vd1.fa",
"faidx": "oss://pgx-reference-data/GRCh38.d1.vd1/GRCh38.d1.vd1.fa.fai",
"docker": "registry.cn-shanghai.aliyuncs.com/pgx-docker-registry/cnvkit:0.9.7",
"samtools_docker": "registry.cn-shanghai.aliyuncs.com/pgx-docker-registry/samtools:v1.3.1",
"samtools_cluster": "OnDemand bcs.a2.large img-ubuntu-vpc",
"disk_size": "400",
"cluster_config": "OnDemand bcs.a2.7xlarge img-ubuntu-vpc",
"bed": "oss://pgx-reference-data/bed/hg38/Exome-Agilent_V6_chr.bed",

+ 2
- 2
inputs Целия файл

@@ -1,15 +1,15 @@
{
"{{ project_name }}.sample_id": "{{ sample_id }}",
"{{ project_name }}.normal_bam": {{ normal_bam | tojson }},
"{{ project_name }}.normal_bai": {{ normal_bai | tojson }},
"{{ project_name }}.tumor_bam": {{ tumor_bam | tojson }},
"{{ project_name }}.tumor_bai": {{ tumor_bai | tojson }},
"{{ project_name }}.fasta": "{{ fasta }}",
"{{ project_name }}.faidx": "{{ faidx }}",
"{{ project_name }}.ref_flat": "{{ ref_flat }}",
"{{ project_name }}.method": "{{ method }}",
"{{ project_name }}.segment_method": "{{ segment_method }}",
"{{ project_name }}.reference": "{{ reference }}",
"{{ project_name }}.samtools_docker": "{{ samtools_docker }}",
"{{ project_name }}.samtools_cluster": "{{ samtools_cluster }}",
"{{ project_name }}.docker": "{{ docker }}",
"{{ project_name }}.bed": "{{ bed }}",
"{{ project_name }}.disk_size": "{{ disk_size }}",

+ 7
- 5
tasks/batch.wdl Целия файл

@@ -1,9 +1,8 @@
task batch {
String sample_id
Array[File] tumor_bam
Array[File] tumor_bai
Array[File] normal_bam
Array[File] normal_bai
Array[File] bam_index
File bed
File faidx
File fasta
@@ -23,21 +22,24 @@ task batch {
command <<<
set -o pipefail
set -e
nt=$(nproc)

mkdir -p /cromwell_root/tmp/cnvkit
cp ${sep=' ' normal_bai} /cromwell_root/tmp/cnvkit
cp ${sep=' ' tumor_bai} /cromwell_root/tmp/cnvkit
cp -r ${sep=" " bam_index} /cromwell_root/tmp/cnvkit
# must exist parameters
cp ${fasta} /cromwell_root/tmp/cnvkit/hg38.fa
cp ${faidx} /cromwell_root/tmp/cnvkit/hg38.fai
cp ${bed} /cromwell_root/tmp/cnvkit/target.bed
cp ${access_bed} /cromwell_root/tmp/cnvkit/access-mappable.bed

# optional parameters
if [ ${ref_flat} != "" ]; then cp ${ref_flat} /cromwell_root/tmp/cnvkit/ref_flat.txt; fi
if [ ${reference} != "" ]; then cp ${reference} /cromwell_root/tmp/cnvkit/my_reference.cnn; fi
cd /cromwell_root/tmp/cnvkit
mkdir results
cnvkit.py batch ${sep=' ' tumor_bam} --normal ${sep=' ' normal_bam} \
cnvkit.py batch -p $nt ${sep=' ' tumor_bam} --normal ${sep=' ' normal_bam} \
--method ${method} --segment-method ${segment_method} \
--targets target.bed ${access_opt} ${annotate_opt} \
--fasta hg38.fa ${reference_opt} \

+ 28
- 0
tasks/samtools.wdl Целия файл

@@ -0,0 +1,28 @@
task samtools {
Array[File] tumor_bam
Array[File] normal_bam
String docker
String cluster
String disk_size

command <<<
set -o pipefail
set -e
nt=$(nproc)
mkdir -p /cromwell_root/tmp/samtools
cd /cromwell_root/tmp/samtools
/opt/conda/bin/samtools -@ $nt index ${sep=' ' tumor_bam}
/opt/conda/bin/samtools -@ $nt index ${sep=' ' normal_bam}
>>>

runtime {
docker: docker
cluster: cluster
systemDisk: "cloud_ssd 40"
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
}

output {
Array[File] bam_index = glob("/cromwell_root/tmp/samtools/*bai")
}
}

+ 11
- 4
workflow.wdl Целия файл

@@ -1,13 +1,12 @@
import "./tasks/access.wdl" as access
import "./tasks/samtools.wdl" as samtools
import "./tasks/batch.wdl" as batch
import "./tasks/export.wdl" as export

workflow {{ project_name }} {
String sample_id
Array[File] tumor_bam
Array[File] tumor_bai
Array[File] normal_bam
Array[File] normal_bai
File bed
File faidx
File fasta
@@ -32,6 +31,15 @@ workflow {{ project_name }} {
disk_size = disk_size
}

call samtools.samtools as samtools {
input:
tumor_bam = tumor_bam,
normal_bam = normal_bam,
docker=samtools_docker,
cluster=samtools_cluster,
disk_size=disk_size
}

call batch.batch as batch {
input:
sample_id = sample_id,
@@ -42,9 +50,8 @@ workflow {{ project_name }} {
segment_method = segment_method,
reference = reference,
tumor_bam = tumor_bam,
tumor_bai = tumor_bai,
normal_bam = normal_bam,
normal_bai = normal_bai,
bam_index = samtools.bam_index,
bed = bed,
access_bed = access.access_bed,
docker = docker,

Loading…
Отказ
Запис