瀏覽代碼

Fixbug: SAMPLES columns

master
YaqingLiu 3 年之前
父節點
當前提交
e23da992f3
共有 1 個文件被更改,包括 10 次插入10 次删除
  1. +10
    -10
      tasks/VEP.wdl

+ 10
- 10
tasks/VEP.wdl 查看文件

@@ -34,17 +34,17 @@ task VEP {


# 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"
sample_col_1=`awk -F'\t' '{if($1~"^#CHROM"){print $10}}' ${vcf}`
sample_col_2=`awk -F'\t' '{if($1~"^#CHROM"){print $11}}' ${vcf}`
if [ $sample_col_2 ]; then # This situation means there are pairs
SAMPLE_vcf2maf="--tumor-id $sample_col_2 --normal-id $sample_col_1"
SAMPLE_vcf2vcf="--vcf-tumor-id $sample_col_2 --vcf-normal-id $sample_col_1"
cp ${vcf} ${sample_id}.tmp1.vcf
else
SAMPLE_vcf2maf="--tumor-id $tumor_id"
else # Tumor-only or normal-only
SAMPLE_vcf2maf="--tumor-id $sample_col_1"
# Add a column and remove it after vcf2vcf
SAMPLE_vcf2vcf="--vcf-tumor-id $tumor_id --vcf-normal-id $tumor_id"
SAMPLE_vcf2vcf="--vcf-tumor-id $sample_col_1 --vcf-normal-id $sample_col_1"
awk -F'\t' 'OFS="\t" {if($1!~"^##" && length($11)==0) $11=$10; print $0}' ${vcf} > ${sample_id}.tmp1.vcf
fi

@@ -56,7 +56,7 @@ task VEP {
$SAMPLE_vcf2vcf \
--ref-fasta ${ref_dir}/${fasta}
if [ $normal_id ]; then
if [ $sample_col_2 ]; then
cp ${sample_id}.tmp2.vcf ${basename}.norm.vcf
else
cut -f 1,2,3,4,5,6,7,8,9,10 ${sample_id}.tmp2.vcf > ${basename}.norm.vcf

Loading…
取消
儲存