Hi Medhat,
Thanks for your solution! When I use the commands below, it was killed.
bedtools intersect -a GENE_body_sorted.bed -b Col-genome-rep1.bam -wo > Col-genome-rep1.bed
Killed
Here is my bed file for genes:
chr1 3631 5899 AT1G01010 . +
chr1 5928 8737 AT1G01020 . -
chr1 11649 13714 AT1G01030 . -
chr1 23146 31227 AT1G01040 . +
chr1 31170 33153 AT1G01050 . -
chr1 33379 37871 AT1G01060 . -
chr1 38752 40944 AT1G01070 . -
chr1 44677 44787 AT1G01073 . +
chr1 45296 47019 AT1G01080 . -
chr1 47485 49286 AT1G01090 . -
I used htseq-count to count numbers of mapped reads of each gene. However, I do not know which option I can use to get the lengths of each mapped reads. For example, there are a group of small RNAs mapped to gene AT1G01010. Among those sRNAs, I want to know how many of them are 21 nt sRNAs, 22 nt sRNAs, 23 nt sRNAs ... etc.