Procházet zdrojové kódy

上传文件至 'tasks'

master
meng před 2 roky
rodič
revize
4226f5733c
5 změnil soubory, kde provedl 253 přidání a 0 odebrání
  1. +49
    -0
      tasks/Haplotyper.wdl
  2. +42
    -0
      tasks/MSIsensor.wdl
  3. +84
    -0
      tasks/fastqTobam.wdl
  4. +47
    -0
      tasks/manta.wdl
  5. +31
    -0
      tasks/qualimap.wdl

+ 49
- 0
tasks/Haplotyper.wdl Zobrazit soubor

@@ -0,0 +1,49 @@
task Haplotyper {
File ref_dir
String fasta
File dbsnp_dir
String SENTIEON_LICENSE
File recaled_bam
File recaled_bam_index
String dbsnp
String sample
String docker
String cluster_config
String disk_size
File? regions
Int? interval_padding
command <<<
set -o pipefail
set -e
export SENTIEON_LICENSE=${SENTIEON_LICENSE}
nt=$(nproc)
if [ ${regions} ]; then
INTERVAL="--interval ${regions} --interval_padding ${interval_padding}"
else
INTERVAL=""
fi

sentieon driver -t $nt \
$INTERVAL -r ${ref_dir}/${fasta} \
-i ${recaled_bam} \
--algo Haplotyper -d ${dbsnp_dir}/${dbsnp} \
${sample}.Haplotyper.vcf
>>>
runtime {
docker: docker
cluster: cluster_config
systemDisk: "cloud_ssd 40"
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
}
output {
File vcf = "${sample}.Haplotyper.vcf"
File vcf_idx = "${sample}.Haplotyper.vcf.idx"
}
}

+ 42
- 0
tasks/MSIsensor.wdl Zobrazit soubor

@@ -0,0 +1,42 @@

task MSIsensor {
String sample
File ref_dir
String fasta
File tumor_bam
File tumor_bam_index
File? normal_bam
File? normal_bam_index
File baseline
String docker
String cluster_config
String disk_size

command <<<
set -o pipefail
set -e
nt=$(nproc)
# MSI
mkdir -p /cromwell_root/tmp/
msisensor-pro scan -d ${ref_dir}/${fasta} -o reference.list
if [ ${normal_bam} ]; then
msisensor-pro msi -d reference.list -n ${normal_bam} -t ${tumor_bam} -o /cromwell_root/tmp/${sample}
else
msisensor-pro pro -d ${baseline} -t ${tumor_bam} -o /cromwell_root/tmp/${sample}
fi
cp /cromwell_root/tmp/${sample} ${sample}.MSI.txt
>>>
runtime {
docker: docker
cluster: cluster_config
systemDisk: "cloud_ssd 40"
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
}
output {
File msi = "${sample}.MSI.txt"
}
}

+ 84
- 0
tasks/fastqTobam.wdl Zobrazit soubor

@@ -0,0 +1,84 @@
task SentieonFastqToBam {
# 工具输入文件和参数
File fastq1
File fastq2
String sample_id
String Seq_platform
String ref_fasta
File ref_fasta_dir
String SENTIEON_LICENSE

String docker
String cluster_config
String disk_size

## Extra driver parameters
String qc_driver_args = ""
String lc_driver_args = "--traverse_param=200000/10000"
String dedup_driver_args = "--traverse_param=200000/10000"
## Extra algo parameters
String bwa_args = "-Y -M"
String bwa_chunk_size = "100000000"
String lc_args = ""
String bam_option = "--bam_compression 1"



String out_bam = sample_id + ".dedup.bam"
String out_bai = sample_id + ".dedup.bam.bai"

# 工具运行命令
command <<<
set -exo pipefail
export SENTIEON_LICENSE=${SENTIEON_LICENSE}
nt=$(nproc)
sentieon bwa mem -R "@RG\tID:${sample_id}\tSM:${sample_id}\tPL:${Seq_platform}" ${bwa_args} -K ${bwa_chunk_size} -t $nt ${ref_fasta_dir}/${ref_fasta} ${fastq1} ${fastq2} \
| sentieon util sort ${bam_option} -i - -r ${ref_fasta_dir}/${ref_fasta} -t $nt -o ${sample_id}.sorted.bam --sam2bam

ls ./
sentieon driver -r ${ref_fasta_dir}/${ref_fasta} -t $nt -i ${sample_id}.sorted.bam ${qc_driver_args} \
--algo MeanQualityByCycle ${sample_id}.mq_metrics.txt \
--algo QualDistribution ${sample_id}.qd_metrics.txt \
--algo GCBias --summary ${sample_id}.gc_summary_metrics.txt ${sample_id}.gc_metrics.txt \
--algo AlignmentStat ${sample_id}.aln_metrics.txt \
--algo InsertSizeMetricAlgo ${sample_id}.is_metrics.txt
ls ./

sentieon driver -r ${ref_fasta_dir}/${ref_fasta} -t $nt -i ${sample_id}.sorted.bam ${lc_driver_args} \
--algo LocusCollector \
${lc_args} \
${sample_id}.score.txt.gz
ls ./

sentieon driver -r ${ref_fasta_dir}/${ref_fasta} -t $nt -i ${sample_id}.sorted.bam ${dedup_driver_args} \
--algo Dedup \
--score_info ${sample_id}.score.txt.gz \
--metrics ${sample_id}.dedup_metrics.txt \
${bam_option} ${out_bam}
ls ./

>>>


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

}

# 工具运行输出结果
output {
File deduped_bam = out_bam
File deduped_bam_bai = out_bai
Array[File] qc_metrics = glob("*_metrics.txt")
}

}

+ 47
- 0
tasks/manta.wdl Zobrazit soubor

@@ -0,0 +1,47 @@
task manta_calling{
File tumor_bam
File tumor_bam_bai
File normal_bam
File normal_bam_bai
String ref_fasta
File ref_dir
String sample_id
String docker
String cluster_config
String disk_size

String out_dir = "${sample_id}_result"
command <<<
set -exo pipefail
nt=$(nproc)
/home/biosoft/manta-1.6.0.centos6_x86_64/bin/configManta.py \
--normalBam ${normal_bam} \
--tumorBam ${tumor_bam} \
--referenceFasta ${ref_dir}/${ref_fasta} \
--runDir ${out_dir}
ls ${out_dir}

python2.7 ${out_dir}/runWorkflow.py -m local -j $nt

ls ${out_dir}

tar cvf ${out_dir}.tar ${out_dir}
>>>

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

}

output{
File out_file = "${out_dir}.tar"
File manta_indel_vcf = "${out_dir}/results/variants/candidateSmallIndels.vcf.gz"
File manta_indel_vcf_index = "${out_dir}/results/variants/candidateSmallIndels.vcf.gz.tbi"
}
}

+ 31
- 0
tasks/qualimap.wdl Zobrazit soubor

@@ -0,0 +1,31 @@
task qualimap{
String sample_id
File bam_file
File bam_bai
File annot_gff

String docker
String cluster_config
String disk_size

String out_dir = sample_id+'_BamQC'

command <<<
set -o pipefail
set -exo
nt=$(nproc)
/opt/qualimap/qualimap bamqc -bam ${bam_file} -gff ${annot_gff} -outformat PDF:HTML -nt $nt -outdir ${out_dir} --java-mem-size=32G
tar -zcvf ${out_dir}.tar ${out_dir}
>>>

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

output{
File out_file = "${out_dir}.tar"
}
}

Načítá se…
Zrušit
Uložit