[ensembl-dev] efficient way to calculate high-LD pairs to a single variant with API?

Anja Thormann anja at ebi.ac.uk
Thu Aug 11 09:18:18 BST 2016


Hi Andrew,

you can use fetch_by_VariationFeature passing your SNP of interest as argument. To create a VariationFeature for your SNP of interest you need to fetch_by_name() from a VariationAdaptor and then call get_all_VariationFeatures on your Variation object. In most cases a variation has only one associated VariationFeature. If the variant maps to multiple regions of the genome it will have a VariationFeature for each of the mappings and you need to choose the VariationFeature by location.

Using fetch_by_VariationFeature on a LDFeatureContainerAdaptor only computes LD between your VariationFeature and all the VariationFeatures in the given region. The window size is 20KB at the moment centering around your variant. You can adjust the window size using the method max_snp_distance.

We also have a method fetch_by_VariationFeatures where you can pass all the VariationFeatures for which you want to compute pairwise LD values.
 
I hope this is useful to you.

Best,
Anja

> On 11 Aug 2016, at 04:42, andrew126 at mac.com wrote:
> 
> Hi,
> 
> Using the API's LDFeatureContainer and LDFeatureContainerAdapter r^2 values seem to be calculated between all variant pairs.  Is there a way to avoid all unnecessary calculations if I am only interested in high-LD pairs to a single SNP across a region/slice?  So I only need (n-1) r^2 calculations across a region, and not n*(n-1) r^2 calculations.
> 
> Thanks for any guidance.
> 
> Best,
> 
> Andrew
> 
> 
> 
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info: http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/





More information about the Dev mailing list