|
|
@@ -0,0 +1,80 @@ |
|
|
|
task pindel{ |
|
|
|
String sample_id |
|
|
|
File bam |
|
|
|
File reference |
|
|
|
File reference_fai |
|
|
|
|
|
|
|
String docker |
|
|
|
String cluster |
|
|
|
String disk_size |
|
|
|
|
|
|
|
|
|
|
|
command <<< |
|
|
|
|
|
|
|
set -o pipefail |
|
|
|
set -e |
|
|
|
|
|
|
|
mkdir ./pindel_result/ |
|
|
|
mkdir ./input |
|
|
|
|
|
|
|
cp ${bam} ./input |
|
|
|
|
|
|
|
bam_file_name=`echo ${bam}|awk -F "/" '{print $NF}'` |
|
|
|
|
|
|
|
samtools index -@ 4 ./input/$bam_file_name |
|
|
|
|
|
|
|
java "-Xmx16G" -jar /software/picard/picard.jar CollectInsertSizeMetrics \ |
|
|
|
-H ./pindel_result/${sample_id}_picard.pdf \ |
|
|
|
-I ./input/$bam_file_name \ |
|
|
|
-O ./pindel_result/${sample_id}_picard.txt |
|
|
|
|
|
|
|
mean_insert_size=`cat pindel_result/${sample_id}_picard.txt|sed -n '8p'|cut -f 6|cut -d . -f 1` |
|
|
|
bam_file_name=`echo ${bam}|awk -F "/" '{print $NF}'` |
|
|
|
|
|
|
|
echo -e "./input/$bam_file_name\t$mean_insert_size\t${sample_id}" > ${sample_id}_config.txt |
|
|
|
|
|
|
|
pindel -i ${sample_id}_config.txt \ |
|
|
|
-f ${reference} \ |
|
|
|
-o ./pindel_result/${sample_id} \ |
|
|
|
-c all \ |
|
|
|
-T 4 \ |
|
|
|
-x 4 \ |
|
|
|
-l \ |
|
|
|
-B 0 \ |
|
|
|
-M 3 \ |
|
|
|
-J /software/picard/hg38_ucsc_centromere.bed |
|
|
|
|
|
|
|
grep "ChrID" pindel_result/${sample_id}_SI > pindel_result/${sample_id}_all_indel |
|
|
|
grep "ChrID" pindel_result/${sample_id}_D >> pindel_result/${sample_id}_all_indel |
|
|
|
|
|
|
|
awk -v chrID="chr1" '$8==chrID {print}' pindel_result/${sample_id}_all_indel > pindel_result/${sample_id}_indel |
|
|
|
|
|
|
|
for i in `seq 2 22` X Y M |
|
|
|
do |
|
|
|
awk -v chrID=chr$i '$8==chrID {print}' pindel_result/${sample_id}_all_indel >> pindel_result/${sample_id}_indel |
|
|
|
done |
|
|
|
|
|
|
|
pindel2vcf -r ${reference} \ |
|
|
|
-R GRCh38.d1.vd1 \ |
|
|
|
-d GDC \ |
|
|
|
-p pindel_result/${sample_id}_indel \ |
|
|
|
-v pindel_result/${sample_id}.pindel.indel.vcf |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>>> |
|
|
|
|
|
|
|
runtime { |
|
|
|
docker : docker |
|
|
|
cluster : cluster |
|
|
|
systemDisk: "cloud_ssd 40" |
|
|
|
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/ |
|
|
|
} |
|
|
|
|
|
|
|
output { |
|
|
|
Array[File] pindel_result=glob("./pindel_result/${sample_id}*") |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|