• 单细胞流程 安装conda 下载基因组数据 然后走cellranger 流程得到10x数据


    Build Notes for Reference Packages -Software -Single Cell Gene Expression -Official 10x Genomics Supporticon-default.png?t=N7T8https://support.10xgenomics.com/single-cell-gene-expression/software/release-notes/buildBuild Notes for Reference Packages -Software -Single Cell Gene Expression -Official 10x Genomics SupportBuild Notes for Reference Packages -Software -Single Cell Gene Expression -Official 10x Genomics Support

    Build Notes for Reference Packages -Software -Single Cell Gene Expression -Official 10x Genomics Support

    • Mouse reference, mm10 (includes mouse V(D)J genes)

    1. wget ftp://ftp.ensembl.org/pub/release-93/fasta/mus_musculus/dna/Mus_musculus.GRCm38.dna.primary_assembly.fa.gz
    2. gunzip Mus_musculus.GRCm38.dna.primary_assembly.fa.gz
    3. wget ftp://ftp.ensembl.org/pub/release-93/gtf/mus_musculus/Mus_musculus.GRCm38.93.gtf.gz
    4. gunzip Mus_musculus.GRCm38.93.gtf.gz
    5. cellranger mkgtf Mus_musculus.GRCm38.93.gtf Mus_musculus.GRCm38.93.filtered.gtf \
    6. --attribute=gene_biotype:protein_coding \
    7. --attribute=gene_biotype:lincRNA \
    8. --attribute=gene_biotype:antisense \
    9. --attribute=gene_biotype:IG_LV_gene \
    10. --attribute=gene_biotype:IG_V_gene \
    11. --attribute=gene_biotype:IG_V_pseudogene \
    12. --attribute=gene_biotype:IG_D_gene \
    13. --attribute=gene_biotype:IG_J_gene \
    14. --attribute=gene_biotype:IG_J_pseudogene \
    15. --attribute=gene_biotype:IG_C_gene \
    16. --attribute=gene_biotype:IG_C_pseudogene \
    17. --attribute=gene_biotype:TR_V_gene \
    18. --attribute=gene_biotype:TR_V_pseudogene \
    19. --attribute=gene_biotype:TR_D_gene \
    20. --attribute=gene_biotype:TR_J_gene \
    21. --attribute=gene_biotype:TR_J_pseudogene \
    22. --attribute=gene_biotype:TR_C_gene
    23. cellranger mkref --genome=mm10 \
    24. --fasta=Mus_musculus.GRCm38.dna.primary_assembly.fa \
    25. --genes=Mus_musculus.GRCm38.93.filtered.gtf \
    26. --ref-version=3.0.0

    安装conda

    (823条消息) Ubuntu 安装 conda_YoungLeelight的博客-CSDN博客_ubuntu 安装conda

    https://zhuanlan.zhihu.com/p/459607806

    Ubuntu 20.04(服务器版)安装 Anaconda3 记录,主要参考了链接:CSDN_气泡水、

    下载 Anaconda
    进入 Ubuntu,自己新建下载路径,输入以下命令开始下载 注意版本和时间

    学校服务器中 anaconda安装位置 

    wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.11-Linux-x86_64.sh

    **

    2. 安装 Anaconda
    **
    3.

    bash Anaconda3-2021.11-Linux-x86_64.sh
    1
    回车后查看许可证,按 q 退出许可证,然后输入 yes 表示同意

    确认安装的路径,一般直接回车安装在默认的 /home/你的名字/anaconda3

    很快就安装完毕。输入 yes 来确认使用 conda init 来启动

    **

    3. 启动环境变量
    **

    如果现在输入 conda,会显示找不到命令

    需要启动已经修改环境变量,输入以下命令(以后都不用再 source 了,因为启动 Ubuntu 会自动 source)

    source ~/.bashrc
    这时候会发现出现了 (base)

    如果你查看 ~/.bashrc,可以看到已经添加了 conda 的路径

    升级 conda
    如果当前安装后,不是最新版本,可以通过以下命令升级

    conda update -n base -c defaults conda

    这样从 4.10.3 升级到了 4.11.0

    current version: 4.10.3
    latest version: 4.11.0

    创建虚拟环境
    输入以下命令创建名为 py39 的虚拟环境,python 版本为 3.9

    conda create -n py39 python=3.9
    1
    输入 y 并回车后,开始下载并创建

    进入虚拟环境
    输入以下命令进入我们创建的虚拟环境 py39
     

    1. source activate py39
    2. 可以看到前缀已经从 base 变成了 py39,你输入 python 后可以看到,python 版本为 3.9.7
    3. 你也可以将以下命令行添加到 ~/.bashrc 里面,这样以后只需要输入 py39 就直接进入了
    4. alias py39='source activate py39'
    5. 你也可以在 bashrc 最后一行添加以下命令,这样每次登陆服务器时,自动进入 py39
    6. py39
    7. 7. 添加 python 模块
    8. 可以通过以下命令添加 python module,首先一定要装的是 ipython
    9. conda install ipython
    10. 接着比如常用的 pandas、xgboost
    11. conda install pandas
    12. conda install xgboost
    13. 8. 其他 conda 命令
    14. #创建虚拟环境
    15. conda create -n your_env_name python=X.X(3.63.7等)
    16. #激活虚拟环境
    17. source activate your_env_name(虚拟环境名称)
    18. #退出虚拟环境
    19. source deactivate your_env_name(虚拟环境名称)
    20. #删除虚拟环境
    21. conda remove -n your_env_name(虚拟环境名称) --all
    22. #查看安装了哪些包
    23. conda list
    24. #安装包
    25. conda install package_name(包名)
    26. conda install scrapy==1.3 # 安装指定版本的包
    27. conda install -n 环境名 包名 # 在conda指定的某个环境中安装包
    28. #查看当前存在哪些虚拟环境
    29. conda env list
    30. #或
    31. conda info -e
    32. #或
    33. conda info --envs
    34. #检查更新当前conda
    35. conda update conda
    36. #更新anaconda
    37. conda update anaconda
    38. #更新所有库
    39. conda update --all
    40. #更新python
    41. conda update python

    创建cellranger环境

    cellranger更新到6.0啦(全新使用教程) - 简书 (jianshu.com)

    首先创建并激活一个小环境

    1. conda create -n cellranger
    2. conda activate cellranger

    下载cellranger并解压

    1.cellranger软件下载及安装

    网页简单注册后就可以获取wget下载地址

    Downloads -Software -Single Cell Gene Expression -Official 10x Genomics Support

    1. cd /opt
    2. wget -O cellranger-6.0.2.tar.gz "https://cf.10xgenomics.com/releases/cell-exp/cellranger-6.0.2.tar.gz?Expires=1624477084&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZi4xMHhnZW5vbWljcy5jb20vcmVsZWFzZXMvY2VsbC1leHAvY2VsbHJhbmdlci02LjAuMi50YXIuZ3oiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2MjQ0NzcwODR9fX1dfQ__&Signature=QCESOlCkbmpiDLNQEHVVCZWRUQlK01zJ28z34ezOgcb2dH7yyv0zZvWw816nE7jrOfiuiD2COZ6zf8kaL~7ndl9sfKQ~JLSWYbgZgUXb6fjehKNOJggzd32mS29lZ1cAFZBgwH~pmYEmFIIx1WIuyEKi6XZ4O6Yquc0~fUA80ZkdMoNrDGGXtgn7RgRoK4MWwGgQtsufw9J5wLXe5XQG70cmg14wd-ZGjrboK~LMBDSYfkZr2YG8Sl2ScJIbB9xKfszcyXlq65EQwFuwzmSAxvNh9uIr9YlfSeUM-uNqdc1hYkin4Q1-1nGEfAaudHgzddD45-KxBKfv0KaL-vcLBA__&Key-Pair-Id=APKAI7S6A5RYOXBWRPDA"
    3. tar -xzvf cellranger-6.0.2.tar.gz</pre>

    一般来说,软件以及配套的参考基因组都需要下载,下载速度就取决于你自己的网路情况啦,建议nohup到后台,等待即可。
    添加到环境变量,方便后续使用

    1. vim ~/.bashrc
    2. export PATH=/opt/cellranger-6.0.2:$PATH
    3. source ~/.bashrc

    2.下载参考基因组并解压

    1. wget https://cf.10xgenomics.com/supp/cell-exp/refdata-gex-GRCh38-2020-A.tar.gz
    2. tar -xzvf refdata-gex-GRCh38-2020-A.tar.gz</pre>

    3.准备数据

    既然你都要学cellranger了,大概率上你已经有了SRA或者fastq数据,有了服务器,linux知识也有所了解,关于数据的下载我就不赘述了。

    本次演示我们的数据来自2018年9月的NC文章Acquired cancer resistance to combination immunotherapy from transcriptional loss of class I HLA。为了展示方便,我们只使用其中一个SRR数据。

    Build Notes for Reference Packages -Software -Single Cell Gene Expression -Official 10x Genomics Support

    cellranger mkgtf Mus_musculus.GRCm38.93.gtf Mus_musculus.GRCm38.93.filtered.gtf \
                     --attribute=gene_biotype:protein_coding \
                     --attribute=gene_biotype:lincRNA \
                     --attribute=gene_biotype:antisense \
                     --attribute=gene_biotype:IG_LV_gene \
                     --attribute=gene_biotype:IG_V_gene \
                     --attribute=gene_biotype:IG_V_pseudogene \
                     --attribute=gene_biotype:IG_D_gene \
                     --attribute=gene_biotype:IG_J_gene \
                     --attribute=gene_biotype:IG_J_pseudogene \
                     --attribute=gene_biotype:IG_C_gene \
                     --attribute=gene_biotype:IG_C_pseudogene \
                     --attribute=gene_biotype:TR_V_gene \
                     --attribute=gene_biotype:TR_V_pseudogene \
                     --attribute=gene_biotype:TR_D_gene \
                     --attribute=gene_biotype:TR_J_gene \
                     --attribute=gene_biotype:TR_J_pseudogene \
                     --attribute=gene_biotype:TR_C_gene
    
    
    cellranger mkref --genome=mm10 \
                     --fasta=Mus_musculus.GRCm38.dna.primary_assembly.fa \
                     --genes=Mus_musculus.GRCm38.93.filtered.gtf \
                     --ref-version=3.0.0

  • 相关阅读:
    SQL注入
    网站搜索引擎优化SEO面试题库和答案(SEO 主管、网站管理员、网站优化师、数字营销专家等)
    Java / Android 多线程和 synchroized 锁
    含泪推荐5款WIN10装机必备的软件
    详解节流防抖
    transformer 最简单学习3, 训练文本数据输入的形式
    Tomcat介绍
    利用优化算法提高爬虫任务调度效率
    【软考 系统架构设计师】嵌入式系统③ 嵌入式系统软件
    Rt-Thread 定时器
  • 原文地址:https://blog.csdn.net/qq_52813185/article/details/127747959