Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bylemcsmith
    Junior Member
    • Jan 2014
    • 2

    #1

    Identify SNP intervals

    I was wondering what the best tool is to use if you have a set of SNPs and a list of intervals on chromosomes, how do you determine how many SNPs are in each interval? So far I have been writing my own code, which has been very inefficient. It takes days to run. I was wondering if there is a program that will do this?
  • rbagnall
    Member
    • Jun 2010
    • 34

    #2
    If you have the chromosome co-ordinates of your SNPs, you could use Bedtools.

    Save your list of SNPs in bed format as SNP.bed

    chr1 100 101 rs1
    chr1 105 106 rs2
    chr1 110 111 rs3
    chr1 5000 5001 rs_not_in_interval
    chr2 100 101 rs4
    chr2 105 106 rs5
    chr2 110 111 rs6
    chr2 120 121 rs7
    chr2 400 401 rs_not_in_interval


    Save your list of intervals in bed format as Intervals.bed

    chr1 99 120
    chr2 11 130

    Then use bedtools intersectBed:

    Code:
    intersectBed -a SNP.bed -b Intervals.bed -wb >SNPs.in.intervals.bed
    This will return all SNPs that are in the intervals, and show which interval they are in:

    chr1 100 101 rs1 chr1 99 120
    chr1 105 106 rs2 chr1 99 120
    chr1 110 111 rs3 chr1 99 120
    chr2 100 101 rs4 chr2 11 130
    chr2 105 106 rs5 chr2 11 130
    chr2 110 111 rs6 chr2 11 130
    chr2 120 121 rs7 chr2 11 130

    To go one further and count how many SNPs are in each interval:

    Code:
    intersectBed -a SNP.bed -b Interval.bed -wb | awk -F"\t" '{print$5" "$6" "$7}' | uniq -c
    3 chr1 99 120
    4 chr2 11 130

    First column gives counts of SNPs in each interval
    Last edited by rbagnall; 02-05-2014, 06:49 PM.

    Comment

    • crazyhottommy
      Senior Member
      • Apr 2012
      • 187

      #3
      that's what I usually do

      Originally posted by rbagnall View Post
      If you have the chromosome co-ordinates of your SNPs, you could use Bedtools.

      Save your list of SNPs in bed format as SNP.bed

      chr1 100 101 rs1
      chr1 105 106 rs2
      chr1 110 111 rs3
      chr1 5000 5001 rs_not_in_interval
      chr2 100 101 rs4
      chr2 105 106 rs5
      chr2 110 111 rs6
      chr2 120 121 rs7
      chr2 400 401 rs_not_in_interval


      Save your list of intervals in bed format as Intervals.bed

      chr1 99 120
      chr2 11 130

      Then use bedtools intersectBed:

      Code:
      intersectBed -a SNP.bed -b Intervals.bed -wb >SNPs.in.intervals.bed
      This will return all SNPs that are in the intervals, and show which interval they are in:

      chr1 100 101 rs1 chr1 99 120
      chr1 105 106 rs2 chr1 99 120
      chr1 110 111 rs3 chr1 99 120
      chr2 100 101 rs4 chr2 11 130
      chr2 105 106 rs5 chr2 11 130
      chr2 110 111 rs6 chr2 11 130
      chr2 120 121 rs7 chr2 11 130

      To go one further and count how many SNPs are in each interval:

      Code:
      intersectBed -a SNP.bed -b Interval.bed -wb | awk -F"\t" '{print$5" "$6" "$7}' | uniq -c
      3 chr1 99 120
      4 chr2 11 130

      First column gives counts of SNPs in each interval

      Comment

      • Jeremy
        Senior Member
        • Nov 2009
        • 190

        #4
        If you know any R then the GenomicRanges package does that using countOverlaps and or findOverlaps. You can then subset the SNPs based on the results.

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
          by SEQadmin2



          Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

          Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
          ...
          10-14-2026, 09:55 AM
        • SEQadmin2
          New Genomics Technologies Take Aim at Long-Standing Limits
          by SEQadmin2


          Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

          We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
          ...
          09-28-2026, 10:25 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 10-22-2026, 11:13 AM
        0 responses
        23 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-22-2026, 10:48 AM
        0 responses
        20 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        36 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        42 views
        0 reactions
        Last Post SEQadmin2  
        Working...