DESeqDataSet(se, design = design, ignoreRank) 中的错误:计数矩阵应该是数字,当前它具有模式:逻辑
Error in DESeqDataSet(se, design = design, ignoreRank) : counts matrix should be numeric, currently it has mode: logical
我正在 运行 对数据集进行 RNA Seq 分析,并且在使用 DESeqDataSetFromMatrix 时不断收到此错误。 df是计数数据,coldata是coldata。
Error in DESeqDataSet(se, design = design, ignoreRank) :
counts matrix should be numeric, currently it has mode: logical
Here is the code being used:
df <- "C:\Users\reach\OneDrive\Desktop\REU Summer 2021\Autotaxin Cancer\mRNA_counts_and_annotation\mRNA_counts.csv"
df <- read.csv(df)
coldata <- "C:\Users\reach\OneDrive\Desktop\REU Summer 2021\Autotaxin Cancer\mRNA_counts_and_annotation\coldata.txt"
coldata <- read.csv(coldata)
coldata <- coldata %>%
dplyr:: filter("condition" == "Tumor"| "condition" == "Normal" | "condition" == "At_risk")
coldata %>% select(condition)
colnames(df) <- stringr::str_replace_all(string = colnames(df),pattern = "-", replacement = "_")
geneID <- rownames(df)
df <- df%>%
dplyr::select(rownames(coldata))
coldata$condition <- as.factor(coldata$condition)
df <- df[,rownames(coldata)]
all(rownames(coldata) %in% colnames(df))
all(rownames(coldata) == colnames(df))
ddsall <- DESeq2::DESeqDataSetFromMatrix(countData = df,
colData = coldata,
design = ~ condition)
关于如何改进此代码以使 DESEQ2 运行无误的任何建议?
我不确定您使用的是哪个版本的 R,但您可以做的几件事是:
- 在上传带有计数的数据框时指示分隔符 (
sep=","
)
- 您还可以使用
data.matrix()
将数据框转换为数字矩阵
- 彻底检查 DESeq2 插图。
browseVignettes("DESeq2")
我正在 运行 对数据集进行 RNA Seq 分析,并且在使用 DESeqDataSetFromMatrix 时不断收到此错误。 df是计数数据,coldata是coldata。
Error in DESeqDataSet(se, design = design, ignoreRank) : counts matrix should be numeric, currently it has mode: logical Here is the code being used:
df <- "C:\Users\reach\OneDrive\Desktop\REU Summer 2021\Autotaxin Cancer\mRNA_counts_and_annotation\mRNA_counts.csv"
df <- read.csv(df)
coldata <- "C:\Users\reach\OneDrive\Desktop\REU Summer 2021\Autotaxin Cancer\mRNA_counts_and_annotation\coldata.txt"
coldata <- read.csv(coldata)
coldata <- coldata %>%
dplyr:: filter("condition" == "Tumor"| "condition" == "Normal" | "condition" == "At_risk")
coldata %>% select(condition)
colnames(df) <- stringr::str_replace_all(string = colnames(df),pattern = "-", replacement = "_")
geneID <- rownames(df)
df <- df%>%
dplyr::select(rownames(coldata))
coldata$condition <- as.factor(coldata$condition)
df <- df[,rownames(coldata)]
all(rownames(coldata) %in% colnames(df))
all(rownames(coldata) == colnames(df))
ddsall <- DESeq2::DESeqDataSetFromMatrix(countData = df,
colData = coldata,
design = ~ condition)
关于如何改进此代码以使 DESEQ2 运行无误的任何建议?
我不确定您使用的是哪个版本的 R,但您可以做的几件事是:
- 在上传带有计数的数据框时指示分隔符 (
sep=","
) - 您还可以使用
data.matrix()
将数据框转换为数字矩阵
- 彻底检查 DESeq2 插图。
browseVignettes("DESeq2")