avereps function by limma package
1
0
Entering edit mode
lily ▴ 20
@lily-11438
Last seen 2.9 years ago
India

My expression data looks like where g1 is gene, s1 and s2 are samples

  Symbols       s1    s2  
    g1          2.3   4.5  
    g1          4.5   2.3

I have used limma::avereps to get unique gene symbols, however, i got unique gene symbols but the expression values was not averaged. The result is like

Symbols        s1   s2
g1             2.3  4.5

Please do suggest me!!

limma • 1.7k views
ADD COMMENT
0
Entering edit mode

Very important; did you check the help pages for the avereps() function? ?avereps Please provide the code you would like to run. What are the rownames() of your input?

ADD REPLY
0
Entering edit mode

limma::avereps(ex, ex$Symbols)

ADD REPLY
2
Entering edit mode
Guido Hooiveld ★ 3.9k
@guido-hooiveld-2020
Last seen 8 hours ago
Wageningen University, Wageningen, the …

Since your input x contains numbers and symbols, it is not a (numeric) matrix, and therefore not compatible with avereps(). The behavior you observed is documented on the avereps help pages.

> # Generate some data
> x <-  matrix(51:82, 8)
> colnames(x) <- c("S1","S2","S3","S4")
> #check
> is.numeric(x)
[1] TRUE
> 
> # define gene symbols, and combine with expression data
> Symbols <-  c("b","a","a","c","c","b","b","b")
> x2 <- cbind(x, Symbols)
> #check
> is.numeric(x2)
[1] FALSE
> 
> # Still try:
> avereps(x=x2, ID=x2[,"Symbols"])
     S1   S2   S3   S4   Symbols
[1,] "51" "59" "67" "75" "b"    
[2,] "52" "60" "68" "76" "a"    
[3,] "54" "62" "70" "78" "c"    
> # note that only first row/instance of genes (letters) are kept.
> # No averages are calculated!
> 
> # This works (using separate inputs for avereps!):
> avereps(x=x, ID=Symbols)
    S1   S2   S3   S4
b 55.5 63.5 71.5 79.5
a 52.5 60.5 68.5 76.5
c 54.5 62.5 70.5 78.5
> 
ADD COMMENT
0
Entering edit mode

Thank you for the response

ADD REPLY

Login before adding your answer.

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