task variantsNorm { File vcf File ref_dir String fasta String sampleName String docker String cluster_config String disk_size command <<< cat ${vcf} | grep '#' > header cat ${vcf} | grep -v '#' > body cat body | grep -w '^chr1\|^chr2\|^chr3\|^chr4\|^chr5\|^chr6\|^chr7\|^chr8\|^chr9\|^chr10\|^chr11\|^chr12\|^chr13\|^chr14\|^chr15\|^chr16\|^chr17\|^chr18\|^chr19\|^chr20\|^chr21\|^chr22\|^chrX' > body.filtered cat header body.filtered > ${sampleName}.filtered.vcf /opt/hall-lab/bcftools-1.9/bin/bcftools norm -f ${ref_dir}/${fasta} ${sampleName}.filtered.vcf > ${sampleName}.normed.vcf cat ${sampleName}.normed.vcf | grep -v '#' | cut -f8 | sed s'/MQ=/\t/g' | cut -f2 | sed s'/;/\t/g' | cut -f1 > MQ cat ${sampleName}.normed.vcf | grep -v '#' | awk '{print $1"\t"$2"\t"$3"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9":MQ""\t"$10}' | paste - MQ -d ":" > body cat ${sampleName}.normed.vcf | grep '#' | cat - body > ${sampleName}.normed.mq.vcf >>> runtime { docker:docker cluster: cluster_config systemDisk: "cloud_ssd 40" dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" } output { File normed_vcf = "${sampleName}.normed.vcf" File normed_mq_vcf = "${sampleName}.normed.mq.vcf" } }