|
|
@@ -23,43 +23,43 @@ task VEP { |
|
|
|
source /etc/profile |
|
|
|
|
|
|
|
#awk -F'\t' '{if(($1~"^#")||($1!~"^#" && $7=="PASS")){print $0}}' ${vcf} > ${sample_id}.vcf |
|
|
|
|
|
|
|
|
|
|
|
# Set the buffer_size based on the data size |
|
|
|
nrow=`awk -F'\t' '{if($1~"^chr"){print $0}}' ${vcf} | wc -l` |
|
|
|
if [ $nrow -lt 5000 ]; then |
|
|
|
buffer_size="--buffer_size 5000" |
|
|
|
else |
|
|
|
buffer_size="--buffer_size 1000" |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Judge the SAMPLE info of vcf file |
|
|
|
tumor_id=`awk -F'\t' '{if($1~"^#CHROM"){print $10}}' ${vcf}` |
|
|
|
normal_id=`awk -F'\t' '{if($1~"^#CHROM"){print $11}}' ${vcf}` |
|
|
|
|
|
|
|
|
|
|
|
if [ $normal_id ]; then |
|
|
|
SAMPLE_vcf2maf="--tumor-id $tumor_id --normal-id $normal_id" |
|
|
|
SAMPLE_vcf2vcf="--vcf-tumor-id $tumor_id --vcf-normal-id $normal_id" |
|
|
|
cp ${vcf} raw.vcf |
|
|
|
cp ${vcf} ${sample_id}.tmp.vcf |
|
|
|
else |
|
|
|
SAMPLE_vcf2maf="--tumor-id $tumor_id" |
|
|
|
# Add a column and remove it after vcf2vcf |
|
|
|
SAMPLE_vcf2vcf="--vcf-tumor-id $tumor_id --vcf-normal-id $tumor_id" |
|
|
|
awk -F'\t' 'OFS="\t" {if($1!~"^##" && length($11)==0) $11=$10; print $0}' ${vcf} > raw.vcf |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Set the buffer_size based on the data size |
|
|
|
nrow=`awk -F'\t' '{if($1~"^chr"){print $0}}' ${vcf} | wc -l` |
|
|
|
if [ $nrow -lt 5000 ]; then |
|
|
|
buffer_size="--buffer_size 5000" |
|
|
|
else |
|
|
|
buffer_size="--buffer_size 1000" |
|
|
|
awk -F'\t' 'OFS="\t" {if($1!~"^##" && length($11)==0) $11=$10; print $0}' ${vcf} > ${sample_id}.tmp1.vcf |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# vcf2vcf: transfer into a standardized format |
|
|
|
echo "Transfer the VCF file into a standardized format..." |
|
|
|
perl ${vcf2maf_path}/vcf2vcf.pl \ |
|
|
|
--input-vcf $raw.vcf --output-vcf norm.vcf \ |
|
|
|
--input-vcf ${sample_id}.tmp1.vcf --output-vcf ${sample_id}.tmp2.vcf \ |
|
|
|
$SAMPLE_vcf2vcf \ |
|
|
|
--ref-fasta ${ref_dir}/${fasta} |
|
|
|
|
|
|
|
if [ $normal_id ]; then |
|
|
|
cp $norm.vcf ${basename}.norm.vcf |
|
|
|
cp ${sample_id}.tmp2.vcf ${basename}.norm.vcf |
|
|
|
else |
|
|
|
cut -f 1,2,3,4,5,6,7,8,9,10 $norm.vcf > ${basename}.norm.vcf |
|
|
|
cut -f 1,2,3,4,5,6,7,8,9,10 ${sample_id}.tmp2.vcf > ${basename}.norm.vcf |
|
|
|
|
|
|
|
|
|
|
|
# VEP annotation |