How to split paired end read as length distribution like (0-50,50-150, >150)?
1
1
Entering edit mode
5.9 years ago

hi,I want to split paired end read as length distribution like (0-50,50-150, >150),How can I do it? when I using samtools extract reads

samtools view -h Epi2_input_rmdup.bam |\
awk 'length($10) > 100 && length($10) < 200|| $1 ~ /^@/' |\
samtools view -bS - > 100_200qc_rm/50_Epi2_input_rmdup.bam

I found all reads length no more than 100bp, but when I draw paired reads fragment size stastics using deeptools bamPEFragmentSize,it show length 0-500bp.

sequencing • 2.4k views
ADD COMMENT
1
Entering edit mode
5.9 years ago

you're confusing read-length length($10) and fragment-length (abs($9) the later is the distance between the read and the mate).

http://deeptools.readthedocs.io/en/develop/content/tools/bamPEFragmentSize.html

This tool calculates the fragment sizes for read pairs given a BAM file from paired-end sequencing.

ADD COMMENT
0
Entering edit mode

Thank you very very much!!!!but how can I extract PE fragment length (R1+R2) , make it split to (0-50bp,50-150bp, >150bp)?

ADD REPLY
0
Entering edit mode

I'm surprised you cannot find how to do this with column $9 while you've been able to write a awk expression for the read length (?)

ADD REPLY
0
Entering edit mode

your answer is helpful,now I konw how to do it,thanks!

ADD REPLY
0
Entering edit mode

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.

Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

Traffic: 2863 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6