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
CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).
Despite this, “CRISPR helped turn genome editing from a specialized technique into...-
Channel: Articles
07-31-2026, 11:01 AM -
-
by SEQadmin2
Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.
The systematic characterization of the human proteome has...-
Channel: Articles
07-20-2026, 11:48 AM -
ad_right_rmr
Collapse
News
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SEQadmin2, Today, 12:22 PM
|
0 responses
12 views
0 reactions
|
Last Post
by SEQadmin2
Today, 12:22 PM
|
||
|
Started by SEQadmin2, 08-11-2026, 10:35 AM
|
0 responses
13 views
0 reactions
|
Last Post
by SEQadmin2
08-11-2026, 10:35 AM
|
||
|
Started by SEQadmin2, 08-06-2026, 07:41 AM
|
0 responses
30 views
0 reactions
|
Last Post
by SEQadmin2
08-06-2026, 07:41 AM
|
||
|
Started by SEQadmin2, 08-03-2026, 10:13 AM
|
0 responses
48 views
0 reactions
|
Last Post
by SEQadmin2
08-03-2026, 10:13 AM
|
Comment