2016-10-03 106 views
0

我想打一個SummarizedExperiment, 我有伯爵表在這個格式FeatureCount.txt錯誤而使得SummarizedExperiment

  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( 「X」, 「SRR1554537」, 「SRR1554538」: 無效rownames長度

你能解釋一下這個錯誤嗎?

+0

我注意到你正在使用Bioconductor的'SummarizedExperiment'軟件包。你能否注意你的問題中加載的軟件包? –

回答

-1

我不明白你想用row_data做什麼,但它顯然不起作用。您已經從計數表中獲得基因名稱。爲什麼不這樣做

Brain_Es <- SummarizedExperiment(assays = list(counts = count_feature), colData = col_data, rowData = rownames(count_feature)); 

看一看?SummarizedExperiment,並在給定的例子在部分here「構建SummarizedExperiment」。