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?
Unconfigured Ad
Collapse
X
-
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:
This will return all SNPs that are in the intervals, and show which interval they are in:Code:intersectBed -a SNP.bed -b Intervals.bed -wb >SNPs.in.intervals.bed
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:
3 chr1 99 120Code:intersectBed -a SNP.bed -b Interval.bed -wb | awk -F"\t" '{print$5" "$6" "$7}' | uniq -c
4 chr2 11 130
First column gives counts of SNPs in each intervalLast edited by rbagnall; 02-05-2014, 06:49 PM.
-
-
that's what I usually do
Originally posted by rbagnall View PostIf 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:
This will return all SNPs that are in the intervals, and show which interval they are in:Code:intersectBed -a SNP.bed -b Intervals.bed -wb >SNPs.in.intervals.bed
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:
3 chr1 99 120Code:intersectBed -a SNP.bed -b Interval.bed -wb | awk -F"\t" '{print$5" "$6" "$7}' | uniq -c
4 chr2 11 130
First column gives counts of SNPs in each interval
Comment
-
Latest Articles
Collapse
-
by SEQadmin2
Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.
The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
...-
Channel: Articles
06-02-2026, 10:05 AM -
-
by SEQadmin2
With the launch of new single-cell sequencing platforms in 2026, the field stands at an exciting inflection point. This article surveys the most impactful advances in the field and discusses how they’re reshaping research in cancer, immunology, and beyond.
Introduction
Single-cell sequencing technologies have undergone remarkable advances over the past decade, transitioning from low-throughput experimental approaches to highly scalable platforms capable of...-
Channel: Articles
05-22-2026, 06:42 AM -
ad_right_rmr
Collapse
News
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Sequencing the Two-Toed Sloth Genome Reveals Jumping Genes Tied to Its Extreme Metabolism
by SEQadmin2
Started by SEQadmin2, Yesterday, 11:58 AM
|
0 responses
9 views
0 reactions
|
Last Post
by SEQadmin2
Yesterday, 11:58 AM
|
||
|
Started by SEQadmin2, 06-05-2026, 10:09 AM
|
0 responses
25 views
0 reactions
|
Last Post
by SEQadmin2
06-05-2026, 10:09 AM
|
||
|
Started by SEQadmin2, 06-04-2026, 08:59 AM
|
0 responses
35 views
0 reactions
|
Last Post
by SEQadmin2
06-04-2026, 08:59 AM
|
||
|
Started by SEQadmin2, 06-02-2026, 12:03 PM
|
0 responses
57 views
0 reactions
|
Last Post
by SEQadmin2
06-02-2026, 12:03 PM
|
Comment