Biostar Beta. Not for public use.
Summarise statistics Fst values of SNPs list
0
Entering edit mode
21 months ago
paolo002 • 140

Hi, I have a data frame with Fst values for different SNPs windows.

I would like to summarise the mean and median of the Fst values for each gene windows:

            gene chr    start Nsites     Fst01    Fst02    Fst12     
1     AC002310.7  16 30591000      2       1       8.      5
2         ZNF785  16 30591000      2       1       30     1
3     AC002310.7  16 30593000      2       2       4.     10
4         ZNF785  16 30593000      2       3       20.    2
5     AC002310.7  16 30595000      2       3       2.     20
6         ZNF785  16 30595000      2       6.      10.    3

Output:

          gene       n   Fst01    Fst02    Fst12     
1     AC002310.7     3    2.        4.      10
2         ZNF785     3    3.       20       2

I wrote something like this:

df %>% summarise_at(group_by(df, gene), vars(Fst01, Fst02,Fst12), funs(n(),mean))

but it is giving me the following error:

Error: `.vars` must be a character/numeric vector or a `vars()` object, not list
Call `rlang::last_error()` to see a backtrace

Any help, highly appreciated, cheers

R • 243 views
ADD COMMENTlink
0
Entering edit mode
ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1