Question: Find Fragment Size of a bamfilee
1
gravatar for GK1610
2.2 years ago by
GK161040
United States
GK161040 wrote:

I have a test.bam file which has paired end reads data

I want to find the fragment size of each pair to compare the results from macs2 fragment size determination.

chip-seq • 755 views
ADD COMMENTlink modified 2.2 years ago by apnri40 • written 2.2 years ago by GK161040

Starting with your original data you can calculate the insert sizes by a couple of different ways using BBMap. BBMap is available here.

ADD REPLYlink written 2.2 years ago by genomax59k
1
gravatar for Devon Ryan
2.2 years ago by
Devon Ryan86k
Freiburg, Germany
Devon Ryan86k wrote:

You can get the distribution with bamPEFragmentSize from deepTools.

ADD COMMENTlink written 2.2 years ago by Devon Ryan86k
1
gravatar for apnri
2.2 years ago by
apnri40
apnri40 wrote:

Fragment size calculation is usually determined by cross-correlation analysis, wherein you compute correlation between the positive and negative strand densities from a particular position. Then you shift the position of both strands by one position - you should expect to see maximum correlation between the two strands at fragment length.

You can use spp (used by ENCODE consortium) package to do this in R.

Snippet of code:

library(spp)    
chip.data <- read.bam.tags(bamfile)
binding.characteristics <- get.binding.characteristics(chip.data,srange=c(50,500),bin=5, accept.all.tags = T)
print(paste("binding peak separation distance =",binding.characteristics$peak$x))
ADD COMMENTlink modified 2.2 years ago • written 2.2 years ago by apnri40

This is only done for single-end data (otherwise, the fragment length distribution can simply be measured) and the ENCODE cross-correlation stuff is...incredibly questionable (the amount of filter and mucking with the data that's done to get the results is, frankly, absurd).

ADD REPLYlink written 2.2 years ago by Devon Ryan86k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1730 users visited in the last hour