Suppressing the ID value from writeVcf
1
1
Entering edit mode
fongchunchan ▴ 30
@fongchunchan-8397
Last seen 8.1 years ago
Canada/Vancouver/BCCA

Hi,

I noticed that when I use VariantAnnotation::writeVcf() on a vcf file it will fill the ID column with a string that is the combination of chromosome, position, ref and alt allele. This happens even though the vcf file that I read in using VariantAnnotation::readVcf() had no values in the ID column. 

Is there a way to suppress these values in the VariantAnnotation::writeVcf output? In other words, I don't want the ID column to be filled with some identifier that is constructed in the final VCF output file.

Thanks,

 

 

readvcf writevcf • 1.3k views
ADD COMMENT
0
Entering edit mode
@valerie-obenchain-4275
Last seen 2.9 years ago
United States

Hi,

The ID values become the row names on the GRanges in rowRanges(vcf). As you saw, if IDs are missing, the default behavior is to use CHROM:POS_REF/ALT. To turn this off use 'row.names = FALSE'. I've updated the docs in devel to clarify this.

readVcf(myfile, "genome", row.names=FALSE)

Valerie

ADD COMMENT

Login before adding your answer.

Traffic: 623 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