output of the function "makeCountsFromAbundance"
2
0
Entering edit mode
@capricygcapricyg-17892
Last seen 22 months ago
United States

Hello, there,

I am testing the function "makeCountsFromAbundance" using the following data (numbers derived from Salmon output):

> count
   a  b  c  d
A 27 50 67 36
B  0  0  0  0
> length
        a       b       c       d
A  310.08  395.79  504.53  342.48
B 1026.00 1008.00 1009.00 1021.00
> abundance
     [,1] [,2] [,3] [,4]
[1,] 3.14 4.95 3.84 4.91
[2,] 0.00 0.00 0.00 0.00
>  f=makeCountsFromAbundance(count,abundance,length,countsFromAbundance="scaledTPM")                               
> f
   a  b  c  d
A 27 50 67 36
B  0  0  0  0

I don't think I got the "scaledTPM" as the documentation indicated... Instead, the output is just raw counts. Could anyone help me with it?

Thanks.

C.

tximport • 678 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 1 day ago
United States

The problem is just that this data is artificial (one gene). Try on real data.

ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

You are testing using an edge case, where you only have two genes, and one has no observations (which isn't a real expectation). A more reasonable test would be to use two genes with actual observations:

> count
     [,1] [,2] [,3] [,4]
[1,]   27   50   67   36
[2,]    0    0    0    0
> count2 <- count
> count2[2,] <- c(1,2,4,3)
> count2
     [,1] [,2] [,3] [,4]
[1,]   27   50   67   36
[2,]    1    2    4    3
> abundance
     [,1] [,2] [,3] [,4]
[1,] 3.14 4.95 3.84 4.91
[2,] 0.00 0.00 0.00 0.00
> abundance2 <- abundance
> abundance2[2,] <- c(0.3,0.5, 0.7, 0.6)
> abundance2
     [,1] [,2] [,3] [,4]
[1,] 3.14 4.95 3.84 4.91
[2,] 0.30 0.50 0.70 0.60
> makeCountsFromAbundance(count2, abundance2, length)
         [,1]      [,2]     [,3]      [,4]
[1,] 25.55814 47.229358 60.05286 34.753176
[2,]  2.44186  4.770642 10.94714  4.246824
ADD COMMENT
0
Entering edit mode

Thank you very much!

ADD REPLY

Login before adding your answer.

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