Przeglądaj źródła

Fixbug: SAMPLES columns

master
YaqingLiu 3 lat temu
rodzic
commit
e23da992f3
1 zmienionych plików z 10 dodań i 10 usunięć
  1. +10
    -10
      tasks/VEP.wdl

+ 10
- 10
tasks/VEP.wdl Wyświetl plik

@@ -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

Ładowanie…
Anuluj
Zapisz