我想做一个SummarizedExperiment, 我在FeatureCount.txt
中有这种格式的计数表 SRR1554537 SRR1554538 SRR1554541 SRR1554535 SRR1554536 SRR1554539
1/2-SBSRNA4 39 66 72 23 16 7
A1BG 221 113 226 146 36 126
A1BG-AS1 393 296 527 276 39 258
A1CF 8 7 5 1 0 4
A2LD1 97 208 171 181 72 110
我有这种格式的表型数据:
SampleName RUN Age sex tissue disease
SRR1554537 R3452_DLPFC_polyA_RNAseq_total SRR1554537 -0.384 female DLPFC control
SRR1554538 R3462_DLPFC_polyA_RNAseq_total SRR1554538 -0.4027 female DLPFC control
SRR1554541 R3485_DLPFC_polyA_RNAseq_total SRR1554541 -0.3836 male DLPFC control
SRR1554535 R2869_DLPFC_polyA_RNAseq_total SRR1554535 41.58 male DLPFC control
SRR1554536 R3098_DLPFC_polyA_RNAseq_total SRR1554536 44.17 female DLPFC control
SRR1554539 R3467_DLPFC_polyA_RNAseq_total SRR1554539 36.5 female DLPFC control
这是我的代码:
count_feature <- as.matrix(read.table("featureCount.txt", header = TRUE, stringsAsFactors = FALSE))
phenoData <- read.csv("Pheno_Data.csv", header = TRUE)
col_data <- DataFrame(phenoData)
row_data <- relist(GRanges(), vector("list", length= nrow(count_feature)))
mcols(row_data) <- rownames(count_feature)
Brain_Es <- SummarizedExperiment( assays = list(feature_Count= feature_Count), rowRanges = row_data, colData = col_data)
rownames<-
中的错误(*tmp*
,值= c(&#34; X&#34;,&#34; SRR1554537&#34;,&#34; SRR1554538&#34;,: 无效的rownames长度
你能解释一下错误吗?
答案 0 :(得分:-1)
我不明白你要对row_data
做什么,但它显然无效。您已经拥有计数表中的基因名称。为什么不
Brain_Es <- SummarizedExperiment(assays = list(counts = count_feature), colData = col_data, rowData = rownames(count_feature));
请查看?SummarizedExperiment
以及“构建SummarizedExperiment”部分中给出的here示例。