deepTools icon indicating copy to clipboard operation
deepTools copied to clipboard

How is fragment length calculated?

Open gdolsten opened this issue 2 years ago • 1 comments

Hi, I am using some BAM files which have been mapped and then processed into a list of 1-bp coordinates with strand information, i.e:

chr4 3648 - -

Currently, I have these in a large .bed file, and I want to extract them into separate strands for bamCoverage pileup. For this, I first sort the strands into my files of interest, and then use bedToBam to convert my bed file into bam files. They are all the same length (61). For this reason, I want to include the fragment length in the bed file so it can be included in the bam file. Because of this, I was wondering which field deepTools uses to estimate fragment length since I have other reads like this:

A00741:88:HJVGKDRXX:1:2101:3332:1000 0 3R 4194267 42 61M * 0 0 TGTAAAAACTAATCTTATTGAATTTAGACAATGGCAGAACCTTTTTTTCGGGTCAATTGCC FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AS:i:0 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:61 YT:Z:UU

And they seem to be processed correctly by deeptools, despite the TLEN field being 0.

gdolsten avatar Sep 29 '21 17:09 gdolsten

For single-end reads the fragment length is the read length.

dpryan79 avatar Sep 30 '21 09:09 dpryan79