This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error in summarizing data with summarizedExperiment due to differece in data sizes
#––––––––––––––––––––––––––––
# Obtaining DNA methylation
#––––––––––––––––––––––––––––
library(TCGAbiolinks)
library(stringr)
# Samples

matched_met_exp <- function(project, n = NULL){
  message("Download DNA methylation information")
  met450k <- GDCquery(project = project,
                      data.category = "DNA methylation",
                      platform = "Illumina Human Methylation 450",
                      legacy = TRUE,
                      sample.type = c("Primary Tumor"))
  met450k.tp <- met450k$results[[1]]$cases

  # get primary solid tumor samples: RNAseq
  message("Download gene expression information")
  exp <- GDCquery(project = project,
                  data.category = "Gene expression",
                  data.type = "Gene expression quantification",
                  platform = "Illumina HiSeq",
                  file.type = "results",
                  sample.type = c("Primary Tumor"),
                  legacy = TRUE)
  exp.tp <- exp$results[[1]]$cases
  print(exp.tp[1:10])
  # Get patients with samples in both platforms
  patients <- unique(substr(exp.tp,1,15)[substr(exp.tp,1,12) %in% substr(met450k.tp,1,12)])
  if(!is.null(n)) patients <- patients[1:n] # get only n samples
  return(patients)
}

luad_samples <- matched_met_exp("TCGA-LUAD", n = 10)
lusc_samples <- matched_met_exp("TCGA-LUSC", n = 10)
#–––––––––––––––––––––––––––––––––––
# 1 – Methylation
# ––––––––––––––––––––––––––––––––––
# For methylation it is quicker in this case to download the tar.gz file
# and get the samples we want instead of downloading files by files

#LUAD
query_meth_luad <- GDCquery(project = "TCGA-LUAD",
                            data.category = "DNA methylation",
                            platform = "Illumina Human Methylation 450",
                            legacy = T,
                            barcode = luad_samples )
GDCdownload(query = query_meth_luad,
            method = 'client')

tcga_meth_luad <- GDCprepare(query_meth_luad, save = F)


#LUSC
query_meth_lusc <- GDCquery(project = "TCGA-LUSC",
                            data.category = "DNA methylation",
                            platform = "Illumina Human Methylation 450",
                            legacy = T,
                            barcode = lusc_samples )
GDCdownload(query = query_meth_lusc,
            method = 'client')

tcga_meth_lusc <- GDCprepare(query_meth_lusc, save = F)

summary_meth_luad <- SummarizedExperiment::cbind(tcga_meth_luad, tcga_meth_lusc)

I have run this code, and everything was fine until the last line of the code: summarizedExperiment::cbind

Here the following arguments are appeared:

> summary_meth_luad <- SummarizedExperiment::cbind(tcga_meth_luad, tcga_meth_lusc)
Error in .aggregate_and_align_all_colnames(all_colnames, strict.colnames = strict.colnames) : 
  the DFrame objects to combine must have the same column names

How can I solve this problem? Please, anyone help me!

tcgabiolinks summarizedexperiment

What is the output of colnames(colData(tcga_meth_luad)); colnames(colData(tcga_meth_lusc))?

