task Sentieon_BQSR{ | |||||
File ref_dir | |||||
File dbsnp_dir | |||||
File dbmills_dir | |||||
String sample_id | |||||
String ref_fasta | |||||
String dbsnp | |||||
String db_mills | |||||
File deduped_bam | |||||
File deduped_bam_index | |||||
# excute env | |||||
String docker | |||||
String cluster_config | |||||
String disk_size | |||||
String SENTIEON_LICENSE | |||||
command<<< | |||||
set -o pipefail | |||||
set -exo | |||||
export SENTIEON_LICENSE=${SENTIEON_LICENSE} | |||||
nt=$(nproc) | |||||
sentieon driver -t $nt \ | |||||
-r ${ref_dir}/${ref_fasta} -i ${deduped_bam} \ | |||||
--algo QualCal \ | |||||
-k ${dbsnp_dir}/${dbsnp} -k ${dbmills_dir}/${db_mills} \ | |||||
${sample_id}_recal_data.table | |||||
sentieon driver -t $nt \ | |||||
-r ${ref_dir}/${ref_fasta} -i ${deduped_bam} \ | |||||
-q ${sample_id}_recal_data.table \ | |||||
--algo QualCal \ | |||||
-k ${dbsnp_dir}/${dbsnp} -k ${dbmills_dir}/${db_mills} \ | |||||
${sample_id}_recal_data.table.post \ | |||||
--algo ReadWriter ${sample_id}.sorted.deduped.recaled.bam | |||||
sentieon driver -t $nt --algo QualCal \ | |||||
--plot --before ${sample_id}_recal_data.table --after ${sample_id}_recal_data.table.post ${sample_id}_recal_data.csv | |||||
sentieon plot bqsr -o ${sample_id}_bqsrreport.pdf ${sample_id}_recal_data.csv | |||||
>>> | |||||
runtime{ | |||||
docker:docker | |||||
cluster:cluster_config | |||||
systemDisk:"cloud_ssd 250" | |||||
dataDisk:"cloud_ssd " + disk_size + " /cromwell_root/" | |||||
} | |||||
output{ | |||||
File recal_table = "${sample_id}_recal_data.table" | |||||
File recal_post = "${sample_id}_recal_data.table.post" | |||||
File recaled_bam = "${sample_id}.sorted.deduped.recaled.bam" | |||||
File recaled_bam_index = "${sample_id}.sorted.deduped.recaled.bam.bai" | |||||
File recal_csv = "${sample_id}_recal_data.csv" | |||||
File bqsrreport_pdf = "${sample_id}_bqsrreport.pdf" | |||||
} | |||||
} |
task ANNOVAR { | |||||
File vcf | |||||
String basename = basename(vcf,".vcf") | |||||
File annovar_database | |||||
String docker | |||||
String cluster_config | |||||
String disk_size | |||||
command <<< | |||||
set -o pipefail | |||||
set -e | |||||
nt=$(nproc) | |||||
/installations/annovar/table_annovar.pl ${vcf} \ | |||||
${annovar_database} -buildver hg38 \ | |||||
-out ${basename} -remove \ | |||||
-protocol refGene,cytoBand,genomicSuperDups,clinvar_20220320,intervar_20180118,cosmic95_coding,cosmic95_noncoding,gnomad211_exome,dbnsfp42c,avsnp150 \ | |||||
-operation g,r,r,f,f,f,f,f,f,f \ | |||||
-nastring . -vcfinput -polish -thread $nt | |||||
>>> | |||||
runtime { | |||||
docker: docker | |||||
cluster: cluster_config | |||||
systemDisk: "cloud_ssd 40" | |||||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||||
} | |||||
output { | |||||
File avinput = "${basename}.avinput" | |||||
File multianno_txt = "${basename}.hg38_multianno.txt" | |||||
File multianno_vcf = "${basename}.hg38_multianno.vcf" | |||||
} | |||||
} |
task bcftools { | |||||
File ref_dir | |||||
String fasta | |||||
File vcf | |||||
String basename = basename(vcf,".vcf") | |||||
String docker | |||||
String cluster_config | |||||
String disk_size | |||||
command <<< | |||||
set -o pipefail | |||||
set -e | |||||
nt=$(nproc) | |||||
# bcftools norm -m -both ${vcf} | bcftools norm -f ${ref_dir}/${fasta} -Ov -o ${basename}.norm.vcf | |||||
# Split multiallelic sites | |||||
bcftools norm -m -both ${vcf} -o ${basename}.norm.vcf | |||||
>>> | |||||
runtime { | |||||
docker: docker | |||||
cluster: cluster_config | |||||
systemDisk: "cloud_ssd 40" | |||||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||||
} | |||||
output { | |||||
File norm_vcf = "${basename}.norm.vcf" | |||||
} | |||||
} |
task bcftools { | |||||
File ref_dir | |||||
String fasta | |||||
File vcf_indels | |||||
File vcf_snvs | |||||
String sample_id | |||||
String docker | |||||
String cluster_config | |||||
String disk_size | |||||
command <<< | |||||
set -o pipefail | |||||
set -e | |||||
nt=$(nproc) | |||||
bcftools concat -a ${vcf_indels} ${vcf_snvs} -Oz -o ${sample_id}_stralka.vcf.gz | |||||
bcftools index -t ${sample_id}_stralka.vcf.gz | |||||
>>> | |||||
runtime { | |||||
docker: docker | |||||
cluster: cluster_config | |||||
systemDisk: "cloud_ssd 40" | |||||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||||
} | |||||
output { | |||||
File concat_vcf = "${sample_id}_stralka.vcf.gz" | |||||
File concat_vcf_index = "${sample_id}_stralka.vcf.gz.tbi" | |||||
} | |||||
} |