如何解决如何在r中的TCGA数据上运行PCA?
我正在尝试使用TCGAvisualize_PCA在TCGA数据上运行PCA。这是我的代码:
# TCGAbiolinks Downloads
library(SummarizedExperiment)
library(TCGAbiolinks)
# GDCquery: searches the genomic data commons for the given project and category,filtering results as needed and returning an object with a summary table
query.gbmexp <- GDCquery(project = "TCGA-GBM",data.category = "Transcriptome Profiling",access = "open",legacy = FALSE,experimental.strategy = "RNA-Seq",workflow.type = "HTSeq - Counts")
# Downloading data
GDCdownload(query = query.gbmexp,method = "api")
# Bringing data into environment
data <- GDCprepare(query = query.gbmexp,save = TRUE,save.filename = "TCGA_GBM_GeneExpression.rda",summarizedExperiment = TRUE)
# data prep
GBMPrep <- TCGAanalyze_Preprocessing(data)
# normalization
normdata <- TCGAanalyze_Normalization(tabDF = GBMPrep,geneInfo,method = "geneInfoHT")
# filtering
GBMDataFilt <- TCGAanalyze_Filtering(tabDF = normdata,method = "varFilter")
# PCA
group1 <- TCGAquery_SampleTypes(colnames(GBMDataFilt),typesample = c("NT"))
group2 <- TCGAquery_SampleTypes(colnames(GBMDataFilt),typesample = c("TP"))
pca <- TCGAvisualize_PCA(GBMDataFilt,dataDEGsFiltLevel,ntopgenes = 200,group1,group2)
我的PCA代码返回此错误:
名称(sampleColors)
作为参考,这是TCGAvisualize_PCA帮助页面中列出的示例:
# normalization of genes
dataNorm <- TCGAbiolinks::TCGAanalyze_Normalization(tabDF = dataBRCA,geneInfo = geneInfo,method = "geneLength")
# quantile filter of genes
dataFilt <- TCGAanalyze_Filtering(tabDF = dataBRCA,method = "quantile",qnt.cut = 0.25)
# Principal Component Analysis plot for ntop selected DEGs
# selection of normal samples "NT"
group1 <- TCGAquery_SampleTypes(colnames(dataFilt),typesample = c("NT"))
# selection of normal samples "TP"
group2 <- TCGAquery_SampleTypes(colnames(dataFilt),typesample = c("TP"))
pca <- TCGAvisualize_PCA(dataFilt,group2)
我意识到我做了一些不同的事情,例如使用“ geneInfoHT”方法进行归一化和使用“ varFilter”方法进行数据过滤,那这可能是我的错误根源吗?
我非常感谢您的帮助!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。