This is a test version of Biostars. For the public version, visit https://www.biostars.org.
RPKM values for mapped miRNA reads

Hello all, I had some miRNA samples, I performed the mapping of the miRNA reads to miRBase mature file by BWA. And the raw counts were generated by the following command:

samtools view -F 260 sample_1.sam | \
  cut -f 3 | sort | uniq -c | \
  awk '{printf("%s\t%s\n", $2, $1)}' > sample_1-counts.txt

How can I obtain the RPKM values from these raw counts? I mean, how can I normalize these raw counts? Or is there any other way like some tools which can be used for performing quantification on the mirna.sam file?

Thank you.

rna-seq

Is it correct that you have mRNA samples but quantify miRNAs? Does the library prep or rather RNA extraction properly capture the miRNAs? For RPKM, please check this video. Tools that can do that can be found on google.

Its miRNA and not MRNA, my typing mistake. Sorry, I have edited the post. Thank you

I think you are mistakenly mentioned as mRNA samples. I hope that is miRNA, am i corrrect? If i am, here is the code for RPKM.

    #Call library
    library(reshape2)
    #Import the input file
    sample_1-counts <- read.csv("~/Documents/sample_1-counts.csv")
    #Use melt and dcast 
    RPKM <- melt(sample_1-counts, measure.vars=c("sample1","sample2","sample3"))
    #Calculate the RPKM
    RPKM$RPKM <- with(RPKM, value*1e6 / (Total*miRNA_Length))

Yes, you are correct. It is miRNA. Thank you for the reply.

I'm getting an error in the above code:

Error in eval(substitute(expr), data, enclos = parent.frame()) : 
  object 'Total' not found

This normalisation which i have mentioned is fully intrasample based. So, you should calculate the tota readcountl of perticular miRNA from across all the samples. Ex: If you have 5 samples, you should calculate the total readcount of perticular miRNA from all 5 samples. Do like this for all miRNAs and add in the separate column titled as Total in your sample_1-counts file.

0 answers

No answers yet.

Log in to answer this question.