This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I get the list of genes between two SNPs?

Hello everyone,

I have a list of regions with a SNP designating the start of the region and a SNP designating the end of the region (an example is shown below). How can I obtain a list with all the genes within that region?

e.g.

Chr    SNP1    SNP2
2    rs2370833   rs10173517
4   rs10000431   rs10012661
..
..
..

Thank you,
Hamid

plink snp gwas homozygosity-mapping

2 answers

using ucsc mysql:

select distinct
    S1.chrom,
    S1.chromStart,
    S2.chromEnd,
    X.geneSymbol
from
snp144 as S1,
snp144 as S2,
knownGene as K,
kgXref as X
where
S1.name in ("rs2370833","rs10173517") and
S2.name in ("rs2370833","rs10173517") and
S1.chromStart < S2.chromStart and
S1.chrom = S2.chrom and
K.chrom = S1.chrom and
NOT( K.txEnd < S1.chromStart or K.txStart>=S2.chromEnd) and
X.kgID = K.name;

chrom    chromStart    chromEnd    geneSymbol
chr2    209804520    230164977    UNC80
chr2    209804520    230164977    RPE
chr2    209804520    230164977    KANSL1L
chr2    209804520    230164977    RP11-260M2.1
chr2    209804520    230164977    AC007038.7
chr2    209804520    230164977    AC006994.2
chr2    209804520    230164977    ACADL
chr2    209804520    230164977    AC006994.3
chr2    209804520    230164977    Y_RNA
chr2    209804520    230164977    MYL1
chr2    209804520    230164977    LANCL1-AS1
chr2    209804520    230164977    LANCL1
chr2    209804520    230164977    CPS1

You could use the biomaRt R package: https://bioconductor.org/packages/release/bioc/html/biomaRt.html, or the UCSC Genome Browser: https://genome-euro.ucsc.edu/cgi-bin/hgGateway?redirect=manual&source=genome.ucsc.edu

Log in to answer this question.