Quick code question in TPM conversion from raw counts RNAseq
1
1
Entering edit mode
5 months ago
v.johnson ▴ 20

I am using the below code to calculate TPM which I found on GitHub. Can anyone just confirm please what the '2' in the tpms code equates to please? I am new to RNAseq and normalisation analysis and what to understand the code fully.

Thank you kindly

`tpm <- function(counts, lengths) { rate <- counts / lengths rate / sum(rate) * 1e6 }

tpms <- apply(counts, 2, function(x) tpm(x, genes$Length))`

RNAseq tpm R • 470 views
ADD COMMENT
1
Entering edit mode
5 months ago

It is the argument (MARGIN) of the apply function; i.e. apply the tpm function to each column (2) of a data frame or matrix

ADD COMMENT
0
Entering edit mode

Thank you for your kind reply, that is most helpful, thank you, Victoria

ADD REPLY

Login before adding your answer.

Traffic: 2266 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