Entering edit mode
6.7 years ago
siqizhao2018
•
0
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.
Thank you very very much!!!!but how can I extract PE fragment length (R1+R2) , make it split to (0-50bp,50-150bp, >150bp)?
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 (?)
your answer is helpful,now I konw how to do it,thanks!
If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.