BioinformaticsFMRP / TCGAbiolinks

TCGAbiolinks
http://bioconductor.org/packages/devel/bioc/vignettes/TCGAbiolinks/inst/doc/index.html
296 stars 112 forks source link

TCGAanalyze_Preprocessing error on MMRF-COMMPASS project #385

Open MarzyUnicz opened 4 years ago

MarzyUnicz commented 4 years ago

Dear Collegue, I wrote the follow code but I get this error from the TCGAanalyze_Preprocessing function: Error in $<-.data.frame(*tmp*, "Disease", value = character(0)) : replacement has 0 rows, data has 859

Could you suggest me any solution please? Thank you in advance

query.mm <- GDCquery(project = "MMRF-COMMPASS", data.category = "Transcriptome Profiling", data.type = "Gene Expression Quantification", workflow.type="HTSeq - FPKM")

GDCdownload(query.mm, method = "api", files.per.chunk = 100, directory = "GDCdata")

DataMM <- GDCprepare(query.mm, save = TRUE , save.filename = "MMCompass.rda" , directory = "GDCdata" , summarizedExperiment = TRUE , remove.files.prepared = FALSE)

DataMMatrix <- assay(DataMM,"HTSeq - FPKM") dataMMcomplete <- log2( MMMatrix[1:56488,1:859]+1)

clin.mm <- GDCquery_clinic("MMRF-COMMPASS", "clinical") names(clin.mm)[1] <- "bcr_patient_barcode" colnames(dataMMcomplete) <- substr(colnames(dataMMcomplete),1,9)

tabSurvKM <- TCGAanalyze_SurvivalKM(clin.mm, dataMMcomplete, Genelist = rownames(dataMMcomplete), Survresult = TRUE, p.cut = 0.2, ThreshTop = 0.67, ThreshDown = 0.33)

MMRFRnaseq_CorOutliers <- TCGAanalyze_Preprocessing(DataMM)

Error in $<-.data.frame(*tmp*, "Disease", value = character(0)) : replacement has 0 rows, data has 859

Odd-i commented 2 years ago

bro, I got the same error on TCGA-ACC project in Case study n.3

GerardoZA commented 1 year ago

I got the same error:

> pbdc.bm.prep <- GDCprepare(query.mm,
+                                 save = TRUE,
+                                 save.filename = "MMCompassFPKM.pbdc.bm.rda" ,
+                                 directory = "GDCdata" ,
+                                 summarizedExperiment = TRUE
+                                 )
|========================================================================================================================================|100%                      Completed after 49 s 
> 
> 
> pbdc.bm.prepro <- TCGAbiolinks::TCGAanalyze_Preprocessing(pbdc.bm.prep)
Error in `$<-.data.frame`(`*tmp*`, "Disease", value = character(0)) : 
  replacement has 0 rows, data has 764
> 

How did you guys fix it?

xaitorx commented 9 months ago

error is coming from this chunk of the TCGAanalyze_Preprocessing() function:

pmat_new$Disease <- as.character(colData(object)$definition)

several projects dont have "definition" field in clinical information:

names(data@colData@listData)

lets say you create that field and fill it with some other info and it should work

eg.

data@colData@listData$definition <- data@colData@listData$sample_type
dataPrep <- TCGAanalyze_Preprocessing(object = data)

where "data" is the RangedSummarizedExperiment object you get from GDCprepare()

manwarA commented 4 months ago

Thank you @xaitorx for the comment that led me to solve my problem as well.

Just a background: I created the RangedSummarizedExperiment from scratch to add new data from GTEx (normal data), and I stuck at this point. I have to create GRange object as well, to recreate RSExperiment. However, I still faced "Error in$<-.data.frame(tmp, "Disease", value = c("Ovarian_Tumor", : replacement has 601 rows, data has 2" issue that was partly due to lack of definition and (in my case barcode as well). I had added definition and then barcode columns in the data (specifcally colData argument of SummarizedExperiment function) to make it work.

The hint came from your helpful comment; and thats the reason I am writing this.