Illumina / canvas

Canvas - Copy number variant (CNV) calling from DNA sequencing data
Other
121 stars 20 forks source link

Canvas vcf to plink.cnv output #135

Closed oalavijeh closed 4 years ago

oalavijeh commented 4 years ago

Dear Canvas team,

Is there an inbuilt method of parsing the vcf output from Canvas into the plink .cnv output (shown below)

 FID    IID   CHR       BP1       BP2  TYPE   SCORE  SITE
 P1     P1      4  71338469  71459318     1      27     0
 P1     P1      5  31250352  32213542     1    34.2     0
 P1     P1      7  53205351  53481230     3    18.2     0
 P2     P2     11  86736484  87074601     1      22     0  
 P2     P2     14  47817280  47930190     4    55.1     0

Many thanks

eroller commented 4 years ago

No, not from our end at least. You should be able to come up with a bcftools command to do it though. If you get it to work please paste an example command here so others can benefit.

oalavijeh commented 4 years ago
bcftools query -f '%ID, %ID, %CHROM, %POS, %END, [%CN], %QUAL, 0\n'  cnv_file.vcf > cnv_plink

sed -e 's/\.//g' > outfile 
sed 's/\,\/t/g' file >outfile.cnv