I have a bam file which ~50% of it is ambiguously mapped reads (since the library is from small RNAs). For each feature (e.g., gene) in my GTF file I'd like to add a count of 1 if a read from that bam file maps to that feature uniquely and 1/n if a read maps to n locations (that feature being one of them).
Is there any software of preferably an R package that can be used for that?
I know this gives a read count for every feature, and one can use either uniquely or ambiguously mapped reads but that still doesn't give exactly what I need.
Thanks a lot