colnames(colData(tcga_meth_luad)) [1] "barcode" "patient"
[3] "sample" "shortLetterCode"
[5] "definition" "sample_submitter_id"
[7] "sample_type_id" "oct_embedded"
[9] "sample_id" "submitter_id"
[11] "state" "is_ffpe"
[13] "sample_type" "tissue_type"
[15] "days_to_collection" "initial_weight"
[17] "intermediate_dimension" "pathology_report_uuid"
[19] "shortest_dimension" "longest_dimension"
[21] "synchronous_malignancy" "ajcc_pathologic_stage"
[23] "days_to_diagnosis" "treatments"
[25] "last_known_disease_status" "tissue_or_organ_of_origin"
[27] "days_to_last_follow_up" "age_at_diagnosis"
[29] "primary_diagnosis" "prior_malignancy"
[31] "year_of_diagnosis" "prior_treatment"
[33] "ajcc_staging_system_edition" "ajcc_pathologic_t"
[35] "morphology" "ajcc_pathologic_n"
[37] "ajcc_pathologic_m" "classification_of_tumor"
[39] "diagnosis_id" "icd_10_code"
[41] "site_of_resection_or_biopsy" "tumor_grade"
[43] "progression_or_recurrence" "cigarettes_per_day"
[45] "alcohol_history" "exposure_id"
[47] "years_smoked" "pack_years_smoked"
[49] "race" "gender"
[51] "ethnicity" "vital_status"
[53] "age_at_index" "days_to_birth"
[55] "year_of_birth" "demographic_id"
[57] "year_of_death" "days_to_death"
[59] "bcr_patient_barcode" "primary_site"
[61] "project_id" "disease_type"
[63] "name" "releasable"
[65] "released" "paper_patient"
[67] "paper_Sex" "paper_Age.at.diagnosis"
[69] "paper_T.stage" "paper_N.stage"
[71] "paper_Tumor.stage" "paper_Smoking.Status"
[73] "paper_Survival" "paper_Transversion.High.Low"
[75] "paper_Nonsilent.Mutations" "paper_Nonsilent.Mutations.per.Mb"
[77] "paper_Oncogene.Negative.or.Positive.Groups" "paper_Fusions"
[79] "paper_expression_subtype" "paper_chromosome.affected.by.chromothripsis"
[81] "paper_iCluster.Group" "paper_CIMP.methylation.signature."
[83] "paper_MTOR.mechanism.of.mTOR.pathway.activation" "paper_Ploidy.ABSOLUTE.calls"
[85] "paper_Purity.ABSOLUTE.calls"

colnames(colData(tcga_meth_lusc)) [1] "barcode" "patient" "sample"
[4] "shortLetterCode" "definition" "sample_submitter_id"
[7] "sample_type_id" "sample_id" "sample_type"
[10] "days_to_collection" "state" "initial_weight"
[13] "intermediate_dimension" "pathology_report_uuid" "submitter_id"
[16] "shortest_dimension" "oct_embedded" "longest_dimension"
[19] "is_ffpe" "tissue_type" "synchronous_malignancy"
[22] "ajcc_pathologic_stage" "days_to_diagnosis" "treatments"
[25] "last_known_disease_status" "tissue_or_organ_of_origin" "days_to_last_follow_up"
[28] "age_at_diagnosis" "primary_diagnosis" "prior_malignancy"
[31] "year_of_diagnosis" "prior_treatment" "ajcc_staging_system_edition"
[34] "ajcc_pathologic_t" "morphology" "ajcc_pathologic_n"
[37] "ajcc_pathologic_m" "classification_of_tumor" "diagnosis_id"
[40] "icd_10_code" "site_of_resection_or_biopsy" "tumor_grade"
[43] "progression_or_recurrence" "cigarettes_per_day" "alcohol_history"
[46] "exposure_id" "years_smoked" "pack_years_smoked"
[49] "race" "gender" "ethnicity"
[52] "vital_status" "age_at_index" "days_to_birth"
[55] "year_of_birth" "demographic_id" "year_of_death"
[58] "days_to_death" "bcr_patient_barcode" "primary_site"
[61] "project_id" "disease_type" "name"
[64] "releasable" "released" "paper_patient"
[67] "paper_Sex" "paper_Age.at.diagnosis" "paper_T.stage"
[70] "paper_N.stage" "paper_M.stage" "paper_Smoking.Status"
[73] "paper_Pack.years" "paper_Nonsilent.Mutatios" "paper_Nonsilent.Mutatios.per.Mb" [76] "paper_Selected.Mutation.Summary" "paper_High.Level.Amplifications" "paper_Homozygous.Deletions"
[79] "paper_Expression.Subtype"

I think the column numbers are not equal in the samples which may cause the problem. IF it is, then how can I solve the problem?

0 answers

No answers yet.

Log in to answer this question.