How to display a VCF/BCF file or stream as a paginated table in a python web framework (e.g. Django)?
2
0
Entering edit mode
6.3 years ago
William ★ 5.2k

Does anyone know how display a VCF/BCF file or stream as a paginated table in a python web framework (e.g. Django)?

Is this possible at all?

The number of variants (i.e records) can be kept low trough pagination (e.g. 500).
Number of samples (i.e. columns) might be several 100.

I was thinking to use cyvcf2 to read the first 500 variants at the start of the file or the first 500 in a region of interest https://github.com/brentp/cyvcf2 . cyvcf2 can use the vcf.gz or bcf.csi index.

From the cyvcf2 variant records I can create a simple table that I am looking to display using a python web GUI.

vcf gui • 2.6k views
ADD COMMENT
1
Entering edit mode
6.3 years ago

Is this possible at all?

you could create a binary index file containing the offsets of each variant in the flat vcf file or in the bgzipped-tabix-file. Then to get the ith variant you would just have to read the VCF header , move a pointer (fseek) to the i-th index and read the vcf line...

ADD COMMENT
0
Entering edit mode

I was thinking to use cyvcf2 to read the first 500 variants at the start of the file or the first 500 in a region of interest https://github.com/brentp/cyvcf2 . cyvcf2 can use the vcf.gz or bcf.csi index. From the cyvcf2 variant records I can create a simple table that I am looking to display using a python web GUI.

ADD REPLY
1
Entering edit mode
6.3 years ago

Sounds like Varify https://github.com/chop-dbhi/varify or xBrowse

The stack is just too slow for 100 samples...

ADD COMMENT
0
Entering edit mode

Thanks I will have a look. Is thinks the correct link for xbrowse? https://github.com/macarthur-lab/seqr/tree/master/xbrowse ? It's wat google gives me and it is part of something called seqr. Do you have any additional documentation about xbrowse?

And which stack is too slow for 100 samples?

ADD REPLY
1
Entering edit mode

both of them (old xbrowse and varify) are not going to scale beyond a couple trios

seqr is the next generation of xbrowse and I think they have plans to leverage TileDB/GenomicsDB and Hail. Maybe we can get them to chime in here.

ADD REPLY
0
Entering edit mode

seqr now supports Hail but with a layer of elasticsearch. It does not support TileDB but in theory it could.

ADD REPLY

Login before adding your answer.

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