library(tidyverse)
class1 <- tribble(
~'名次',~'姓名',
'第一名','张三',
'第二名','李四',
'第三名','王二',
)
class2 <- tribble(
~'名次',~'姓名',
'第一名','麻子',
'第二名','傻子',
'第四名','憨子',
)
inner_join(class1,class2,by='名次')
left_join(class1,class2,by='名次')
right_join(class1,class2,by='名次')
library(BiocManager)
setwd('TCGA-LUAD')
setwd('TCGAdata')
#BiocManager::install("BioinformaticsFMRP/TCGAbiolinksGUI.data")
#BiocManager::install("remotes")
#BiocManager::install("ExperimentHub")
BiocManager::install("BioinformaticsFMRP/TCGAbiolinks")
library(TCGAbiolinks)
cancer_type = "TCGA-LUAD"
expquery <- GDCquery(project = cancer_type,
data.category = "Transcriptome Profiling",
data.type = "Gene Expression Quantification",
workflow.type = "STAR - Counts")
GDCdownload(expquery,directory = "GDCdata")
expquery2 <-GDCprepare(expquery,directory = "GDCdata",summarizedExperiment = T)
save(expquery2,file = "luad.gdc_2022.rda")
setwd('TCGA-LUAD')
setwd("TCGAdata")
library(tidyverse)
load("luad.gdc_2022.rda")
load("gene_annotation_2022.rda")
table(gene_annotation_2022$type)
counts <- expquery2@assays@data@listData[["unstranded"]]
library(utils)
reforge <- "http://r-forge.r-project.org"
install.packages("estimate",repos = reforge,dependencies = TRUE)
library(estimate)
library(tidyverse)
library(BiocManager)
BiocManager::install('DESeq2')
library(DESeq2)
#创建数据
surv$group <- ifelse(surv$ImmuneScore > median(surv$ImmuneScore,"high","low"))
surv$group <- factor(surv$group,levels = c("high","low"))
condition = data.frame(sample = colnames(counts_01a),
group=factor(ifelse(estimate[x,]>med,"high","low")))
#差异分析代码
dds <- DESeqDataSetFromMatrix(
countData = counts_01a,
colData = conditions,
design = ~ group
)
###femxo###
#开始差异分析
dds <- DESeq(dds)
resultsNames(dds)
#提取结果
res <- results(dds)
save(res,file="")
BiocManager::install('clusterProfiler')
BiocManager::install('org.Hs.eg.db')
library(ggnewscale)
BiocManager::install('survival')
BiocManager::install('forestplot')
R语言生物医学常用操作
最新推荐文章于 2024-06-09 21:10:48 发布