请参阅下面的编辑 使用R,我想过滤矩阵(基因表达数据)并仅保留具有高方差值的行(基因/探针).例如,我只想保留具有底部和顶部百分位数值的行(例如,低于20%且高于80%).我想将我的研究仅限于下游分析的高变异基因.R中有基因过滤的常用方法吗?
我的矩阵有18个样本(列)和47000个探针(行),其值为log2变换和标准化.我知道该quantile()功能可以识别每个样品列中的20%和80%截止值.我无法弄清楚如何为整个矩阵找到这些值,然后将原始矩阵子集化以删除所有"非变化"行.
示例矩阵的平均值为5.97,因此最后三行应该被删除,因为它们包含20%和80%截止值之间的值:
> m
sample1 sample2 sample3 sample4 sample5 sample6
ILMN_1762337 7.86 5.05 4.89 5.74 6.78 6.41
ILMN_2055271 5.72 4.29 4.64 5.00 6.30 8.02
ILMN_1736007 3.82 6.48 6.06 7.13 8.20 4.06
ILMN_2383229 6.34 4.34 6.12 6.83 4.82 5.57
ILMN_1806310 6.15 6.37 5.54 5.22 4.59 6.28
ILMN_1653355 7.01 4.73 6.62 6.27 4.77 6.12
ILMN_1705025 6.09 6.68 6.80 6.85 8.35 4.15
ILMN_1814316 5.77 5.17 5.94 6.51 7.12 7.20
ILMN_1814317 5.97 5.97 5.97 5.97 5.97 5.97
ILMN_1814318 5.97 5.97 …Run Code Online (Sandbox Code Playgroud) geom_segment数据融化后,如何在绘图上绘制线条reshape2?
# Tiny dataset
facet_group <- c("facet1", "facet1", "facet2", "facet2")
time_group <- c("before", "after", "before", "after")
variable1 <- c(1,5,4,7)
variable2 <- c(2,4,5,8)
variable3 <- c(4,5,6,7)
data <- data.frame(facet_group, time_group, variable1, variable2, variable3)
# Melt data
library(reshape2)
data_melt <- melt(data, id.vars = c("facet_group", "time_group"))
Run Code Online (Sandbox Code Playgroud)
绘制数据:
# Plot 1
library(ggplot2)
ggplot(data_melt, aes(x=variable, y=value, group = time_group)) +
geom_point(aes(color = time_group))
Run Code Online (Sandbox Code Playgroud)
添加刻面:
# Plot 2
ggplot(data_melt, aes(x=variable, y=value, group = time_group)) +
geom_point(aes(color = time_group)) +
facet_grid(facet_group ~ .)
Run Code Online (Sandbox Code Playgroud)
我想为每个变量绘制从“之前”点到“之后”点的线段。(参见模拟图像)。我怎样才能做到这一点? …
如何运行source activate <env-name>更新$ PATH变量?我一直在查看CONDA-INSTALLATION/bin/activate脚本并且不明白conda如何更新我的$ PATH变量以包含最近激活的环境的bin目录.我在哪里可以找到conda用来添加我的$ PATH变量的代码.
我刚刚进行了因子方差分析,然后进行了TukeyHSD后测试.我TukeyHSD输出的一些调整后的P值是0.0000000.这些P值真的可以为零吗?或者这是一个四舍五入的情况,我的真实P值可能是1e-17,即四舍五入到0.0000000.
TukeyHSD()R中的函数是否有任何选项可以提供包含指数的输出P值?
这是我输出的片段:
TukeyHSD(fit)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = lum ~ cells * treatment)
$`cells:treatment`
diff lwr upr p adj
NULL:a-KR:a -266.5833333 -337.887800 -195.2788663 0.0000000
WT:a-KR:a -196.3333333 -267.637800 -125.0288663 0.0000000
KR:ar-KR:a 83.4166667 12.112200 154.7211337 0.0053485
NULL:ar-KR:a -283.5000000 -354.804467 -212.1955330 0.0000000
WT:ar-KR:a -196.7500000 -268.054467 -125.4455330 0.0000000
KR:e-KR:a -219.0833333 -290.387800 -147.7788663 0.0000000
NULL:e-KR:a -185.0833333 -256.387800 -113.7788663 0.0000000
WT:e-KR:a -96.1666667 -167.471134 -24.8621996 0.0003216
Run Code Online (Sandbox Code Playgroud)