123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847 |
- <!DOCTYPE html>
- <html lang="en" data-default-color-scheme=auto>
- <head><!-- hexo injector head_begin start -->
- <script defer src="https://api.limour.top/vue/0d2f95c1-755d-436b-adf8-eee12a80ed32/script.js"></script>
- <!-- hexo injector head_begin end -->
- <meta charset="UTF-8">
- <link rel="apple-touch-icon" sizes="76x76" href="https://img.limour.top/2023/08/29/64ee07361815a.webp">
- <link rel="icon" href="https://img.limour.top/2023/08/29/64ee07361815a.webp">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
-
- <meta name="theme-color" content="#2f4154">
- <meta name="author" content="Limour">
- <meta name="keywords" content="">
-
- <meta name="description" content="配置环境 基础编程环境 GitHub 下载加速 可能需要用到的加速服务 SRA工具 1234567conda create -n sra_tools -c bioconda sra-toolsconda activate sra_toolsconda install -c conda-forge lftp -yconda install -c conda-forge pigz -y # 或许">
-
-
-
- <title>【学习】使用GATK4.0找SNP - Limour's Blog</title>
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" />
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/github-markdown-css@4.0.0/github-markdown.min.css" />
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/hint.css@2.7.0/hint.min.css" />
- <!-- 主题依赖的图标库,不要自行修改 -->
- <!-- Do not modify the link that theme dependent icons -->
- <link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">
- <link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">
- <link rel="stylesheet" href="/css/main.css" />
- <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
-
- <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
-
-
- <link rel="stylesheet" href="/theme-inject/custom.css">
- <link rel="stylesheet" href="/theme-inject/iconfont.css">
- <script id="fluid-configs">
- var Fluid = window.Fluid || {};
- Fluid.ctx = Object.assign({}, Fluid.ctx)
- var CONFIG = {"hostname":"hexo.limour.top","root":"/","version":"1.9.7","typing":{"enable":false,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":"§"},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":false,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":{"measurement_id":null},"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml","include_content_in_search":true};
- if (CONFIG.web_analytics.follow_dnt) {
- var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
- Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
- }
- </script>
- <script src="/js/utils.js" ></script>
- <script src="/js/color-schema.js" ></script>
-
-
- <link rel="canonical" href="https://hexo.limour.top/shi-yong-GATK-zhao-SNP"/>
- <meta name="generator" content="Hexo 7.1.1"><link rel="alternate" href="/atom.xml" title="Limour's Blog" type="application/atom+xml">
- <link rel="alternate" href="/rss2.xml" title="Limour's Blog" type="application/rss+xml">
- </head>
- <body>
-
- <header>
-
- <div class="header-inner" style="height: 70vh;">
- <nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
- <div class="container">
- <a class="navbar-brand" href="/">
- <strong>Limour's Blog</strong>
- </a>
- <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
- data-target="#navbarSupportedContent"
- aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
- <div class="animated-icon"><span></span><span></span><span></span></div>
- </button>
- <!-- Collapsible content -->
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
- <ul class="navbar-nav ml-auto text-center">
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://hexo.limour.top/" target="_self">
- <i class="iconfont icon-home-fill"></i>
- <span>Home</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="/archives/" target="_self">
- <i class="iconfont icon-archive-fill"></i>
- <span>Archive1</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://occdn.limour.top/archives/" target="_self">
- <i class="iconfont icon-archive-fill"></i>
- <span>Archive2</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://b.limour.top/archives/" target="_self">
- <i class="iconfont icon-archive-fill"></i>
- <span>Archive3</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://od.limour.top/" target="_self">
- <i class="iconfont icon-onedrive"></i>
- <span>Alist</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="https://orcid.org/0000-0001-8897-1685" target="_self">
- <i class="iconfont icon-orcid"></i>
- <span>Orcid</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="/links/" target="_self">
- <i class="iconfont icon-link-fill"></i>
- <span>Links</span>
- </a>
- </li>
-
-
-
-
-
-
- <li class="nav-item">
- <a class="nav-link" href="/atom.xml" target="_self">
- <i class="iconfont icon-rss"></i>
- <span>RSS</span>
- </a>
- </li>
-
-
-
- <li class="nav-item" id="search-btn">
- <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
- <i class="iconfont icon-search"></i>
- </a>
- </li>
-
-
-
- <li class="nav-item" id="color-toggle-btn">
- <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
- <i class="iconfont icon-dark" id="color-toggle-icon"></i>
- </a>
- </li>
-
- </ul>
- </div>
- </div>
- </nav>
-
- <div id="banner" class="banner" parallax=true
- style="background: url('https://img.limour.top/2023/08/29/64ee08e108638.webp') no-repeat center center; background-size: cover;">
- <div class="full-bg-img">
- <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
- <div class="banner-text text-center fade-in-up">
- <div class="h2">
-
- <span id="subtitle">【学习】使用GATK4.0找SNP</span>
-
- </div>
-
-
- <div class="mt-3">
-
- <span class="post-meta mr-2">
- <i class="iconfont icon-author" aria-hidden="true"></i>
- Limour
- </span>
-
-
- <span class="post-meta">
- <i class="iconfont icon-date-fill" aria-hidden="true"></i>
- <time datetime="2023-09-24 18:49" pubdate>
- September 24, 2023 pm
- </time>
- </span>
-
- </div>
- <div class="mt-1">
-
- <span class="post-meta mr-2">
- <i class="iconfont icon-chart"></i>
-
- 3.5k words
-
- </span>
-
-
- <span class="post-meta mr-2">
- <i class="iconfont icon-clock-fill"></i>
-
-
-
- 30 mins
-
- </span>
-
-
-
- </div>
-
- </div>
-
- </div>
- </div>
- </div>
- </div>
- </header>
- <main>
-
-
- <div class="container-fluid nopadding-x">
- <div class="row nomargin-x">
- <div class="side-col d-none d-lg-block col-lg-2">
-
- </div>
- <div class="col-lg-8 nopadding-x-md">
- <div class="container nopadding-x-md" id="board-ctn">
- <div id="board">
- <article class="post-content mx-auto">
- <h1 id="seo-header">【学习】使用GATK4.0找SNP</h1>
-
- <p id="updated-time" class="note note-info" style="">
-
-
- Last updated on March 19, 2024 pm
-
-
- </p>
-
-
- <div class="markdown-body">
-
- <p><img src="https://img.limour.top/2023/09/26/651299352bcf0.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt=""></p>
- <h2 id="配置环境">配置环境</h2>
- <ul>
- <li><a href="/-ji-lu--an-zhuang-sheng-xin-de-dai-ma-bian-xie-huan-jing">基础编程环境</a></li>
- <li><a href="/-fu-ke-GitHub-wen-jian-jia-su">GitHub 下载加速</a></li>
- <li><a href="/-ji-lu-SOCKS5-zhuan-QUIC">可能需要用到的加速服务</a></li>
- </ul>
- <h3 id="SRA工具">SRA工具</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">conda create -n sra_tools -c bioconda sra-tools</span><br><span class="line">conda activate sra_tools</span><br><span class="line">conda install -c conda-forge lftp -y</span><br><span class="line">conda install -c conda-forge pigz -y <span class="comment"># 或许换成 pbgzip 更好,此时将 -p 换成 -n 来指定线程数</span></span><br><span class="line">conda install -c bioconda pbgzip -y</span><br><span class="line">prefetch</span><br><span class="line"><span class="comment"># vdb-config -i # 设置 HTTP 代理</span></span><br></pre></td></tr></table></figure>
- <h3 id="GATK4">GATK4</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">conda create -n GATK4 -c bioconda gatk4</span><br><span class="line">conda activate GATK4</span><br><span class="line">conda install -c bioconda samtools -y</span><br><span class="line">conda install -c bioconda bwa -y</span><br><span class="line">conda install -c bioconda pbgzip -y <span class="comment"># 并行版bgzip,bgzip是修改过的gzip,更适合生信领域</span></span><br><span class="line">conda install -c bioconda tabix -y <span class="comment"># 操作VCF文件,与bgzip配套</span></span><br><span class="line"><span class="comment"># conda install -c bioconda fastqc -y # 改用fastp了</span></span><br><span class="line"><span class="comment"># conda install -c bioconda trimmomatic -y # 改用fastp了</span></span><br><span class="line">conda install -c bioconda fastp -y</span><br><span class="line"><span class="comment"># conda install -c bioconda bcftools -y # 用于重命名染色体</span></span><br><span class="line"><span class="comment"># ln -s $CONDA_PREFIX/lib/libgsl.so $CONDA_PREFIX/lib/libgsl.so.25 # 无效,放弃</span></span><br><span class="line"><span class="comment"># conda create -n GATK4-VEP -c bioconda ensembl-vep -y # 根正苗红的突变注释软件,不懂有什么奇怪依赖,解析环境半天</span></span><br></pre></td></tr></table></figure>
- <ul>
- <li>BWA是DNA比对工具(不会跨外显子比对),<a href="/STAR--yi-jian-jiao-ben">STAR</a>是RNA比对工具</li>
- <li><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/37345954">找SNP不推荐用RNAseq的数据</a></li>
- <li><a target="_blank" rel="noopener" href="https://www.jianshu.com/p/601469194b5e">各种比对工具的说明</a></li>
- </ul>
- <h2 id="准备数据">准备数据</h2>
- <h3 id="参考数据">参考数据</h3>
- <ul>
- <li><a target="_blank" rel="noopener" href="https://www.ncbi.nlm.nih.gov/genome/browse">NCBI上各物种的参考序列</a>,可以找到RefSeq,比如Human是GCF_000001405</li>
- <li>知道序号后可以到<a target="_blank" rel="noopener" href="https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/">FTP</a>上下载相应的<code>genomic.fna.gz</code>文件</li>
- <li>比如GCF_000001405,依次进入<code>000/001/405</code>即可找到对应的文件</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/405/GCF_000001405.40_GRCh38.p14/GCF_000001405.40_GRCh38.p14_genomic.fna.gz -O GRCh38.p14.fna.gz</span><br><span class="line">conda run -n sra_tools pigz -d GRCh38.p14.fna.gz <span class="comment"># 得到 GRCh38.p14.fna</span></span><br><span class="line"><span class="comment"># 创建索引</span></span><br><span class="line">samtools faidx GRCh38.p14.fna <span class="comment"># 得到 GRCh38.p14.fna.fai</span></span><br><span class="line"><span class="comment"># 查看一段序列</span></span><br><span class="line">samtools faidx GRCh38.p14.fna NC_000001.11:1000000-1000200</span><br><span class="line"><span class="comment"># 创建比对索引</span></span><br><span class="line">bwa index GRCh38.p14.fna <span class="comment"># 会自动在 bwtsw, is or rb2 三种算法中选择合适的</span></span><br><span class="line"><span class="comment"># 创建dict</span></span><br><span class="line">gatk CreateSequenceDictionary -R GRCh38.p14.fna</span><br></pre></td></tr></table></figure>
- <ul>
- <li>最后得到的RefSeq目录结构如下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># conda create -n linux -c conda-forge tree</span></span><br><span class="line"><span class="comment"># conda run -n linux tree -f -h --du</span></span><br><span class="line">[8.5G] .</span><br><span class="line">├── [ 79K] ./GRCh38.p14.dict</span><br><span class="line">├── [3.1G] ./GRCh38.p14.fna</span><br><span class="line">├── [ 21K] ./GRCh38.p14.fna.amb</span><br><span class="line">├── [ 90K] ./GRCh38.p14.fna.ann</span><br><span class="line">├── [3.1G] ./GRCh38.p14.fna.bwt</span><br><span class="line">├── [ 26K] ./GRCh38.p14.fna.fai</span><br><span class="line">├── [786M] ./GRCh38.p14.fna.pac</span><br><span class="line">└── [1.5G] ./GRCh38.p14.fna.sa</span><br></pre></td></tr></table></figure>
- <h3 id="已知SNP">已知SNP</h3>
- <ul>
- <li><a target="_blank" rel="noopener" href="https://gatk.broadinstitute.org/hc/en-us/articles/360035890811-Resource-bundle">GATK官网提供了一些数据</a></li>
- <li><a target="_blank" rel="noopener" href="https://ftp.ncbi.nlm.nih.gov/snp/latest_release/VCF/">NCBI提供了dbSNP</a></li>
- <li><code>lftp ftp://gsapubftp-anonymous@ftp.broadinstitute.org/bundle/</code>,密码空,直接回车</li>
- <li>下载和参考数据相对应的<a target="_blank" rel="noopener" href="https://gist.github.com/Limour-dev/2d9c0250714bec1ce5c5989363bbfa12">indels.hg38.vcf</a></li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget https://ftp.ncbi.nlm.nih.gov/snp/latest_release/VCF/GCF_000001405.40.gz -O GRCh38.dbSNP.ncbi.vcf.gz</span><br></pre></td></tr></table></figure>
- <h4 id="转换染色体名称到NCBI的参考文件">转换染色体名称到NCBI的参考文件</h4>
- <ul>
- <li><code>assembly_report.txt</code> 在下载NCBI参考数据FTP目录下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/405/GCF_000001405.40_GRCh38.p14/GCF_000001405.40_GRCh38.p14_assembly_report.txt -O GRCh38.p14_assembly_report.txt </span><br><span class="line">grep -e <span class="string">'^[^#]'</span> GRCh38.p14_assembly_report.txt | awk -F<span class="string">'\t'</span> <span class="string">'{ print $NF, $7 }'</span> | sed <span class="string">'s/\r / /g'</span> > rename_file.txt</span><br><span class="line">conda create -n something_fuck -c conda-forge mamba</span><br><span class="line">conda activate something_fuck</span><br><span class="line">mamba install -c bioconda bcftools</span><br><span class="line">bcftools annotate --rename-chrs rename_file.txt -o Homo_sapiens_assembly38.known_indels.ncbi.vcf Homo_sapiens_assembly38.known_indels.vcf</span><br><span class="line">bcftools annotate --rename-chrs rename_file.txt -o hapmap_3.3.hg38.ncbi.vcf hapmap_3.3.hg38.vcf</span><br><span class="line">bcftools annotate --rename-chrs rename_file.txt -o Mills_and_1000G_gold_standard.indels.hg38.ncbi.vcf Mills_and_1000G_gold_standard.indels.hg38.vcf</span><br><span class="line">conda run -n GATK4 pbgzip -n 4 *.ncbi.vcf <span class="comment"># 似乎一次只压缩一个,多运行几次</span></span><br></pre></td></tr></table></figure>
- <h4 id="建立索引">建立索引</h4>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano knownSitesIndex.sh && <span class="built_in">chmod</span> +x knownSitesIndex.sh</span><br><span class="line">./knownSitesIndex.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"><span class="comment">#设置knownSites数据存放目录</span></span><br><span class="line">knownSites=/home/jovyan/upload/knownSites</span><br><span class="line"><span class="keyword">for</span> file <span class="keyword">in</span> <span class="variable">$knownSites</span>/*.ncbi.vcf.gz</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$file</span></span><br><span class="line">gatk IndexFeatureFile \</span><br><span class="line"> -I <span class="variable">$file</span></span><br><span class="line"><span class="keyword">done</span></span><br></pre></td></tr></table></figure>
- <ul>
- <li>最后得到的knownSites目录结构如下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">[ 25G] .</span><br><span class="line">├── [ 25G] ./GRCh38.dbSNP.ncbi.vcf.gz</span><br><span class="line">├── [4.2M] ./GRCh38.dbSNP.ncbi.vcf.gz.tbi</span><br><span class="line">├── [ 79K] ./GRCh38.p14_assembly_report.txt</span><br><span class="line">├── [ 61M] ./hapmap_3.3.hg38.ncbi.vcf.gz</span><br><span class="line">├── [2.1M] ./hapmap_3.3.hg38.ncbi.vcf.gz.tbi</span><br><span class="line">├── [ 58M] ./Homo_sapiens_assembly38.known_indels.ncbi.vcf.gz</span><br><span class="line">├── [2.1M] ./Homo_sapiens_assembly38.known_indels.ncbi.vcf.gz.tbi</span><br><span class="line">├── [ 20M] ./Mills_and_1000G_gold_standard.indels.hg38.ncbi.vcf.gz</span><br><span class="line">├── [2.0M] ./Mills_and_1000G_gold_standard.indels.hg38.ncbi.vcf.gz.tbi</span><br><span class="line">└── [ 23K] ./rename_file.txt</span><br></pre></td></tr></table></figure>
- <h3 id="测序数据">测序数据</h3>
- <ul>
- <li>WGS的DNA测序数据</li>
- <li>以<a target="_blank" rel="noopener" href="https://www.ncbi.nlm.nih.gov/sra/SRX247249">SRX247249</a>做学习的示例数据,感谢<a target="_blank" rel="noopener" href="https://web.archive.org/web/20220930070928/http://www.biotrainee.com/thread-1376-1-1.html">曾老师</a>指路</li>
- <li>下载方式见<a href="/cong-ENI-shu-ju-ku-xia-zai-fastq-wen-jian#%E4%BB%8E-NCBI-%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%8B%E8%BD%BD">SRA文件转FASTQ文件</a></li>
- <li>也可以到<a target="_blank" rel="noopener" href="https://www.ebi.ac.uk/ena/browser/view/SRX247249">ENA数据库</a>上下载</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">conda run -n sra_tools prefetch --option-file SRR_Acc_List.txt</span><br><span class="line">nano 11.sh && <span class="built_in">chmod</span> +x 11.sh</span><br><span class="line">./11.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate sra_tools</span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置SRA根目录, pwd是当前目录</span></span><br><span class="line">ROOTDIR=`<span class="built_in">pwd</span>`</span><br><span class="line"><span class="comment">#设置rawData存放目录</span></span><br><span class="line">rawData=/home/jovyan/upload/rawData/<span class="variable">$TASKN</span></span><br><span class="line"><span class="built_in">mkdir</span> -p <span class="variable">$rawData</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">cd</span> <span class="variable">$ROOTDIR</span></span><br><span class="line"><span class="keyword">for</span> file <span class="keyword">in</span> `<span class="built_in">cat</span> SRR_Acc_List.txt`</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$file</span></span><br><span class="line"><span class="built_in">mkdir</span> <span class="variable">$rawData</span>/<span class="variable">$file</span></span><br><span class="line"><span class="built_in">cd</span> <span class="variable">$rawData</span>/<span class="variable">$file</span></span><br><span class="line">fasterq-dump --split-3 <span class="variable">$ROOTDIR</span>/<span class="variable">$file</span> -e 6</span><br><span class="line">pigz -p 6 *</span><br><span class="line"><span class="keyword">done</span></span><br></pre></td></tr></table></figure>
- <h3 id="rawData质控">rawData质控</h3>
- <ul>
- <li><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/28802083">原始数据质量判断</a></li>
- <li><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/28924793">原始数据过滤工具</a></li>
- </ul>
- <h4 id="质量判断(可跳过)">质量判断(可跳过)</h4>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano qc.sh && <span class="built_in">chmod</span> +x qc.sh</span><br><span class="line">./qc.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置rawData存放目录</span></span><br><span class="line">rawData=/home/jovyan/upload/rawData/<span class="variable">$TASKN</span></span><br><span class="line"><span class="comment">#设置qc结果的输出目录</span></span><br><span class="line">QCDIR=/home/jovyan/upload/rawData/<span class="variable">$TASKN</span><span class="string">"_fastqc"</span></span><br><span class="line"><span class="built_in">mkdir</span> -p <span class="variable">$QCDIR</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">for</span> file <span class="keyword">in</span> <span class="variable">$rawData</span>/*</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$file</span></span><br><span class="line">SAMPLE=<span class="variable">${file##*/}</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$QCDIR</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line"><span class="built_in">mkdir</span> <span class="variable">$QCDIR</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line">fastqc -o <span class="variable">$QCDIR</span><span class="string">"/"</span><span class="variable">$SAMPLE</span> --threads=6 `<span class="built_in">ls</span> <span class="variable">$rawData</span>/<span class="variable">$SAMPLE</span>/*`</span><br><span class="line"><span class="keyword">done</span></span><br></pre></td></tr></table></figure>
- <ul>
- <li>对于PE而言,正向和反向reads的测量过程是独立的,将当成两次SE来处理</li>
- <li>最后的报告中:</li>
- <li>Q20的碱基要在95%以上(最差不低于90%)</li>
- <li>Q30要求大于85%(最差也不要低于80%)</li>
- <li>对于人类来说,GC含量应该在40%左右</li>
- </ul>
- <h4 id="fastp一键质控">fastp一键质控</h4>
- <ul>
- <li><a target="_blank" rel="noopener" href="https://github.com/OpenGene/fastp">fastp的详细说明</a>; <a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/33601691">中文介绍</a></li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano qc.sh && <span class="built_in">chmod</span> +x qc.sh</span><br><span class="line">./qc.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置rawData存放目录</span></span><br><span class="line">rawData=/home/jovyan/upload/rawData/<span class="variable">$TASKN</span></span><br><span class="line"><span class="comment">#设置qc结果的输出目录</span></span><br><span class="line">QCDIR=/home/jovyan/upload/rawData/<span class="variable">$TASKN</span><span class="string">"_fastp"</span></span><br><span class="line"><span class="built_in">mkdir</span> -p <span class="variable">$QCDIR</span></span><br><span class="line"><span class="comment">#设置cleanData的存放目录</span></span><br><span class="line">CLEAN=/home/jovyan/upload/cleanData/<span class="variable">$TASKN</span></span><br><span class="line"><span class="built_in">mkdir</span> -p <span class="variable">$CLEAN</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">for</span> file <span class="keyword">in</span> <span class="variable">$rawData</span>/*</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$file</span></span><br><span class="line">SAMPLE=<span class="variable">${file##*/}</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$QCDIR</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line"><span class="built_in">mkdir</span> <span class="variable">$QCDIR</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$CLEAN</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line"><span class="built_in">mkdir</span> <span class="variable">$CLEAN</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line"><span class="built_in">cd</span> <span class="variable">$QCDIR</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line">fastp -c -w 4 \</span><br><span class="line">-o <span class="variable">$CLEAN</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/out.R1.fq.gz"</span> \</span><br><span class="line">-O <span class="variable">$CLEAN</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/out.R2.fq.gz"</span> \</span><br><span class="line">-h <span class="variable">$QCDIR</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/fastp.html"</span> \</span><br><span class="line">-j <span class="variable">$QCDIR</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/fastp.json"</span> \</span><br><span class="line">-i `<span class="built_in">ls</span> <span class="variable">$rawData</span>/<span class="variable">$SAMPLE</span>/*_1.fastq.gz` \</span><br><span class="line">-I `<span class="built_in">ls</span> <span class="variable">$rawData</span>/<span class="variable">$SAMPLE</span>/*_2.fastq.gz`</span><br><span class="line"><span class="keyword">done</span></span><br></pre></td></tr></table></figure>
- <ul>
- <li>最后得到的cleanData目录结构如下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">[ 23G] .</span><br><span class="line">├── [9.1G] ./SRR799559</span><br><span class="line">│ ├── [4.4G] ./SRR799559/out.R1.fq.gz</span><br><span class="line">│ └── [4.7G] ./SRR799559/out.R2.fq.gz</span><br><span class="line">├── [7.0G] ./SRR799560</span><br><span class="line">│ ├── [3.4G] ./SRR799560/out.R1.fq.gz</span><br><span class="line">│ └── [3.5G] ./SRR799560/out.R2.fq.gz</span><br><span class="line">└── [7.4G] ./SRR799561</span><br><span class="line"> ├── [3.6G] ./SRR799561/out.R1.fq.gz</span><br><span class="line"> └── [3.8G] ./SRR799561/out.R2.fq.gz</span><br></pre></td></tr></table></figure>
- <h2 id="数据比对">数据比对</h2>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano bwa_and_markdup.sh && <span class="built_in">chmod</span> +x bwa_and_markdup.sh</span><br><span class="line">./bwa_and_markdup.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置cleanData的存放目录</span></span><br><span class="line">CLEAN=/home/jovyan/upload/cleanData/<span class="variable">$TASKN</span></span><br><span class="line"><span class="comment">#设置RefSeq的存放目录</span></span><br><span class="line">RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna</span><br><span class="line"><span class="comment">#设置Read Group信息,见 https://gatk.broadinstitute.org/hc/en-us/articles/360035890671-Read-groups</span></span><br><span class="line">RGroup_PL=ILLUMINA <span class="comment"># 所用的测序平台:ILLUMINA,SLX,SOLEXA,SOLID,454,LS454,COMPLETE,PACBIO,IONTORRENT,CAPILLARY,HELICOS或UNKNOWN。CG测序为COMPLETE</span></span><br><span class="line">RGroup_SM=<span class="variable">$TASKN</span> <span class="comment"># 样本ID,同一个样本可能有多个lane,此时用样本ID相关联</span></span><br><span class="line">RGroup=<span class="string">'PL:'</span><span class="variable">$RGroup_PL</span><span class="string">'\tSM:'</span><span class="variable">$RGroup_SM</span></span><br><span class="line"><span class="comment">#设置BAM的存放目录</span></span><br><span class="line">BAM=/home/jovyan/upload/BAM/<span class="variable">$TASKN</span></span><br><span class="line"><span class="built_in">mkdir</span> -p <span class="variable">$BAM</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">for</span> file <span class="keyword">in</span> <span class="variable">$CLEAN</span>/*</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$file</span></span><br><span class="line">SAMPLE=<span class="variable">${file##*/}</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line"><span class="built_in">mkdir</span> <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">'@RG\tID:'</span><span class="variable">$SAMPLE</span><span class="string">'\t'</span><span class="variable">$RGroup</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">#1 比对</span></span><br><span class="line">bwa mem -t 4 -M -R <span class="string">'@RG\tID:'</span><span class="variable">$SAMPLE</span><span class="string">'\t'</span><span class="variable">$RGroup</span> <span class="variable">$RefSeq</span> `<span class="built_in">ls</span> <span class="variable">$CLEAN</span>/<span class="variable">$SAMPLE</span>/*` \</span><br><span class="line">| samtools view -Sb - > <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/raw.bam"</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">#2 排序</span></span><br><span class="line">samtools <span class="built_in">sort</span> -@ 4 -m 4G -O bam -o <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.bam"</span> <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/raw.bam"</span></span><br><span class="line"><span class="built_in">rm</span> <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/raw.bam"</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">#3 标记PCR重复</span></span><br><span class="line">gatk MarkDuplicates -I <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.bam"</span> \</span><br><span class="line">-O <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.markdup.bam"</span> \</span><br><span class="line">-M <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.markdup_metrics.txt"</span></span><br><span class="line"><span class="built_in">rm</span> <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.bam"</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">#4 创建比对索引文件</span></span><br><span class="line">samtools index <span class="variable">$BAM</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.markdup.bam"</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">done</span></span><br></pre></td></tr></table></figure>
- <ul>
- <li>最后得到的BAM目录结构如下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">[ 30G] .</span><br><span class="line">├── [ 11G] ./SRR799559</span><br><span class="line">│ ├── [ 11G] ./SRR799559/sorted.markdup.bam</span><br><span class="line">│ ├── [4.5M] ./SRR799559/sorted.markdup.bam.bai</span><br><span class="line">│ └── [3.7K] ./SRR799559/sorted.markdup_metrics.txt</span><br><span class="line">├── [8.8G] ./SRR799560</span><br><span class="line">│ ├── [8.8G] ./SRR799560/sorted.markdup.bam</span><br><span class="line">│ ├── [3.9M] ./SRR799560/sorted.markdup.bam.bai</span><br><span class="line">│ └── [3.7K] ./SRR799560/sorted.markdup_metrics.txt</span><br><span class="line">└── [9.6G] ./SRR799561</span><br><span class="line"> ├── [9.5G] ./SRR799561/sorted.markdup.bam</span><br><span class="line"> ├── [4.1M] ./SRR799561/sorted.markdup.bam.bai</span><br><span class="line"> └── [3.7K] ./SRR799561/sorted.markdup_metrics.txt</span><br></pre></td></tr></table></figure>
- <h3 id="同样本合并">同样本合并</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano merge.sh && <span class="built_in">chmod</span> +x merge.sh</span><br><span class="line">./merge.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置BAM的存放目录</span></span><br><span class="line">BAM=/home/jovyan/upload/BAM/<span class="variable">$TASKN</span></span><br><span class="line"><span class="comment">#设置merge后的数据存放目录</span></span><br><span class="line">MERGEDBAM=/home/jovyan/upload/merged/<span class="variable">$TASKN</span>/SAMPLE1</span><br><span class="line"><span class="built_in">mkdir</span> -p <span class="variable">$MERGEDBAM</span></span><br><span class="line"> </span><br><span class="line">samtools merge <span class="variable">$MERGEDBAM</span><span class="string">"/sorted.markdup.bam"</span> \</span><br><span class="line">`find <span class="string">"<span class="variable">$BAM</span>"</span> -name <span class="string">"sorted.markdup.bam"</span> -<span class="built_in">type</span> f -<span class="built_in">exec</span> <span class="built_in">readlink</span> -f {} \;`</span><br><span class="line">samtools index <span class="variable">$MERGEDBAM</span><span class="string">"/sorted.markdup.bam"</span></span><br></pre></td></tr></table></figure>
- <ul>
- <li>最后得到的MERGED目录结构如下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[ 21G] .</span><br><span class="line">└── [ 21G] ./SAMPLE1</span><br><span class="line"> ├── [ 21G] ./SAMPLE1/sorted.markdup.bam</span><br><span class="line"> └── [6.8M] ./SAMPLE1/sorted.markdup.bam.bai</span><br></pre></td></tr></table></figure>
- <h3 id="局部重比对">局部重比对</h3>
- <ul>
- <li>具体见<a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/29485987">黄树嘉博士的相关介绍</a></li>
- <li>因为本文是GATK 4.0的HaplotypeCaller模块,自带局部重比对,故用到的时候再写</li>
- </ul>
- <h3 id="BQSR">BQSR</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano BQSR.sh && <span class="built_in">chmod</span> +x BQSR.sh</span><br><span class="line">./BQSR.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置merged数据存放目录</span></span><br><span class="line">MERGED=/home/jovyan/upload/merged/<span class="variable">$TASKN</span></span><br><span class="line"><span class="comment">#设置RefSeq的存放目录</span></span><br><span class="line">RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna</span><br><span class="line"><span class="comment">#设置knownSites数据存放目录</span></span><br><span class="line">knownSites=/home/jovyan/upload/knownSites</span><br><span class="line">knownSites=$(<span class="built_in">echo</span> $(<span class="built_in">ls</span> <span class="variable">$knownSites</span>/*.ncbi.vcf.gz | sed <span class="string">'s/^/--known-sites /'</span> | <span class="built_in">tr</span> <span class="string">'\n'</span> <span class="string">' '</span>))</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$knownSites</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">for</span> file <span class="keyword">in</span> <span class="variable">$MERGED</span>/*</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$file</span></span><br><span class="line">SAMPLE=<span class="variable">${file##*/}</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line"> </span><br><span class="line">gatk BaseRecalibrator <span class="variable">$knownSites</span> \</span><br><span class="line"> -R <span class="variable">$RefSeq</span> \</span><br><span class="line"> -I <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.markdup.bam"</span> \</span><br><span class="line"> -O <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/recal_data.table"</span></span><br><span class="line"> </span><br><span class="line">gatk ApplyBQSR \</span><br><span class="line"> -R <span class="variable">$RefSeq</span> \</span><br><span class="line"> -I <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.markdup.bam"</span> \</span><br><span class="line"> --bqsr-recal-file <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/recal_data.table"</span> \</span><br><span class="line"> -O <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.markdup.BQSR.bam"</span></span><br><span class="line"> </span><br><span class="line">samtools index <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.markdup.BQSR.bam"</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">done</span></span><br></pre></td></tr></table></figure>
- <ul>
- <li>最后得到的MERGED目录结构如下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">[ 54G] .</span><br><span class="line">└── [ 54G] ./SAMPLE1</span><br><span class="line"> ├── [2.5M] ./SAMPLE1/recal_data.table</span><br><span class="line"> ├── [ 21G] ./SAMPLE1/sorted.markdup.bam</span><br><span class="line"> ├── [6.8M] ./SAMPLE1/sorted.markdup.bam.bai</span><br><span class="line"> ├── [8.8M] ./SAMPLE1/sorted.markdup.BQSR.bai</span><br><span class="line"> ├── [ 33G] ./SAMPLE1/sorted.markdup.BQSR.bam</span><br><span class="line"> └── [7.6M] ./SAMPLE1/sorted.markdup.BQSR.bam.bai</span><br></pre></td></tr></table></figure>
- <h2 id="两步法变异检测">两步法变异检测</h2>
- <h3 id="HaplotypeCaller">HaplotypeCaller</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano HaplotypeCaller.sh && <span class="built_in">chmod</span> +x HaplotypeCaller.sh</span><br><span class="line">./HaplotypeCaller.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"> </span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置BQSR数据存放目录</span></span><br><span class="line">MERGED=/home/jovyan/upload/merged/<span class="variable">$TASKN</span></span><br><span class="line"><span class="comment">#设置RefSeq的存放目录</span></span><br><span class="line">RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna</span><br><span class="line"> </span><br><span class="line"><span class="keyword">for</span> file <span class="keyword">in</span> <span class="variable">$MERGED</span>/*</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$file</span></span><br><span class="line">SAMPLE=<span class="variable">${file##*/}</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span></span><br><span class="line"> </span><br><span class="line">gatk --java-options <span class="string">"-Xmx4g"</span> HaplotypeCaller -ERC GVCF \</span><br><span class="line"> -R <span class="variable">$RefSeq</span> \</span><br><span class="line"> -I <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/sorted.markdup.BQSR.bam"</span> \</span><br><span class="line"> -O <span class="variable">$MERGED</span><span class="string">"/"</span><span class="variable">$SAMPLE</span><span class="string">"/HC.g.vcf.gz"</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">done</span></span><br></pre></td></tr></table></figure>
- <h3 id="CombineGVCFs">CombineGVCFs</h3>
- <h4 id="单样本">单样本</h4>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">VCFPATH=<span class="variable">$MERGED</span><span class="string">'/SAMPLE1'</span></span><br></pre></td></tr></table></figure>
- <h4 id="多样本">多样本</h4>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano CombineGVCFs.sh && <span class="built_in">chmod</span> +x CombineGVCFs.sh</span><br><span class="line">./CombineGVCFs.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"> </span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置BQSR数据存放目录</span></span><br><span class="line">MERGED=/home/jovyan/upload/merged/<span class="variable">$TASKN</span></span><br><span class="line"><span class="comment">#设置RefSeq的存放目录</span></span><br><span class="line">RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna</span><br><span class="line"><span class="comment">#设置最后输出的路径</span></span><br><span class="line">VCFPATH=/home/jovyan/upload/VCF/<span class="variable">$TASKN</span></span><br><span class="line"><span class="built_in">mkdir</span> -p <span class="variable">$VCFPATH</span></span><br><span class="line"> </span><br><span class="line">variant=$(<span class="built_in">echo</span> $(<span class="built_in">ls</span> <span class="variable">$MERGED</span>/*/HC.g.vcf.gz | sed <span class="string">'s/^/--variant /'</span> | <span class="built_in">tr</span> <span class="string">'\n'</span> <span class="string">' '</span>))</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$variant</span></span><br><span class="line"> </span><br><span class="line">gatk CombineGVCFs $<span class="variable">$variant</span> \</span><br><span class="line"> -R <span class="variable">$RefSeq</span> \</span><br><span class="line"> -O <span class="variable">$VCFPATH</span><span class="string">'/HC.g.vcf.gz'</span></span><br></pre></td></tr></table></figure>
- <h3 id="GenotypeGVCFs">GenotypeGVCFs</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano GenotypeGVCFs.sh && <span class="built_in">chmod</span> +x GenotypeGVCFs.sh</span><br><span class="line">./GenotypeGVCFs.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"> </span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置BQSR数据存放目录</span></span><br><span class="line">MERGED=/home/jovyan/upload/merged/<span class="variable">$TASKN</span></span><br><span class="line"><span class="comment">#设置RefSeq的存放目录</span></span><br><span class="line">RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna</span><br><span class="line"><span class="comment">#设置最后输出的路径</span></span><br><span class="line">VCFPATH=<span class="variable">$MERGED</span><span class="string">'/SAMPLE1'</span></span><br><span class="line"><span class="built_in">mkdir</span> -p <span class="variable">$VCFPATH</span></span><br><span class="line"> </span><br><span class="line">gatk --java-options <span class="string">"-Xmx4g"</span> GenotypeGVCFs \</span><br><span class="line"> -R <span class="variable">$RefSeq</span> \</span><br><span class="line"> -V <span class="variable">$VCFPATH</span><span class="string">'/HC.g.vcf.gz'</span> \</span><br><span class="line"> -O <span class="variable">$VCFPATH</span><span class="string">'/HC.vcf.gz'</span></span><br></pre></td></tr></table></figure>
- <ul>
- <li>最后得到的结果如下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">├── [6.8G] ./HC.g.vcf.gz</span><br><span class="line">├── [5.0M] ./HC.g.vcf.gz.tbi</span><br><span class="line">├── [127M] ./HC.vcf.gz</span><br><span class="line">├── [2.0M] ./HC.vcf.gz.tbi</span><br></pre></td></tr></table></figure>
- <h2 id="VQSR">VQSR</h2>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nano VQSR.sh && <span class="built_in">chmod</span> +x VQSR.sh</span><br><span class="line">./VQSR.sh</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="built_in">source</span> activate GATK4</span><br><span class="line"> </span><br><span class="line"><span class="comment">#任务名</span></span><br><span class="line">TASKN=SRX247249</span><br><span class="line"><span class="comment">#设置BQSR数据存放目录</span></span><br><span class="line">MERGED=/home/jovyan/upload/merged/<span class="variable">$TASKN</span></span><br><span class="line"><span class="comment">#设置RefSeq的存放目录</span></span><br><span class="line">RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna</span><br><span class="line"><span class="comment">#设置最后输出的路径</span></span><br><span class="line">VCFPATH=<span class="variable">$MERGED</span><span class="string">'/SAMPLE1'</span></span><br><span class="line"><span class="comment">#设置knownSites数据存放目录</span></span><br><span class="line">knownSites=/home/jovyan/upload/knownSites</span><br><span class="line"> </span><br><span class="line">gatk VariantRecalibrator \</span><br><span class="line"> -R <span class="variable">$RefSeq</span> \</span><br><span class="line"> -V <span class="variable">$VCFPATH</span><span class="string">'/HC.vcf.gz'</span> \</span><br><span class="line"> --resource:hapmap,known=<span class="literal">false</span>,training=<span class="literal">true</span>,truth=<span class="literal">true</span>,prior=15.0 <span class="variable">$knownSites</span>/hapmap_3.3.hg38.ncbi.vcf.gz \</span><br><span class="line"> --resource:dbsnp,known=<span class="literal">true</span>,training=<span class="literal">false</span>,truth=<span class="literal">false</span>,prior=2.0 <span class="variable">$knownSites</span>/GRCh38.dbSNP.ncbi.vcf.gz \</span><br><span class="line"> -an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR \</span><br><span class="line"> -mode SNP \</span><br><span class="line"> -O <span class="variable">$VCFPATH</span>/snp.recal \</span><br><span class="line"> --tranches-file <span class="variable">$VCFPATH</span>/snp.tranches \</span><br><span class="line"> --rscript-file <span class="variable">$VCFPATH</span>/snp.plots.R</span><br><span class="line"> </span><br><span class="line">gatk ApplyVQSR \</span><br><span class="line"> -R <span class="variable">$RefSeq</span> \</span><br><span class="line"> -V <span class="variable">$VCFPATH</span><span class="string">'/HC.vcf.gz'</span> \</span><br><span class="line"> -O <span class="variable">$VCFPATH</span><span class="string">'/snp.VQSR.vcf.gz'</span> \</span><br><span class="line"> --truth-sensitivity-filter-level 99.0 \</span><br><span class="line"> --tranches-file <span class="variable">$VCFPATH</span>/snp.tranches \</span><br><span class="line"> --recal-file <span class="variable">$VCFPATH</span>/snp.recal \</span><br><span class="line"> -mode SNP</span><br><span class="line"> </span><br><span class="line">gatk VariantRecalibrator \</span><br><span class="line"> -R <span class="variable">$RefSeq</span> \</span><br><span class="line"> -V <span class="variable">$VCFPATH</span><span class="string">'/snp.VQSR.vcf.gz'</span> \</span><br><span class="line"> --resource:dbindel,known=<span class="literal">true</span>,training=<span class="literal">false</span>,truth=<span class="literal">false</span>,prior=2.0 <span class="variable">$knownSites</span>/Homo_sapiens_assembly38.known_indels.ncbi.vcf.gz \</span><br><span class="line"> --resource:mills,known=<span class="literal">true</span>,training=<span class="literal">true</span>,truth=<span class="literal">true</span>,prior=12.0 <span class="variable">$knownSites</span>/Mills_and_1000G_gold_standard.indels.hg38.ncbi.vcf.gz \</span><br><span class="line"> -an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR \</span><br><span class="line"> -mode INDEL --max-gaussians 6 \</span><br><span class="line"> -O <span class="variable">$VCFPATH</span>/snp.indel.recal \</span><br><span class="line"> --tranches-file <span class="variable">$VCFPATH</span>/snp.indel.tranches \</span><br><span class="line"> --rscript-file <span class="variable">$VCFPATH</span>/snp.indel.plots.R</span><br><span class="line"> </span><br><span class="line">gatk ApplyVQSR \</span><br><span class="line"> -R <span class="variable">$RefSeq</span> \</span><br><span class="line"> -V <span class="variable">$VCFPATH</span><span class="string">'/snp.VQSR.vcf.gz'</span> \</span><br><span class="line"> -O <span class="variable">$VCFPATH</span><span class="string">'/snp.indel.VQSR.vcf.gz'</span> \</span><br><span class="line"> --truth-sensitivity-filter-level 99.0 \</span><br><span class="line"> --tranches-file <span class="variable">$VCFPATH</span>/snp.indel.tranches \</span><br><span class="line"> --recal-file <span class="variable">$VCFPATH</span>/snp.indel.recal \</span><br><span class="line"> -mode INDEL</span><br></pre></td></tr></table></figure>
- <ul>
- <li>最后得到的结果如下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">├── [2.7M] ./snp.plots.R</span><br><span class="line">├── [6.2M] ./snp.plots.R.pdf</span><br><span class="line">├── [199M] ./snp.recal</span><br><span class="line">├── [7.5M] ./snp.recal.idx</span><br><span class="line">├── [ 584] ./snp.tranches</span><br><span class="line">├── [7.5K] ./snp.tranches.pdf</span><br><span class="line">├── [151M] ./snp.VQSR.vcf.gz</span><br><span class="line">├── [2.0M] ./snp.VQSR.vcf.gz.tbi</span><br><span class="line">├── [2.8M] ./snp.indel.plots.R</span><br><span class="line">├── [6.2M] ./snp.indel.plots.R.pdf</span><br><span class="line">├── [ 35M] ./snp.indel.recal</span><br><span class="line">├── [256K] ./snp.indel.recal.idx</span><br><span class="line">├── [ 595] ./snp.indel.tranches</span><br><span class="line">├── [153M] ./snp.indel.VQSR.vcf.gz</span><br><span class="line">├── [2.0M] ./snp.indel.VQSR.vcf.gz.tbi</span><br></pre></td></tr></table></figure>
- <ul>
- <li>SNP内容示例</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># tabix snp.VQSR.vcf.gz NC_000001.11 | head -n 5</span></span><br><span class="line">NC_000001.11 16378 . T C 35.32 VQSRTrancheSNP99.90to100.00 AC=2;AF=1.00;AN=2;DP=2;ExcessHet=0.0000;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=20.00;QD=17.66;SOR=2.303;VQSLOD=-1.018e+01;culprit=MQ GT:AD:DP:GQ:PL 1/1:0,2:2:6:47,6,0</span><br><span class="line">NC_000001.11 17020 . G A 59.32 VQSRTrancheSNP99.90to100.00 AC=2;AF=1.00;AN=2;DP=2;ExcessHet=0.0000;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=31.66;QD=29.66;SOR=0.693;VQSLOD=-5.480e+00;culprit=MQ GT:AD:DP:GQ:PL 1/1:0,2:2:6:71,6,0</span><br><span class="line">NC_000001.11 17385 . G A 60.32 VQSRTrancheSNP99.90to100.00 AC=2;AF=1.00;AN=2;DP=2;ExcessHet=0.0000;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=32.28;QD=30.16;SOR=2.303;VQSLOD=-2.357e+00;culprit=MQ GT:AD:DP:GQ:PL 1/1:0,2:2:6:72,6,0</span><br><span class="line">NC_000001.11 20254 . G A 64.64 VQSRTrancheSNP99.90to100.00 AC=1;AF=0.500;AN=2;BaseQRankSum=2.37;DP=8;ExcessHet=0.0000;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=24.89;MQRankSum=-2.030e-01;QD=8.08;ReadPosRankSum=-1.611e+00;SOR=1.034;VQSLOD=-1.317e+01;culprit=MQ GT:AD:DP:GQ:PGT:PID:PL:PS 0|1:5,3:8:72:1|0:20250_T_C:72,0,126:20250</span><br><span class="line">NC_000001.11 39230 . G A 83.64 VQSRTrancheSNP99.90to100.00 AC=1;AF=0.500;AN=2;BaseQRankSum=-1.078e+00;DP=15;ExcessHet=0.0000;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=26.72;MQRankSum=2.20;QD=5.58;ReadPosRankSum=-1.917e+00;SOR=1.022;VQSLOD=-1.362e+01;culprit=MQ GT:AD:DP:GQ:PL 0/1:10,5:15:91:91,0,239</span><br></pre></td></tr></table></figure>
- <h2 id="变异注释">变异注释</h2>
- <h3 id="安装-VEP">安装 VEP</h3>
- <ul>
- <li><a target="_blank" rel="noopener" href="http://www.ensembl.org/info/docs/tools/vep/index.html">VEP官网地址</a></li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">sudo docker pull ensemblorg/ensembl-vep</span><br><span class="line">sudo docker run --<span class="built_in">rm</span> -t -i -v ~/upload:/data:z ensemblorg/ensembl-vep <span class="built_in">pwd</span></span><br><span class="line">sudo docker run --<span class="built_in">rm</span> -t -i -v ~/upload:/data:z ensemblorg/ensembl-vep <span class="built_in">ls</span> -al /opt/vep/</span><br><span class="line">sudo <span class="built_in">mkdir</span> -p ~/upload/vep && sudo <span class="built_in">chmod</span> 777 ~/upload/vep</span><br><span class="line">sudo docker run --<span class="built_in">rm</span> -t -i -v ~/upload:/data:z -v ~/upload/vep:/opt/vep/.vep:z ensemblorg/ensembl-vep INSTALL.pl</span><br><span class="line"><span class="comment"># sudo docker run --rm -t -i -v ~/upload:/data:Z ensemblorg/ensembl-vep cat INSTALL.pl > INSTALL.pl</span></span><br><span class="line"><span class="comment"># 自行分析 INSTALL.pl,构造下载后的结构,以下是104版本的</span></span><br><span class="line"><span class="comment"># 太慢了,手动下载,请各显神通,下载地址来自上一步的输出</span></span><br><span class="line">wget https://ftp.ensembl.org/pub/release-104/variation/indexed_vep_cache/homo_sapiens_vep_104_GRCh38.tar.gz -O ~/upload/vep</span><br><span class="line">tar -zxvf homo_sapiens_vep_104_GRCh38.tar.gz</span><br></pre></td></tr></table></figure>
- <h3 id="进行注释">进行注释</h3>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">mkdir</span> -p ~/upload/VEP/SRX247249 && <span class="built_in">chmod</span> -R 777 ~/upload/VEP/SRX247249</span><br><span class="line"><span class="comment"># mv ~/data/refseq ~/upload</span></span><br><span class="line"><span class="comment"># chmod -R 777 ~/upload/refseq</span></span><br><span class="line"><span class="comment"># chmod -R 777 ~/upload/vep</span></span><br><span class="line"><span class="comment"># chmod -R 777 ~/upload/merged/SRX247249</span></span><br><span class="line">sudo docker run --<span class="built_in">rm</span> -t -i -v ~/upload:/data:z ensemblorg/ensembl-vep \</span><br><span class="line"> vep --fasta /data/refseq/GRCh38.p14.fna \</span><br><span class="line"> --format vcf --vcf --fork 4 --hgvs --force_overwrite --everything \</span><br><span class="line"> --offline --dir_cache /data/vep \</span><br><span class="line"> -i /data/merged/SRX247249/SAMPLE1/snp.indel.VQSR.vcf.gz \</span><br><span class="line"> -o /data/merged/SRX247249/SAMPLE1/snp.indel.VQSR.VEP.vcf</span><br><span class="line"><span class="comment"># sudo chmod 777 ~/upload/merged/SRX247249/SAMPLE1/snp.indel.VQSR.VEP.vcf</span></span><br><span class="line"><span class="comment"># pbgzip -n 4 snp.indel.VQSR.VEP.vcf</span></span><br><span class="line"><span class="comment"># tabix -p vcf snp.indel.VQSR.VEP.vcf.gz</span></span><br></pre></td></tr></table></figure>
- <ul>
- <li>最后得到的结果如下</li>
- </ul>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">├── [346M] ./snp.indel.VQSR.VEP.vcf.gz</span><br><span class="line">├── [210K] ./snp.indel.VQSR.VEP.vcf.gz_summary.html</span><br><span class="line">├── [1.6M] ./snp.indel.VQSR.VEP.vcf.gz.tbi</span><br><span class="line">├── [8.2K] ./snp.indel.VQSR.VEP.vcf.gz_warnings.txt</span><br></pre></td></tr></table></figure>
- <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># tabix snp.indel.VQSR.VEP.vcf.gz NC_000001.11 | head -n 2</span></span><br><span class="line">NC_000001.11 16378 . T C 35.32 VQSRTrancheSNP99.90to100.00 AC=2;AF=1.00;AN=2;DP=2;ExcessHet=0.0000;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=20.00;QD=17.66;SOR=2.303;VQSLOD=-1.018e+01;culprit=MQ;CSQ=C|downstream_gene_variant|MODIFIER|DDX11L1|ENSG00000223972|Transcript|ENST00000450305|transcribed_unprocessed_pseudogene||||||||||rs148220436|2708|1||SNV|HGNC|HGNC:37102|YES||||||||||||||||||||||||||||||||||||||||||||,C|downstream_gene_variant|MODIFIER|DDX11L1|ENSG00000223972|Transcript|ENST00000456328|processed_transcript||||||||||rs148220436|1969|1||SNV|HGNC|HGNC:37102||||1|||||||||||||||||||||||||||||||||||||||||,C|intron_variant&non_coding_transcript_variant|MODIFIER|WASH7P|ENSG00000227232|Transcript|ENST00000488147|unprocessed_pseudogene||8/10|ENST00000488147.1:n.1067+229A>G|||||||rs148220436||-1||SNV|HGNC|HGNC:38034|YES||||||||||||||||||||||||||||||||||||||||||||,C|downstream_gene_variant|MODIFIER|MIR6859-1|ENSG00000278267|Transcript|ENST00000619216|miRNA||||||||||rs148220436|991|-1||SNV|HGNC|HGNC:50039|YES||||||||||||||||||||||||||||||||||||||||||||,C|regulatory_region_variant|MODIFIER|||RegulatoryFeature|ENSR00000344266|CTCF_binding_site||||||||||rs148220436||||SNV|||||||||||||||||||||||||||||||||||||||||||||||,C|regulatory_region_variant|MODIFIER|||RegulatoryFeature|ENSR00001164745|promoter_flanking_region||||||||||rs148220436||||SNV||||||||||||||||||||||||||||||||||||||||||||||| GT:AD:DP:GQ:PL 1/1:0,2:2:6:47,6,0</span><br><span class="line">NC_000001.11 17020 . G A 59.32 VQSRTrancheSNP99.90to100.00 AC=2;AF=1.00;AN=2;DP=2;ExcessHet=0.0000;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=31.66;QD=29.66;SOR=0.693;VQSLOD=-5.480e+00;culprit=MQ;CSQ=A|downstream_gene_variant|MODIFIER|DDX11L1|ENSG00000223972|Transcript|ENST00000450305|transcribed_unprocessed_pseudogene||||||||||rs199740902|3350|1||SNV|HGNC|HGNC:37102|YES||||||||||||||||||||||||||||||||||||||||||||,A|downstream_gene_variant|MODIFIER|DDX11L1|ENSG00000223972|Transcript|ENST00000456328|processed_transcript||||||||||rs199740902|2611|1||SNV|HGNC|HGNC:37102||||1|||||||||||||||||||||||||||||||||||||||||,A|non_coding_transcript_exon_variant|MODIFIER|WASH7P|ENSG00000227232|Transcript|ENST00000488147|unprocessed_pseudogene|7/11||ENST00000488147.1:n.746C>T||746|||||rs199740902||-1||SNV|HGNC|HGNC:38034|YES||||||||||||||||||||||||||||||||||||||||||||,A|downstream_gene_variant|MODIFIER|MIR6859-1|ENSG00000278267|Transcript|ENST00000619216|miRNA||||||||||rs199740902|349|-1||SNV|HGNC|HGNC:50039|YES|||||||||||||||||||||||||||||||||||||||||||| GT:AD:DP:GQ:PL 1/1:0,2:2:6:71,6,0</span><br></pre></td></tr></table></figure>
-
- </div>
-
- <hr/>
- <div>
- <div class="post-metas my-3">
-
-
- <div class="post-meta">
- <i class="iconfont icon-tags"></i>
-
- <a href="/tags/GATK/" class="print-no-link">#GATK</a>
-
- <a href="/tags/SNP/" class="print-no-link">#SNP</a>
-
- <a href="/tags/WGS/" class="print-no-link">#WGS</a>
-
- </div>
-
- </div>
-
-
- <div class="license-box my-3">
- <div class="license-title">
- <div>【学习】使用GATK4.0找SNP</div>
- <div>https://hexo.limour.top/shi-yong-GATK-zhao-SNP</div>
- </div>
- <div class="license-meta">
-
- <div class="license-meta-item">
- <div>Author</div>
- <div>Limour</div>
- </div>
-
-
- <div class="license-meta-item license-meta-date">
- <div>Posted on</div>
- <div>September 24, 2023</div>
- </div>
-
-
- <div class="license-meta-item license-meta-date">
- <div>Updated on</div>
- <div>March 19, 2024</div>
- </div>
-
-
- <div class="license-meta-item">
- <div>Licensed under</div>
- <div>
-
-
-
- <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- <span class="hint--top hint--rounded" aria-label="BY - Attribution">
- <i class="iconfont icon-by"></i>
- </span>
- </a>
-
- <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- <span class="hint--top hint--rounded" aria-label="NC - Non-commercial">
- <i class="iconfont icon-nc"></i>
- </span>
- </a>
-
- <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- <span class="hint--top hint--rounded" aria-label="SA - Share-alike">
- <i class="iconfont icon-sa"></i>
- </span>
- </a>
-
-
- </div>
- </div>
-
- </div>
- <div class="license-icon iconfont"></div>
- </div>
-
- <div class="post-prevnext my-3">
- <article class="post-prev col-6">
-
-
- <a href="/The-Academy-System-Civilization-From-Hundreds-of-Millions-of-Years-Ago" title="【设定】亿万年前的学院制文明">
- <i class="iconfont icon-arrowleft"></i>
- <span class="hidden-mobile">【设定】亿万年前的学院制文明</span>
- <span class="visible-mobile">Previous</span>
- </a>
-
- </article>
- <article class="post-next col-6">
-
-
- <a href="/dan-xi-bao-zui-jia-shi-jian-de-liu-cheng" title="【复习】单细胞最佳实践的流程">
- <span class="hidden-mobile">【复习】单细胞最佳实践的流程</span>
- <span class="visible-mobile">Next</span>
- <i class="iconfont icon-arrowright"></i>
- </a>
-
- </article>
- </div>
-
- </div>
-
-
-
- <article id="comments" lazyload>
-
- <div id="waline"></div>
- <script type="text/javascript">
- Fluid.utils.loadComments('#waline', function() {
- Fluid.utils.createCssLink('https://cdn.staticfile.org/waline/2.15.5/waline.min.css')
- Fluid.utils.createScript('https://cdn.staticfile.org/waline/2.15.5/waline.min.js', function() {
- var options = Object.assign(
- {"serverURL":"https://comments.limour.top","path":"window.location.pathname","meta":["nick","mail","link"],"requiredMeta":["nick"],"lang":"zh-CN","emoji":["https://jscdn.limour.top/gh/walinejs/emojis/weibo"],"dark":"html[data-user-color-scheme=\"dark\"]","wordLimit":0,"pageSize":10},
- {
- el: '#waline',
- path: window.location.pathname
- }
- )
- Waline.init(options);
- Fluid.utils.waitElementVisible('#waline .vcontent', () => {
- var imgSelector = '#waline .vcontent img:not(.vemoji)';
- Fluid.plugins.imageCaption(imgSelector);
- Fluid.plugins.fancyBox(imgSelector);
- })
- });
- });
- </script>
- <noscript>Please enable JavaScript to view the comments</noscript>
- </article>
-
- </article>
- </div>
- </div>
- </div>
- <div class="side-col d-none d-lg-block col-lg-2">
-
- <aside class="sidebar" style="margin-left: -1rem">
- <div id="toc">
- <p class="toc-header">
- <i class="iconfont icon-list"></i>
- <span>Table of Contents</span>
- </p>
- <div class="toc-body" id="toc-body"></div>
- </div>
- </aside>
- </div>
- </div>
- </div>
-
-
-
-
-
-
- <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
- <i class="iconfont icon-arrowup" aria-hidden="true"></i>
- </a>
-
-
- <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
- aria-hidden="true">
- <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
- <div class="modal-content">
- <div class="modal-header text-center">
- <h4 class="modal-title w-100 font-weight-bold">Search</h4>
- <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body mx-3">
- <div class="md-form mb-5">
- <input type="text" id="local-search-input" class="form-control validate">
- <label data-error="x" data-success="v" for="local-search-input">Keyword</label>
- </div>
- <div class="list-group" id="local-search-result"></div>
- </div>
- </div>
- </div>
- </div>
-
-
- </main>
- <footer>
- <div class="footer-inner">
-
- <div class="footer-content">
- <a target="_blank" rel="nofollow noopener" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43130202000203"><img src="https://img.limour.top/2023/08/27/64eadeb81d6a0.webp" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload>湘公网安备43130202000203号 </a> <a target="_blank" rel="nofollow noopener" href="https://beian.miit.gov.cn/">湘ICP备20008299号 </a> <a target="_blank" rel="nofollow noopener" href="https://icp.gov.moe/?keyword=20210128">萌ICP备20210128号</a> <br> <a href="https://www.foreverblog.cn/" target="_blank"> <img src="https://img.foreverblog.cn/logo_en_default.png" srcset="https://jscdn.limour.top/gh/Limour-dev/Sakurairo_Vision/load_svg/inload.svg" lazyload alt="" style="width:auto;height:24px"> </a> <br> <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/limour-blog/limour-blog.github.io" target="_blank" rel="nofollow noopener"><span>SRC</span></a> <i class="iconfont icon-love"></i> <a href="https://web.archive.org/web/20231130095837/https://effectiveacceleration.tech/" target="_blank" rel="nofollow noopener"><span>e/Acc</span></a>
- </div>
-
-
-
-
- </div>
- </footer>
- <!-- Scripts -->
-
- <script src="https://jscdn.limour.top/npm/nprogress@0.2.0/nprogress.min.js" ></script>
- <link rel="stylesheet" href="https://jscdn.limour.top/npm/nprogress@0.2.0/nprogress.min.css" />
- <script>
- NProgress.configure({"showSpinner":false,"trickleSpeed":100})
- NProgress.start()
- window.addEventListener('load', function() {
- NProgress.done();
- })
- </script>
- <script src="https://jscdn.limour.top/npm/jquery@3.6.4/dist/jquery.min.js" ></script>
- <script src="https://jscdn.limour.top/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js" ></script>
- <script src="/js/events.js" ></script>
- <script src="/js/plugins.js" ></script>
-
- <script src="/js/img-lazyload.js" ></script>
-
-
- <script>
- Fluid.utils.createScript('https://jscdn.limour.top/npm/tocbot@4.20.1/dist/tocbot.min.js', function() {
- var toc = jQuery('#toc');
- if (toc.length === 0 || !window.tocbot) { return; }
- var boardCtn = jQuery('#board-ctn');
- var boardTop = boardCtn.offset().top;
- window.tocbot.init(Object.assign({
- tocSelector : '#toc-body',
- contentSelector : '.markdown-body',
- linkClass : 'tocbot-link',
- activeLinkClass : 'tocbot-active-link',
- listClass : 'tocbot-list',
- isCollapsedClass: 'tocbot-is-collapsed',
- collapsibleClass: 'tocbot-is-collapsible',
- scrollSmooth : true,
- includeTitleTags: true,
- headingsOffset : -boardTop,
- }, CONFIG.toc));
- if (toc.find('.toc-list-item').length > 0) {
- toc.css('visibility', 'visible');
- }
- Fluid.events.registerRefreshCallback(function() {
- if ('tocbot' in window) {
- tocbot.refresh();
- var toc = jQuery('#toc');
- if (toc.length === 0 || !tocbot) {
- return;
- }
- if (toc.find('.toc-list-item').length > 0) {
- toc.css('visibility', 'visible');
- }
- }
- });
- });
- </script>
- <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>
- <script>Fluid.plugins.codeWidget();</script>
-
- <script>
- Fluid.utils.createScript('https://jscdn.limour.top/npm/anchor-js@4.3.1/anchor.min.js', function() {
- window.anchors.options = {
- placement: CONFIG.anchorjs.placement,
- visible : CONFIG.anchorjs.visible
- };
- if (CONFIG.anchorjs.icon) {
- window.anchors.options.icon = CONFIG.anchorjs.icon;
- }
- var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
- var res = [];
- for (var item of el) {
- res.push('.markdown-body > ' + item.trim());
- }
- if (CONFIG.anchorjs.placement === 'left') {
- window.anchors.options.class = 'anchorjs-link-left';
- }
- window.anchors.add(res.join(', '));
- Fluid.events.registerRefreshCallback(function() {
- if ('anchors' in window) {
- anchors.removeAll();
- var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
- var res = [];
- for (var item of el) {
- res.push('.markdown-body > ' + item.trim());
- }
- if (CONFIG.anchorjs.placement === 'left') {
- anchors.options.class = 'anchorjs-link-left';
- }
- anchors.add(res.join(', '));
- }
- });
- });
- </script>
- <script>Fluid.plugins.imageCaption();</script>
- <script src="/js/local-search.js" ></script>
- <!-- 主题的启动项,将它保持在最底部 -->
- <!-- the boot of the theme, keep it at the bottom -->
- <script src="/js/boot.js" ></script>
-
- <noscript>
- <div class="noscript-warning">Blog works best with JavaScript enabled</div>
- </noscript>
- <!-- hexo injector body_end start -->
- <script defer src="/theme-inject/timeliness.js"></script>
- <!-- hexo injector body_end end --></body>
- </html>
|