loading vcf with readVcf
1
0
Entering edit mode
Haiying.Kong ▴ 110
@haiyingkong-9254
Last seen 5.0 years ago
Germany

  I have a vcf file like:

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  T127554 T136801 T78254  T9      T96096  T99633
1       10492   .       C       T       40.17   .       AC=1;AF=0.125;AN=8;BaseQRankSum=-4.310e-01;ClippingRankSum=0.00;DP=10;ExcessHet=3.0103;FS=4.771;MLEAC=2;MLEAF=0.250;MQ=60.00;MQRankSum=0.00;QD=13.39;ReadPosRankSum=-9.670e-01;SOR=2.
225     GT:AD:DP:GQ:PL  ./.:0,0:0:.:0,0,0       0/0:3,0:3:6:0,6,90      ./.:0,0:0:.:0,0,0       0/0:3,0:3:0:0,0,9       0/1:1,2:3:31:67,0,31    0/0:1,0:1:3:0,3,34

  If I read the file with the code:

vcf = readVcf(vcffile, "hg19", param=ScanVcfParam(fixed=c("CHROM", "POS", "ID", "REF", "ALT")))

  I get warning:

1: In .vcf_usertag(map, tag, "fixed", verbose) :
  ScanVcfParam ‘fixed’ fields not found in  header: ‘CHROM’ ‘POS’ ‘ID’ ‘REF’

  It does read in but with wrong format.

 

bioconductor • 1.1k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 8 hours ago
United States

Here is the relevant part of the help page for ScanVcfParam:

fixed: A character() vector of fixed fields to be returned. Possible
          values are ALT, QUAL and FILTER. The CHROM, POS, ID and REF
          fields are needed to create the  GRanges  of variant
          locations. Because these are essential fields there is no
          option to request or omit them. If not specified, all fields
          are returned; if  fixed=NA  only REF is returned.

Which tells you that there is no option to request or omit the CHROM, POS, ID and REF fields. Another way of putting that is to say 'Don't specify CHROM, POS, ID or REF in the fixed fields argument, because they are there by default.'

Also, what does 'It does read in but with the wrong format' mean, exactly?

ADD COMMENT
0
Entering edit mode

After reading in (ignored the warning for a moment), I filtered with filterVCF, and saved as new vcf.

But it has wrong information on the column ID:

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  T127554 T136801 T78254  T9      T96096  T99633
7       132011577       7:132011577_G/T G       T       35.16   .       AC=1;AF=0.125;AN=8;BaseQRankSum=0.431;ClippingRankSum=0;DP=22;ExcessHet=3.0103;FS=4.771;MLEAC=1;MLEAF=0.125;MQ=60;MQRankSum=0;QD=11.72;ReadPosRankSum=0;SOR=2.225   GT:AD:DP:GQ:PL   .:0,0:0:.:0,0,0 0/0:5,0:5:12:0,12,180   .:0,0:0:.:0,0,0 0/1:1,2:3:28:66,0,28    0/0:5,0:5:15:0,15,190   0/0:8,0:8:24:0,24,291

Also, I tend to feel that the filtering is not properly done. I will take closer look tomorrow.

 

ADD REPLY

Login before adding your answer.

Traffic: 698 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6