Tabix Perl Api Examples
2
0
Entering edit mode
7.2 years ago
Vivek ★ 2.5k

I'm trying to develop a script to annotate a VCF file with functional predictions and scores from dbNSFP. dbNSFP is distributed as large tab de-limited files with information for each non synonymous variant locus. https://sites.google.com/site/jpopgen/dbNSFP

I thought it might be most efficient to index these files and use the Tabix perl API to query these files for each variant in my VCF file. I searched for any working examples or documentation for the tabix perl API without any luck and I'd like to know if there is something available that might be easier than looking into the source code.

tabix perl api vcf annotation • 4.5k views
ADD COMMENT
2
Entering edit mode
7.2 years ago
hardingnj ▴ 210

Recently had to go through the source myself, I found the tests in the t/ folder instructive.

Brief synopsis:

use Tabix;

my $tabix = Tabix->new('-data' => $file); 

$var = $tabix->read(

  $tabix->query( $chrom, $start, $end) 

);

$var is a scalar string that will need to be parsed.

ADD COMMENT
0
Entering edit mode

I'll accept this as the answer since the test scripts appear to be the best available resource. Thanks!

ADD REPLY
1
Entering edit mode
7.2 years ago
DG 7.2k

So, while I can see the desire in wanting to do this yourself I should point out that there already exists a widely used tool in the genomics community that will annotate a VCF file with dbNSFP annotations, and has recently been updated so it works using TABIX, making it much quicker than it was before.

snpSIFT which is part of the snpEff package, can do this. Since snpSIFT is published, snpEff is pretty widely used for annotating VCF files, etc, you might want to just use this program rather than trying to reinvent the wheel.

ADD COMMENT
0
Entering edit mode

Thanks for the link but the idea here is not to re-invent the wheel but to not mess with an existing workflow of an analysis pipeline too much. Using another tool, I'd have to eventually write another script to reformat the output and make changes to suit the collaborators' preferences which they are usually very particular about so introducing a simple annotation script is probably easier for me.

Also the idea of using tabix is not just limited to this scenario with dbNSFP, I should eventually be able to write a stock module that could handle any tab-delimited annotation feature to tag a VCF as required.

ADD REPLY
0
Entering edit mode

Hi,

I'm trying to use the snpSift option to annotate with dbNSFP and I'm getting

Fatal error: Tabix index not found for database '~/snpEff_latest_core/snpEff/0B7Ms5xMSFMYlSTY5dDJjcHVRZ3M.gz'

I have downloaded the database and the index from snpSift manual.

Do you know how to solve this problem?

ADD REPLY
0
Entering edit mode

I haven't run into this particular problem, but I haven't been annotating my VCF files with dnbSFP much recently.

ADD REPLY

Login before adding your answer.

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