I have a large dataset that looks like this. I was wondering if there is a clever way to apply a t-test, in each row, aka gene, and compare the counts between humans and mice.
I want to compete in each row (human_A,human_B,human_C) vs (mouse_A,mouse_B)
human_A = rnorm(20, 10, 1)
human_B <- rnorm(20, 10, 2)
human_C <- rnorm(20, 20, 3)
mouse_A = rnorm(20, 5, 1)
mouse_B <- rnorm(20, 10, 2)
genes <- paste0("gene_",rep(1:20))
df <- data.frame(genes,human_A,human_B,human_C,mouse_A,mouse_B)
head(df)
#> genes human_A human_B human_C mouse_A mouse_B
#> 1 gene_1 8.482934 10.396456 21.88825 6.070031 6.136563
#> 2 gene_2 9.836256 13.170547 23.04314 4.247680 11.781652
#> 3 gene_3 9.280803 11.184282 19.64985 6.010297 6.430591
#> 4 gene_4 9.069052 8.884374 19.95509 4.633871 11.233594
#> 5 gene_5 8.059434 10.314406 20.45426 4.519976 6.357627
#> 6 gene_6 11.433998 13.497519 20.28876 4.904321 9.599483
Created on 2023-01-15 with reprex v2.0.2
any help and advice are appreciated