igvteam/igv.js

Sort samples shown in vcf variant track by genotype

UndressK opened this issue · 5 comments

Hello!
I created a test vcf file (attached) that is displaying the genotype info for 8 samples for those 5 variants. Is it possible to sort them by genotype (GT) instead of by the order in which they appear on the VCF? so that for instance the samples with HET (1|0) or HOM (1|1) show up always on top by default? (and samples with 0|0 or no GT are displayed always below)
Thanks!

vars.vcf.gz

image

Hi, currently there is not an option to sort by genotype in igv.js. Leave this issue open, we will treat it as a feature request.

Thank you Jim!

I'm looking at this now. Its somewhat complicated as a sample can have multiple genotypes, if there are multiple variants at a site. This is pretty common in the 1KG dataset for example. I'm sure something reasonable can be done just noting this complication.

This is implemented and will be in the upcoming release (early June). The configuration looks like this

                {
                    name: "VCF",
                    type: "variant",
                    format: "vcf",
                    url: "../../test/data/vcf/vars.vcf",
                    indexed: false,
                    sort: {
                        direction: "DESC",
                        option: "genotype",
                        chr: "chr4",
                        position: 102596193
                    },
                    height: 200
                }