Question: the 'bin' column used by SAM, UCSC...
 
4
 
 

Hi all,

some mysql tables at the UCSC use a special column named 'bin'. For example in http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/snp130.sql :

CREATE TABLE `snp130` (
  `bin` smallint(5) unsigned NOT NULL default '0',
  (...)

it is not a primary key and it seems that this bin-thing is also used by the samtools (e.g. http://samtools.sourceforge.net/tabix.shtml )

What is that column ? how is it used ?

Pierre

 
 

2 answers

 
7
 
 

sorry, I found an answer to my question in http://samtools.sourcearchive.com/documentation/0.1.6~dfsg/bam__index_8c-source.html

The UCSC binning scheme was suggested by Richard Durbin and Lincoln Stein and is explained by Kent et al. (2002). In this scheme, each bin represents a contiguous genomic region which can be fully contained in another bin; each alignment is associated with a bin which represents the smallest region containing the entire alignment. The binning scheme is essentially another representation of R-tree. A distinct bin uniquely corresponds to a distinct internal node in a R-tree. Bin A is a child of Bin B if region A is contained in B.

In BAM, each bin may span 2^29, 2^26, 2^23, 2^20, 2^17 or 2^14 bp. Bin 0 spans a 512Mbp region, bins 1-8 span 64Mbp, 9-72 8Mbp, 73-584 1Mbp,
585-4680 128Kbp and bins 4681-37449 span 16Kbp regions. If we want to
find the alignments overlapped with a region [rbeg,rend), we need to
calculate the list of bins that may be overlapped the region and test the alignments in the bins to confirm the overlaps. If the specified region is short, typically only a few alignments in six bins need to be retrieved. The overlapping alignments can be quickly fetched.

 
 
 
log in to reply • written 24 months ago by Pierre Lindenbaum ♦♦ 351432768
 
 
3
 
 

Hello Pierre,

[?]

[?]

https://lists.soe.ucsc.edu/pipermail/genome/2010-April/021993.html

Hope this helps

 
 
 

thanks but it doesn't say how it works :-)

log in to reply • written 2.0 years ago by Pierre Lindenbaum ♦♦ 351432768
 
Log in to add a post