首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏若尘的技术专栏

    setwd详解

    #将分组文件加载到环境中,分组信息第一列为样本名,第二列为分组信息如“high”“low”

    1.3K65编辑于 2021-12-06
  • 来自专栏生信技能树

    转录组和单细胞下游基于R的数据分析-01

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('.. /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.2') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() last_markers_to_check 那就直接选择0.2进行后续的命名吧! /scRNA_scripts/check-all-markers.R') setwd('../') getwd() } phe=sce.all.int@meta.data save(phe,

    54311编辑于 2024-03-25
  • 来自专栏生信技能树

    脑脊液单细胞转录组数据处理

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('.. /scRNA_scripts/qc.R') sce.all.filt = basic_qc(sce.all) print(dim(sce.all)) print(dim(sce.all.filt)) setwd sce.all.int$RNA_snn_res.0.1) table(sce.all.int$RNA_snn_res.0.8) getwd() dir.create('check-by-0.1') setwd /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() 然后就是合理的生物学命名了 我给大家准备的基因列表主要是针对肿瘤单细胞的第一层次降维聚类分群

    63530编辑于 2023-02-27
  • 来自专栏生信小驿站

    单基因生信分析流程(6)单基因相似性分析

    TCGAbiolinks) library(dplyr) library(tidyr) library(tibble) library(edgeR) library(limma) rm(list=ls()) setwd ################################################################################# rm(list=ls()) setwd # ########################################################################################### setwd index,] row.names(mRNA_exprSet) <- mRNA_exprSet$gene_name mRNA_exprSet$gene_name <- NULL setwd('D:\ Barcode == 'T') mRNA_exprSet <- mRNA_exprSet[,which(colnames(mRNA_exprSet) %in% metadata$barcode)] setwd

    1.2K21发布于 2020-08-13
  • 来自专栏生信菜鸟团

    百万细胞舍我其谁(一晚上解决战斗)

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('.. /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.5') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() last_markers_to_check Sys.time() ###### /scRNA_scripts/check-all-markers.R') setwd('../') getwd() phe=sce.all.int@meta.data save(phe

    37310编辑于 2024-12-30
  • 来自专栏生信技能树

    脓毒症小鼠模型单细胞(中性粒细胞这么就丢了呢)

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('.. /scRNA_scripts/qc.R') sce.all.filt = basic_qc(sce.all) print(dim(sce.all)) print(dim(sce.all.filt)) setwd sce.all.int$RNA_snn_res.0.1) table(sce.all.int$RNA_snn_res.0.8) getwd() dir.create('check-by-0.1') setwd /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() 然后就是合理的生物学命名了 前面强调了研究团队做单细胞转录组的时候,筛选了免疫细胞

    67310编辑于 2023-02-27
  • 来自专栏生信技能树

    每个单细胞亚群取子集后继续降维聚类分群标准操作(以b细胞为例)

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('../../.. /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.5') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() 可以看到,这个时候取了子集后的单细胞转录组数据对象,仍然是进行了harmony整合哦 /com_go_kegg_ReactomePA_mice.R') com_go_kegg_ReactomePA_human(symbols_list, pro='b' ) setwd('../')

    1.3K10编辑于 2024-11-21
  • 来自专栏生信小驿站

    R语言循环绘制柱状图

    ============= # # # # =================================================== rm(list=ls()) setwd <- merge( metadata, dt, by='id') 第二步: 循环绘图 # =================================================== setwd ============================ library(dplyr) library(tidyr) library(tidyverse) rm(list=ls()) setwd Barcode', "Grade") dt <- merge(sur, dt, by='Barcode') dt$Grade <- as.factor(as.character(dt$Grade)) setwd

    1.9K10发布于 2020-12-01
  • 来自专栏生信菜鸟团

    BD单细胞测序数据分析流程(全)

    BD单个样本 1 在r中读取并理解数据 # 导入必要的包 library(data.table) dir.create("~/gzh/20240405_gse201088_pbmc_covid/") setwd qc.R') sce.all.filt = basic_qc(sce.all) print(dim(sce.all)) print(dim(sce.all.filt)) print(getwd()) setwd 来去除批次效应---- sce.all.filt head(sce.all.filt@meta.data) if(T){ dir.create("2-harmony") getwd() setwd ('../') getwd() #####整合完成之后,查看0.5分辨率------ dir.create('check-by-0.5') setwd('check-by-0.5') sel.clust ('../') getwd() #####整合完成之后,查看0.8分辨率------ dir.create('check-by-0.8') setwd('check-by-0.8') sel.clust

    4.2K12编辑于 2024-04-11
  • 来自专栏生信技能树

    白癜风单细胞转录组数据处理

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('.. /scRNA_scripts/qc.R') sce.all.filt = basic_qc(sce.all) print(dim(sce.all)) print(dim(sce.all.filt)) setwd ('../') ###### step3: harmony整合多个单细胞样品 ###### dir.create("2-harmony") getwd() setwd("2-harmony") source sce.all.int$RNA_snn_res.0.1) table(sce.all.int$RNA_snn_res.0.8) getwd() dir.create('check-by-0.1') setwd /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by

    63610编辑于 2023-02-27
  • 来自专栏生信菜鸟团

    用V5版本Seurat做单细胞数据文献复现

    /scRNA_scripts/qc.R') sce.all.filt = basic_qc(sce.all) print(dim(sce.all)) print(dim(sce.all.filt)) setwd /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() last_markers_to_check step5: 确定单细胞亚群生物学名字 .0.1.pdf') gplots::balloonplot(table(sce.all.int$RNA_snn_res.0.1,sce.all.int$orig.ident)) dev.off() setwd /scRNA_scripts/check-all-markers.R') setwd('../') getwd() } image.png step6:热图可视化 getwd() #step6

    4.2K11编辑于 2024-01-19
  • 来自专栏生信技能树

    区区20万个单细胞居然超内存了

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('.. /scRNA_scripts/qc.R') sce.all.filt = basic_qc(sce.all) print(dim(sce.all)) print(dim(sce.all.filt)) setwd sce.all.int$RNA_snn_res.0.1) table(sce.all.int$RNA_snn_res.0.8) getwd() dir.create('check-by-0.1') setwd /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() 然后就是合理的生物学命名了 我给大家准备的基因列表主要是针对肿瘤单细胞的第一层次降维聚类分群

    2.8K20编辑于 2023-02-27
  • 岩酱的生信学习笔记Day4 (R语言及Rstudio)

    R笔记基本操作 getwd() 得出文件路径 setwd() setwd(dir= "/Users/PhD/Rdata/") 设定文件路径 list.files() dir() 得出文件夹全部文件 x

    17410编辑于 2024-04-16
  • 来自专栏单细胞天地

    学徒作业|GSE217845-胰腺癌中的巨噬细胞细分亚群

    ./1-QC.loose") setwd("./1-QC.loose") # 如果过滤的太狠,就需要去修改这个过滤代码 source('.. ###### step3: harmony整合多个单细胞样品 ###### if(T){ dir.create("2-harmony.loose") getwd() setwd /scRNA_scripts/check-all-markers.R') setwd('../') getwd() } #### strict version: { sce.all.filt /scRNA_scripts/check-all-markers.R') setwd('../') getwd() 提取髓系细胞亚群重新进行标准化以及降维聚类分群 在0.1的分辨率下,也提取了髓系免疫细胞 /scRNA_scripts/check-paper-myeloid-markers.R') setwd('../') getwd() phe=sce_myeloid@meta.data

    74310编辑于 2024-04-15
  • 来自专栏生信技能树

    scanpy和Seurat单细胞分析对比

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('.. ('../') sp='human' ###### step3: harmony整合多个单细胞样品 ###### dir.create("2-harmony") getwd() setwd("2- /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.5') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() last_markers_to_check scanpy版本的python代码

    2.4K70编辑于 2023-11-16
  • 来自专栏生信小驿站

    三阴性乳腺癌提取和分析

    TCGAbiolinks) library(dplyr) library(tidyr) library(tibble) library(edgeR) library(limma) rm(list=ls()) setwd # ########################################################################################### setwd index,] row.names(mRNA_exprSet) <- mRNA_exprSet$gene_name mRNA_exprSet$gene_name <- NULL setwd('D:\ TCGAbiolinks) library(dplyr) library(tidyr) library(tibble) library(edgeR) library(limma) rm(list=ls()) setwd ################################# options(stringsAsFactors = F) library(stringr) rm(list=ls()) setwd

    1.1K10发布于 2020-08-13
  • 来自专栏生信技能树

    上皮细胞里面混入了淋巴系和髓系免疫细胞呢

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('../../.. /scRNA_scripts/qc.R') sce.all.filt = basic_qc(sce.all) print(dim(sce.all)) print(dim(sce.all.filt)) setwd ../') getwd() ###### step3: harmony整合多个单细胞样品 ###### if(T){ dir.create("2-harmony") getwd() setwd # 默认 ScaleData 没有添加"nCount_RNA", "nFeature_RNA" # 默认的 sce.all.int = run_harmony(sce.all.filt) setwd /scRNA_scripts/check-all-markers.R') setwd('../') getwd() 这个时候很明显的可以看到上皮细胞的降维聚类分群居然是出现了淋巴系和髓系免疫细胞的干扰哦

    22800编辑于 2024-11-21
  • 来自专栏北野茶缸子的专栏

    52-R茶话会-十二:为什么我不建议你使用 rm(list=ls())

    其他使用者会报错; 如果在脚本开发过程中进行了其他配置,如stringsAsFactors = FALSE,而未在脚本中声明,则其他使用者也会报错; 可能外部读取使用了相对路径,而在命令行中直接修改了路径setwd (这也是不建议使用setwd 的原因) 一些改善的策略: 用R studio 等可以通过project 为单位管理脚本的开发工具,可以很方便的每次在Rproj 文件所在的位置即设定为工作目录,而且可以非常方便的切换到其他的项目 ; 避免在脚本中使用rm(list=ls())、setwd(),可以使用rs.restartR() 替代rm(list=ls()); 将重要的对象导出到output 文件夹内,保存为.Rdata,其他脚本中如果需要使用可以直接读取

    2.2K20编辑于 2021-12-17
  • 来自专栏生信技能树

    免疫性血小板低下症患者的单细胞层面变化

    ./1-QC") setwd("./1-QC") # 如果过滤的太狠,就需要去修改这个过滤代码 source('.. /scRNA_scripts/qc.R') sce.all.filt = basic_qc(sce.all) print(dim(sce.all)) print(dim(sce.all.filt)) setwd sce.all.int$RNA_snn_res.0.1) table(sce.all.int$RNA_snn_res.0.8) getwd() dir.create('check-by-0.1') setwd /scRNA_scripts/check-all-markers.R') setwd('../') getwd() dir.create('check-by-0.8') setwd('check-by /scRNA_scripts/check-all-markers.R') setwd('../') getwd() 然后就是合理的生物学命名了 前面强调了研究团队做单细胞转录组的时候,筛选了免疫细胞

    66710编辑于 2023-02-27
  • 来自专栏生信小驿站

    多分组差异分析解决方案(1)循环T检验

    ============== rm(list = ls(all.names = TRUE)) options(stringsAsFactors = F) library(Matrix) setwd ', new='-', x=data$sample) setwd('D:\\SCIwork\\F38KRT\\s3') group <- read.csv('group2.csv', header )) out$gene <- rownames(dt_Con) # out <- out %>% # dplyr::filter(log2_FC > 0.5 & Pvalue < 0.05) setwd log2FC,p value和FDR,共3列; out<- as.data.frame(cbind(log2_FC,Pvalue,fdr)) out$gene <- rownames(dt_Con) setwd log2FC,p value和FDR,共3列; out<- as.data.frame(cbind(log2_FC,Pvalue,fdr)) out$gene <- rownames(dt_Con) setwd

    1.4K60发布于 2021-06-10
领券