Quick code question in TPM conversion from raw counts RNAseq
1
1
Entering edit mode
3.6 years ago
v.johnson ▴ 30

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 • 1.5k views
ADD COMMENT
1
Entering edit mode
3.6 years 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: 1868 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