123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846 |
- <!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/c/font_1749284_5i9bdhy70f8.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.8","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},"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false},"umami":{"src":null,"website_id":null,"domains":null,"start_time":"2024-01-01T00:00:00.000Z","token":null,"api_server":null},"woyaola":null,"cnzz":null},"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><code class="hljs bash">conda create -n sra_tools -c bioconda sra-tools<br>conda activate sra_tools<br>conda install -c conda-forge lftp -y<br>conda install -c conda-forge pigz -y <span class="hljs-comment"># 或许换成 pbgzip 更好,此时将 -p 换成 -n 来指定线程数</span><br>conda install -c bioconda pbgzip -y<br>prefetch<br><span class="hljs-comment"># vdb-config -i # 设置 HTTP 代理</span><br></code></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><code class="hljs bash">conda create -n GATK4 -c bioconda gatk4<br>conda activate GATK4<br>conda install -c bioconda samtools -y<br>conda install -c bioconda bwa -y<br>conda install -c bioconda pbgzip -y <span class="hljs-comment"># 并行版bgzip,bgzip是修改过的gzip,更适合生信领域</span><br>conda install -c bioconda tabix -y <span class="hljs-comment"># 操作VCF文件,与bgzip配套</span><br><span class="hljs-comment"># conda install -c bioconda fastqc -y # 改用fastp了</span><br><span class="hljs-comment"># conda install -c bioconda trimmomatic -y # 改用fastp了</span><br>conda install -c bioconda fastp -y<br><span class="hljs-comment"># conda install -c bioconda bcftools -y # 用于重命名染色体</span><br><span class="hljs-comment"># ln -s $CONDA_PREFIX/lib/libgsl.so $CONDA_PREFIX/lib/libgsl.so.25 # 无效,放弃</span><br><span class="hljs-comment"># conda create -n GATK4-VEP -c bioconda ensembl-vep -y # 根正苗红的突变注释软件,不懂有什么奇怪依赖,解析环境半天</span><br></code></pre></td></tr></table></figure>
- <ul>
- <li>BWA是DNA比对工具(不会跨外显子比对),<a href="/STAR--yi-jian-jiao-ben">STAR</a>是RNA比对工具</li>
- <li><a href="https://hexo.limour.top/go/#aHR0cHM6Ly96aHVhbmxhbi56aGlodS5jb20vcC8zNzM0NTk1NA==" rel="noopener external nofollow noreferrer">找SNP不推荐用RNAseq的数据</a></li>
- <li><a href="https://hexo.limour.top/go/#aHR0cHM6Ly93d3cuamlhbnNodS5jb20vcC82MDE0NjkxOTRiNWU=" rel="noopener external nofollow noreferrer">各种比对工具的说明</a></li>
- </ul>
- <h2 id="准备数据">准备数据</h2>
- <h3 id="参考数据">参考数据</h3>
- <ul>
- <li><a href="https://hexo.limour.top/go/#aHR0cHM6Ly93d3cubmNiaS5ubG0ubmloLmdvdi9nZW5vbWUvYnJvd3Nl" rel="noopener external nofollow noreferrer">NCBI上各物种的参考序列</a>,可以找到RefSeq,比如Human是GCF_000001405</li>
- <li>知道序号后可以到<a href="https://hexo.limour.top/go/#aHR0cHM6Ly9mdHAubmNiaS5ubG0ubmloLmdvdi9nZW5vbWVzL2FsbC9HQ0Yv" rel="noopener external nofollow noreferrer">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><code class="hljs bash">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<br>conda run -n sra_tools pigz -d GRCh38.p14.fna.gz <span class="hljs-comment"># 得到 GRCh38.p14.fna</span><br><span class="hljs-comment"># 创建索引</span><br>samtools faidx GRCh38.p14.fna <span class="hljs-comment"># 得到 GRCh38.p14.fna.fai</span><br><span class="hljs-comment"># 查看一段序列</span><br>samtools faidx GRCh38.p14.fna NC_000001.11:1000000-1000200<br><span class="hljs-comment"># 创建比对索引</span><br>bwa index GRCh38.p14.fna <span class="hljs-comment"># 会自动在 bwtsw, is or rb2 三种算法中选择合适的</span><br><span class="hljs-comment"># 创建dict</span><br>gatk CreateSequenceDictionary -R GRCh38.p14.fna<br></code></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><code class="hljs bash"><span class="hljs-comment"># conda create -n linux -c conda-forge tree</span><br><span class="hljs-comment"># conda run -n linux tree -f -h --du</span><br>[8.5G] .<br>├── [ 79K] ./GRCh38.p14.dict<br>├── [3.1G] ./GRCh38.p14.fna<br>├── [ 21K] ./GRCh38.p14.fna.amb<br>├── [ 90K] ./GRCh38.p14.fna.ann<br>├── [3.1G] ./GRCh38.p14.fna.bwt<br>├── [ 26K] ./GRCh38.p14.fna.fai<br>├── [786M] ./GRCh38.p14.fna.pac<br>└── [1.5G] ./GRCh38.p14.fna.sa<br></code></pre></td></tr></table></figure>
- <h3 id="已知SNP">已知SNP</h3>
- <ul>
- <li><a href="https://hexo.limour.top/go/#aHR0cHM6Ly9nYXRrLmJyb2FkaW5zdGl0dXRlLm9yZy9oYy9lbi11cy9hcnRpY2xlcy8zNjAwMzU4OTA4MTEtUmVzb3VyY2UtYnVuZGxl" rel="noopener external nofollow noreferrer">GATK官网提供了一些数据</a></li>
- <li><a href="https://hexo.limour.top/go/#aHR0cHM6Ly9mdHAubmNiaS5ubG0ubmloLmdvdi9zbnAvbGF0ZXN0X3JlbGVhc2UvVkNGLw==" rel="noopener external nofollow noreferrer">NCBI提供了dbSNP</a></li>
- <li><code>lftp ftp://gsapubftp-anonymous@ftp.broadinstitute.org/bundle/</code>,密码空,直接回车</li>
- <li>下载和参考数据相对应的<a href="https://hexo.limour.top/go/#aHR0cHM6Ly9naXN0LmdpdGh1Yi5jb20vTGltb3VyLWRldi8yZDljMDI1MDcxNGJlYzFjZTVjNTk4OTM2M2JiZmExMg==" rel="noopener external nofollow noreferrer">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><code class="hljs bash">wget https://ftp.ncbi.nlm.nih.gov/snp/latest_release/VCF/GCF_000001405.40.gz -O GRCh38.dbSNP.ncbi.vcf.gz<br></code></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><code class="hljs bash">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 <br>grep -e <span class="hljs-string">'^[^#]'</span> GRCh38.p14_assembly_report.txt | awk -F<span class="hljs-string">'\t'</span> <span class="hljs-string">'{ print $NF, $7 }'</span> | sed <span class="hljs-string">'s/\r / /g'</span> > rename_file.txt<br>conda create -n something_fuck -c conda-forge mamba<br>conda activate something_fuck<br>mamba install -c bioconda bcftools<br>bcftools annotate --rename-chrs rename_file.txt -o Homo_sapiens_assembly38.known_indels.ncbi.vcf Homo_sapiens_assembly38.known_indels.vcf<br>bcftools annotate --rename-chrs rename_file.txt -o hapmap_3.3.hg38.ncbi.vcf hapmap_3.3.hg38.vcf<br>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<br>conda run -n GATK4 pbgzip -n 4 *.ncbi.vcf <span class="hljs-comment"># 似乎一次只压缩一个,多运行几次</span><br></code></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><code class="hljs bash">nano knownSitesIndex.sh && <span class="hljs-built_in">chmod</span> +x knownSitesIndex.sh<br>./knownSitesIndex.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br><span class="hljs-comment">#设置knownSites数据存放目录</span><br>knownSites=/home/jovyan/upload/knownSites<br><span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> <span class="hljs-variable">$knownSites</span>/*.ncbi.vcf.gz<br><span class="hljs-keyword">do</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$file</span><br>gatk IndexFeatureFile \<br> -I <span class="hljs-variable">$file</span><br><span class="hljs-keyword">done</span><br></code></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><code class="hljs bash">[ 25G] .<br>├── [ 25G] ./GRCh38.dbSNP.ncbi.vcf.gz<br>├── [4.2M] ./GRCh38.dbSNP.ncbi.vcf.gz.tbi<br>├── [ 79K] ./GRCh38.p14_assembly_report.txt<br>├── [ 61M] ./hapmap_3.3.hg38.ncbi.vcf.gz<br>├── [2.1M] ./hapmap_3.3.hg38.ncbi.vcf.gz.tbi<br>├── [ 58M] ./Homo_sapiens_assembly38.known_indels.ncbi.vcf.gz<br>├── [2.1M] ./Homo_sapiens_assembly38.known_indels.ncbi.vcf.gz.tbi<br>├── [ 20M] ./Mills_and_1000G_gold_standard.indels.hg38.ncbi.vcf.gz<br>├── [2.0M] ./Mills_and_1000G_gold_standard.indels.hg38.ncbi.vcf.gz.tbi<br>└── [ 23K] ./rename_file.txt<br></code></pre></td></tr></table></figure>
- <h3 id="测序数据">测序数据</h3>
- <ul>
- <li>WGS的DNA测序数据</li>
- <li>以<a href="https://hexo.limour.top/go/#aHR0cHM6Ly93d3cubmNiaS5ubG0ubmloLmdvdi9zcmEvU1JYMjQ3MjQ5" rel="noopener external nofollow noreferrer">SRX247249</a>做学习的示例数据,感谢<a href="https://hexo.limour.top/go/#aHR0cHM6Ly93ZWIuYXJjaGl2ZS5vcmcvd2ViLzIwMjIwOTMwMDcwOTI4L2h0dHA6Ly93d3cuYmlvdHJhaW5lZS5jb20vdGhyZWFkLTEzNzYtMS0xLmh0bWw=" rel="noopener external nofollow noreferrer">曾老师</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 href="https://hexo.limour.top/go/#aHR0cHM6Ly93d3cuZWJpLmFjLnVrL2VuYS9icm93c2VyL3ZpZXcvU1JYMjQ3MjQ5" rel="noopener external nofollow noreferrer">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><code class="hljs bash">conda run -n sra_tools prefetch --option-file SRR_Acc_List.txt<br>nano 11.sh && <span class="hljs-built_in">chmod</span> +x 11.sh<br>./11.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate sra_tools<br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置SRA根目录, pwd是当前目录</span><br>ROOTDIR=`<span class="hljs-built_in">pwd</span>`<br><span class="hljs-comment">#设置rawData存放目录</span><br>rawData=/home/jovyan/upload/rawData/<span class="hljs-variable">$TASKN</span><br><span class="hljs-built_in">mkdir</span> -p <span class="hljs-variable">$rawData</span><br> <br><span class="hljs-built_in">cd</span> <span class="hljs-variable">$ROOTDIR</span><br><span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> `<span class="hljs-built_in">cat</span> SRR_Acc_List.txt`<br><span class="hljs-keyword">do</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$file</span><br><span class="hljs-built_in">mkdir</span> <span class="hljs-variable">$rawData</span>/<span class="hljs-variable">$file</span><br><span class="hljs-built_in">cd</span> <span class="hljs-variable">$rawData</span>/<span class="hljs-variable">$file</span><br>fasterq-dump --split-3 <span class="hljs-variable">$ROOTDIR</span>/<span class="hljs-variable">$file</span> -e 6<br>pigz -p 6 *<br><span class="hljs-keyword">done</span><br></code></pre></td></tr></table></figure>
- <h3 id="rawData质控">rawData质控</h3>
- <ul>
- <li><a href="https://hexo.limour.top/go/#aHR0cHM6Ly96aHVhbmxhbi56aGlodS5jb20vcC8yODgwMjA4Mw==" rel="noopener external nofollow noreferrer">原始数据质量判断</a></li>
- <li><a href="https://hexo.limour.top/go/#aHR0cHM6Ly96aHVhbmxhbi56aGlodS5jb20vcC8yODkyNDc5Mw==" rel="noopener external nofollow noreferrer">原始数据过滤工具</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><code class="hljs bash">nano qc.sh && <span class="hljs-built_in">chmod</span> +x qc.sh<br>./qc.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置rawData存放目录</span><br>rawData=/home/jovyan/upload/rawData/<span class="hljs-variable">$TASKN</span><br><span class="hljs-comment">#设置qc结果的输出目录</span><br>QCDIR=/home/jovyan/upload/rawData/<span class="hljs-variable">$TASKN</span><span class="hljs-string">"_fastqc"</span><br><span class="hljs-built_in">mkdir</span> -p <span class="hljs-variable">$QCDIR</span><br> <br><span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> <span class="hljs-variable">$rawData</span>/*<br><span class="hljs-keyword">do</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$file</span><br>SAMPLE=<span class="hljs-variable">${file##*/}</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$QCDIR</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br><span class="hljs-built_in">mkdir</span> <span class="hljs-variable">$QCDIR</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br>fastqc -o <span class="hljs-variable">$QCDIR</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span> --threads=6 `<span class="hljs-built_in">ls</span> <span class="hljs-variable">$rawData</span>/<span class="hljs-variable">$SAMPLE</span>/*`<br><span class="hljs-keyword">done</span><br></code></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 href="https://hexo.limour.top/go/#aHR0cHM6Ly9naXRodWIuY29tL09wZW5HZW5lL2Zhc3Rw" rel="noopener external nofollow noreferrer">fastp的详细说明</a>; <a href="https://hexo.limour.top/go/#aHR0cHM6Ly96aHVhbmxhbi56aGlodS5jb20vcC8zMzYwMTY5MQ==" rel="noopener external nofollow noreferrer">中文介绍</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><code class="hljs bash">nano qc.sh && <span class="hljs-built_in">chmod</span> +x qc.sh<br>./qc.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置rawData存放目录</span><br>rawData=/home/jovyan/upload/rawData/<span class="hljs-variable">$TASKN</span><br><span class="hljs-comment">#设置qc结果的输出目录</span><br>QCDIR=/home/jovyan/upload/rawData/<span class="hljs-variable">$TASKN</span><span class="hljs-string">"_fastp"</span><br><span class="hljs-built_in">mkdir</span> -p <span class="hljs-variable">$QCDIR</span><br><span class="hljs-comment">#设置cleanData的存放目录</span><br>CLEAN=/home/jovyan/upload/cleanData/<span class="hljs-variable">$TASKN</span><br><span class="hljs-built_in">mkdir</span> -p <span class="hljs-variable">$CLEAN</span><br> <br><span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> <span class="hljs-variable">$rawData</span>/*<br><span class="hljs-keyword">do</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$file</span><br>SAMPLE=<span class="hljs-variable">${file##*/}</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$QCDIR</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br><span class="hljs-built_in">mkdir</span> <span class="hljs-variable">$QCDIR</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$CLEAN</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br><span class="hljs-built_in">mkdir</span> <span class="hljs-variable">$CLEAN</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br><span class="hljs-built_in">cd</span> <span class="hljs-variable">$QCDIR</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br>fastp -c -w 4 \<br>-o <span class="hljs-variable">$CLEAN</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/out.R1.fq.gz"</span> \<br>-O <span class="hljs-variable">$CLEAN</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/out.R2.fq.gz"</span> \<br>-h <span class="hljs-variable">$QCDIR</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/fastp.html"</span> \<br>-j <span class="hljs-variable">$QCDIR</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/fastp.json"</span> \<br>-i `<span class="hljs-built_in">ls</span> <span class="hljs-variable">$rawData</span>/<span class="hljs-variable">$SAMPLE</span>/*_1.fastq.gz` \<br>-I `<span class="hljs-built_in">ls</span> <span class="hljs-variable">$rawData</span>/<span class="hljs-variable">$SAMPLE</span>/*_2.fastq.gz`<br><span class="hljs-keyword">done</span><br></code></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><code class="hljs bash">[ 23G] .<br>├── [9.1G] ./SRR799559<br>│ ├── [4.4G] ./SRR799559/out.R1.fq.gz<br>│ └── [4.7G] ./SRR799559/out.R2.fq.gz<br>├── [7.0G] ./SRR799560<br>│ ├── [3.4G] ./SRR799560/out.R1.fq.gz<br>│ └── [3.5G] ./SRR799560/out.R2.fq.gz<br>└── [7.4G] ./SRR799561<br> ├── [3.6G] ./SRR799561/out.R1.fq.gz<br> └── [3.8G] ./SRR799561/out.R2.fq.gz<br></code></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><code class="hljs bash">nano bwa_and_markdup.sh && <span class="hljs-built_in">chmod</span> +x bwa_and_markdup.sh<br>./bwa_and_markdup.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置cleanData的存放目录</span><br>CLEAN=/home/jovyan/upload/cleanData/<span class="hljs-variable">$TASKN</span><br><span class="hljs-comment">#设置RefSeq的存放目录</span><br>RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna<br><span class="hljs-comment">#设置Read Group信息,见 https://gatk.broadinstitute.org/hc/en-us/articles/360035890671-Read-groups</span><br>RGroup_PL=ILLUMINA <span class="hljs-comment"># 所用的测序平台:ILLUMINA,SLX,SOLEXA,SOLID,454,LS454,COMPLETE,PACBIO,IONTORRENT,CAPILLARY,HELICOS或UNKNOWN。CG测序为COMPLETE</span><br>RGroup_SM=<span class="hljs-variable">$TASKN</span> <span class="hljs-comment"># 样本ID,同一个样本可能有多个lane,此时用样本ID相关联</span><br>RGroup=<span class="hljs-string">'PL:'</span><span class="hljs-variable">$RGroup_PL</span><span class="hljs-string">'\tSM:'</span><span class="hljs-variable">$RGroup_SM</span><br><span class="hljs-comment">#设置BAM的存放目录</span><br>BAM=/home/jovyan/upload/BAM/<span class="hljs-variable">$TASKN</span><br><span class="hljs-built_in">mkdir</span> -p <span class="hljs-variable">$BAM</span><br> <br><span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> <span class="hljs-variable">$CLEAN</span>/*<br><span class="hljs-keyword">do</span><br> <br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$file</span><br>SAMPLE=<span class="hljs-variable">${file##*/}</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br><span class="hljs-built_in">mkdir</span> <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br><span class="hljs-built_in">echo</span> <span class="hljs-string">'@RG\tID:'</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">'\t'</span><span class="hljs-variable">$RGroup</span><br> <br><span class="hljs-comment">#1 比对</span><br>bwa mem -t 4 -M -R <span class="hljs-string">'@RG\tID:'</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">'\t'</span><span class="hljs-variable">$RGroup</span> <span class="hljs-variable">$RefSeq</span> `<span class="hljs-built_in">ls</span> <span class="hljs-variable">$CLEAN</span>/<span class="hljs-variable">$SAMPLE</span>/*` \<br>| samtools view -Sb - > <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/raw.bam"</span><br> <br><span class="hljs-comment">#2 排序</span><br>samtools <span class="hljs-built_in">sort</span> -@ 4 -m 4G -O bam -o <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.bam"</span> <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/raw.bam"</span><br><span class="hljs-built_in">rm</span> <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/raw.bam"</span><br> <br><span class="hljs-comment">#3 标记PCR重复</span><br>gatk MarkDuplicates -I <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.bam"</span> \<br>-O <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.markdup.bam"</span> \<br>-M <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.markdup_metrics.txt"</span><br><span class="hljs-built_in">rm</span> <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.bam"</span><br> <br><span class="hljs-comment">#4 创建比对索引文件</span><br>samtools index <span class="hljs-variable">$BAM</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.markdup.bam"</span><br> <br><span class="hljs-keyword">done</span><br></code></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><code class="hljs bash">[ 30G] .<br>├── [ 11G] ./SRR799559<br>│ ├── [ 11G] ./SRR799559/sorted.markdup.bam<br>│ ├── [4.5M] ./SRR799559/sorted.markdup.bam.bai<br>│ └── [3.7K] ./SRR799559/sorted.markdup_metrics.txt<br>├── [8.8G] ./SRR799560<br>│ ├── [8.8G] ./SRR799560/sorted.markdup.bam<br>│ ├── [3.9M] ./SRR799560/sorted.markdup.bam.bai<br>│ └── [3.7K] ./SRR799560/sorted.markdup_metrics.txt<br>└── [9.6G] ./SRR799561<br> ├── [9.5G] ./SRR799561/sorted.markdup.bam<br> ├── [4.1M] ./SRR799561/sorted.markdup.bam.bai<br> └── [3.7K] ./SRR799561/sorted.markdup_metrics.txt<br></code></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><code class="hljs bash">nano merge.sh && <span class="hljs-built_in">chmod</span> +x merge.sh<br>./merge.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置BAM的存放目录</span><br>BAM=/home/jovyan/upload/BAM/<span class="hljs-variable">$TASKN</span><br><span class="hljs-comment">#设置merge后的数据存放目录</span><br>MERGEDBAM=/home/jovyan/upload/merged/<span class="hljs-variable">$TASKN</span>/SAMPLE1<br><span class="hljs-built_in">mkdir</span> -p <span class="hljs-variable">$MERGEDBAM</span><br> <br>samtools merge <span class="hljs-variable">$MERGEDBAM</span><span class="hljs-string">"/sorted.markdup.bam"</span> \<br>`find <span class="hljs-string">"<span class="hljs-variable">$BAM</span>"</span> -name <span class="hljs-string">"sorted.markdup.bam"</span> -<span class="hljs-built_in">type</span> f -<span class="hljs-built_in">exec</span> <span class="hljs-built_in">readlink</span> -f {} \;`<br>samtools index <span class="hljs-variable">$MERGEDBAM</span><span class="hljs-string">"/sorted.markdup.bam"</span><br></code></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><code class="hljs bash">[ 21G] .<br>└── [ 21G] ./SAMPLE1<br> ├── [ 21G] ./SAMPLE1/sorted.markdup.bam<br> └── [6.8M] ./SAMPLE1/sorted.markdup.bam.bai<br></code></pre></td></tr></table></figure>
- <h3 id="局部重比对">局部重比对</h3>
- <ul>
- <li>具体见<a href="https://hexo.limour.top/go/#aHR0cHM6Ly96aHVhbmxhbi56aGlodS5jb20vcC8yOTQ4NTk4Nw==" rel="noopener external nofollow noreferrer">黄树嘉博士的相关介绍</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><code class="hljs bash">nano BQSR.sh && <span class="hljs-built_in">chmod</span> +x BQSR.sh<br>./BQSR.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置merged数据存放目录</span><br>MERGED=/home/jovyan/upload/merged/<span class="hljs-variable">$TASKN</span><br><span class="hljs-comment">#设置RefSeq的存放目录</span><br>RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna<br><span class="hljs-comment">#设置knownSites数据存放目录</span><br>knownSites=/home/jovyan/upload/knownSites<br>knownSites=$(<span class="hljs-built_in">echo</span> $(<span class="hljs-built_in">ls</span> <span class="hljs-variable">$knownSites</span>/*.ncbi.vcf.gz | sed <span class="hljs-string">'s/^/--known-sites /'</span> | <span class="hljs-built_in">tr</span> <span class="hljs-string">'\n'</span> <span class="hljs-string">' '</span>))<br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$knownSites</span><br> <br><span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> <span class="hljs-variable">$MERGED</span>/*<br><span class="hljs-keyword">do</span><br> <br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$file</span><br>SAMPLE=<span class="hljs-variable">${file##*/}</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br> <br>gatk BaseRecalibrator <span class="hljs-variable">$knownSites</span> \<br> -R <span class="hljs-variable">$RefSeq</span> \<br> -I <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.markdup.bam"</span> \<br> -O <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/recal_data.table"</span><br> <br>gatk ApplyBQSR \<br> -R <span class="hljs-variable">$RefSeq</span> \<br> -I <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.markdup.bam"</span> \<br> --bqsr-recal-file <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/recal_data.table"</span> \<br> -O <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.markdup.BQSR.bam"</span><br> <br>samtools index <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.markdup.BQSR.bam"</span><br> <br><span class="hljs-keyword">done</span><br></code></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><code class="hljs bash">[ 54G] .<br>└── [ 54G] ./SAMPLE1<br> ├── [2.5M] ./SAMPLE1/recal_data.table<br> ├── [ 21G] ./SAMPLE1/sorted.markdup.bam<br> ├── [6.8M] ./SAMPLE1/sorted.markdup.bam.bai<br> ├── [8.8M] ./SAMPLE1/sorted.markdup.BQSR.bai<br> ├── [ 33G] ./SAMPLE1/sorted.markdup.BQSR.bam<br> └── [7.6M] ./SAMPLE1/sorted.markdup.BQSR.bam.bai<br></code></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><code class="hljs bash">nano HaplotypeCaller.sh && <span class="hljs-built_in">chmod</span> +x HaplotypeCaller.sh<br>./HaplotypeCaller.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br> <br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置BQSR数据存放目录</span><br>MERGED=/home/jovyan/upload/merged/<span class="hljs-variable">$TASKN</span><br><span class="hljs-comment">#设置RefSeq的存放目录</span><br>RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna<br> <br><span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> <span class="hljs-variable">$MERGED</span>/*<br><span class="hljs-keyword">do</span><br> <br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$file</span><br>SAMPLE=<span class="hljs-variable">${file##*/}</span><br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><br> <br>gatk --java-options <span class="hljs-string">"-Xmx4g"</span> HaplotypeCaller -ERC GVCF \<br> -R <span class="hljs-variable">$RefSeq</span> \<br> -I <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/sorted.markdup.BQSR.bam"</span> \<br> -O <span class="hljs-variable">$MERGED</span><span class="hljs-string">"/"</span><span class="hljs-variable">$SAMPLE</span><span class="hljs-string">"/HC.g.vcf.gz"</span><br> <br><span class="hljs-keyword">done</span><br></code></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><code class="hljs bash">VCFPATH=<span class="hljs-variable">$MERGED</span><span class="hljs-string">'/SAMPLE1'</span><br></code></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><code class="hljs bash">nano CombineGVCFs.sh && <span class="hljs-built_in">chmod</span> +x CombineGVCFs.sh<br>./CombineGVCFs.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br> <br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置BQSR数据存放目录</span><br>MERGED=/home/jovyan/upload/merged/<span class="hljs-variable">$TASKN</span><br><span class="hljs-comment">#设置RefSeq的存放目录</span><br>RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna<br><span class="hljs-comment">#设置最后输出的路径</span><br>VCFPATH=/home/jovyan/upload/VCF/<span class="hljs-variable">$TASKN</span><br><span class="hljs-built_in">mkdir</span> -p <span class="hljs-variable">$VCFPATH</span><br> <br>variant=$(<span class="hljs-built_in">echo</span> $(<span class="hljs-built_in">ls</span> <span class="hljs-variable">$MERGED</span>/*/HC.g.vcf.gz | sed <span class="hljs-string">'s/^/--variant /'</span> | <span class="hljs-built_in">tr</span> <span class="hljs-string">'\n'</span> <span class="hljs-string">' '</span>))<br><span class="hljs-built_in">echo</span> <span class="hljs-variable">$variant</span><br> <br>gatk CombineGVCFs $<span class="hljs-variable">$variant</span> \<br> -R <span class="hljs-variable">$RefSeq</span> \<br> -O <span class="hljs-variable">$VCFPATH</span><span class="hljs-string">'/HC.g.vcf.gz'</span><br></code></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><code class="hljs bash">nano GenotypeGVCFs.sh && <span class="hljs-built_in">chmod</span> +x GenotypeGVCFs.sh<br>./GenotypeGVCFs.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br> <br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置BQSR数据存放目录</span><br>MERGED=/home/jovyan/upload/merged/<span class="hljs-variable">$TASKN</span><br><span class="hljs-comment">#设置RefSeq的存放目录</span><br>RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna<br><span class="hljs-comment">#设置最后输出的路径</span><br>VCFPATH=<span class="hljs-variable">$MERGED</span><span class="hljs-string">'/SAMPLE1'</span><br><span class="hljs-built_in">mkdir</span> -p <span class="hljs-variable">$VCFPATH</span><br> <br>gatk --java-options <span class="hljs-string">"-Xmx4g"</span> GenotypeGVCFs \<br> -R <span class="hljs-variable">$RefSeq</span> \<br> -V <span class="hljs-variable">$VCFPATH</span><span class="hljs-string">'/HC.g.vcf.gz'</span> \<br> -O <span class="hljs-variable">$VCFPATH</span><span class="hljs-string">'/HC.vcf.gz'</span><br></code></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><code class="hljs bash">├── [6.8G] ./HC.g.vcf.gz<br>├── [5.0M] ./HC.g.vcf.gz.tbi<br>├── [127M] ./HC.vcf.gz<br>├── [2.0M] ./HC.vcf.gz.tbi<br></code></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><code class="hljs bash">nano VQSR.sh && <span class="hljs-built_in">chmod</span> +x VQSR.sh<br>./VQSR.sh<br></code></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><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">source</span> activate GATK4<br> <br><span class="hljs-comment">#任务名</span><br>TASKN=SRX247249<br><span class="hljs-comment">#设置BQSR数据存放目录</span><br>MERGED=/home/jovyan/upload/merged/<span class="hljs-variable">$TASKN</span><br><span class="hljs-comment">#设置RefSeq的存放目录</span><br>RefSeq=/home/jovyan/data/refseq/GRCh38.p14.fna<br><span class="hljs-comment">#设置最后输出的路径</span><br>VCFPATH=<span class="hljs-variable">$MERGED</span><span class="hljs-string">'/SAMPLE1'</span><br><span class="hljs-comment">#设置knownSites数据存放目录</span><br>knownSites=/home/jovyan/upload/knownSites<br> <br>gatk VariantRecalibrator \<br> -R <span class="hljs-variable">$RefSeq</span> \<br> -V <span class="hljs-variable">$VCFPATH</span><span class="hljs-string">'/HC.vcf.gz'</span> \<br> --resource:hapmap,known=<span class="hljs-literal">false</span>,training=<span class="hljs-literal">true</span>,truth=<span class="hljs-literal">true</span>,prior=15.0 <span class="hljs-variable">$knownSites</span>/hapmap_3.3.hg38.ncbi.vcf.gz \<br> --resource:dbsnp,known=<span class="hljs-literal">true</span>,training=<span class="hljs-literal">false</span>,truth=<span class="hljs-literal">false</span>,prior=2.0 <span class="hljs-variable">$knownSites</span>/GRCh38.dbSNP.ncbi.vcf.gz \<br> -an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR \<br> -mode SNP \<br> -O <span class="hljs-variable">$VCFPATH</span>/snp.recal \<br> --tranches-file <span class="hljs-variable">$VCFPATH</span>/snp.tranches \<br> --rscript-file <span class="hljs-variable">$VCFPATH</span>/snp.plots.R<br> <br>gatk ApplyVQSR \<br> -R <span class="hljs-variable">$RefSeq</span> \<br> -V <span class="hljs-variable">$VCFPATH</span><span class="hljs-string">'/HC.vcf.gz'</span> \<br> -O <span class="hljs-variable">$VCFPATH</span><span class="hljs-string">'/snp.VQSR.vcf.gz'</span> \<br> --truth-sensitivity-filter-level 99.0 \<br> --tranches-file <span class="hljs-variable">$VCFPATH</span>/snp.tranches \<br> --recal-file <span class="hljs-variable">$VCFPATH</span>/snp.recal \<br> -mode SNP<br> <br>gatk VariantRecalibrator \<br> -R <span class="hljs-variable">$RefSeq</span> \<br> -V <span class="hljs-variable">$VCFPATH</span><span class="hljs-string">'/snp.VQSR.vcf.gz'</span> \<br> --resource:dbindel,known=<span class="hljs-literal">true</span>,training=<span class="hljs-literal">false</span>,truth=<span class="hljs-literal">false</span>,prior=2.0 <span class="hljs-variable">$knownSites</span>/Homo_sapiens_assembly38.known_indels.ncbi.vcf.gz \<br> --resource:mills,known=<span class="hljs-literal">true</span>,training=<span class="hljs-literal">true</span>,truth=<span class="hljs-literal">true</span>,prior=12.0 <span class="hljs-variable">$knownSites</span>/Mills_and_1000G_gold_standard.indels.hg38.ncbi.vcf.gz \<br> -an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR \<br> -mode INDEL --max-gaussians 6 \<br> -O <span class="hljs-variable">$VCFPATH</span>/snp.indel.recal \<br> --tranches-file <span class="hljs-variable">$VCFPATH</span>/snp.indel.tranches \<br> --rscript-file <span class="hljs-variable">$VCFPATH</span>/snp.indel.plots.R<br> <br>gatk ApplyVQSR \<br> -R <span class="hljs-variable">$RefSeq</span> \<br> -V <span class="hljs-variable">$VCFPATH</span><span class="hljs-string">'/snp.VQSR.vcf.gz'</span> \<br> -O <span class="hljs-variable">$VCFPATH</span><span class="hljs-string">'/snp.indel.VQSR.vcf.gz'</span> \<br> --truth-sensitivity-filter-level 99.0 \<br> --tranches-file <span class="hljs-variable">$VCFPATH</span>/snp.indel.tranches \<br> --recal-file <span class="hljs-variable">$VCFPATH</span>/snp.indel.recal \<br> -mode INDEL<br></code></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><code class="hljs bash">├── [2.7M] ./snp.plots.R<br>├── [6.2M] ./snp.plots.R.pdf<br>├── [199M] ./snp.recal<br>├── [7.5M] ./snp.recal.idx<br>├── [ 584] ./snp.tranches<br>├── [7.5K] ./snp.tranches.pdf<br>├── [151M] ./snp.VQSR.vcf.gz<br>├── [2.0M] ./snp.VQSR.vcf.gz.tbi<br>├── [2.8M] ./snp.indel.plots.R<br>├── [6.2M] ./snp.indel.plots.R.pdf<br>├── [ 35M] ./snp.indel.recal<br>├── [256K] ./snp.indel.recal.idx<br>├── [ 595] ./snp.indel.tranches<br>├── [153M] ./snp.indel.VQSR.vcf.gz<br>├── [2.0M] ./snp.indel.VQSR.vcf.gz.tbi<br></code></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><code class="hljs bash"><span class="hljs-comment"># tabix snp.VQSR.vcf.gz NC_000001.11 | head -n 5</span><br>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<br>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<br>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<br>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<br>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<br></code></pre></td></tr></table></figure>
- <h2 id="变异注释">变异注释</h2>
- <h3 id="安装-VEP">安装 VEP</h3>
- <ul>
- <li><a href="https://hexo.limour.top/go/#aHR0cDovL3d3dy5lbnNlbWJsLm9yZy9pbmZvL2RvY3MvdG9vbHMvdmVwL2luZGV4Lmh0bWw=" rel="noopener external nofollow noreferrer">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><code class="hljs bash">sudo docker pull ensemblorg/ensembl-vep<br>sudo docker run --<span class="hljs-built_in">rm</span> -t -i -v ~/upload:/data:z ensemblorg/ensembl-vep <span class="hljs-built_in">pwd</span><br>sudo docker run --<span class="hljs-built_in">rm</span> -t -i -v ~/upload:/data:z ensemblorg/ensembl-vep <span class="hljs-built_in">ls</span> -al /opt/vep/<br>sudo <span class="hljs-built_in">mkdir</span> -p ~/upload/vep && sudo <span class="hljs-built_in">chmod</span> 777 ~/upload/vep<br>sudo docker run --<span class="hljs-built_in">rm</span> -t -i -v ~/upload:/data:z -v ~/upload/vep:/opt/vep/.vep:z ensemblorg/ensembl-vep INSTALL.pl<br><span class="hljs-comment"># sudo docker run --rm -t -i -v ~/upload:/data:Z ensemblorg/ensembl-vep cat INSTALL.pl > INSTALL.pl</span><br><span class="hljs-comment"># 自行分析 INSTALL.pl,构造下载后的结构,以下是104版本的</span><br><span class="hljs-comment"># 太慢了,手动下载,请各显神通,下载地址来自上一步的输出</span><br>wget https://ftp.ensembl.org/pub/release-104/variation/indexed_vep_cache/homo_sapiens_vep_104_GRCh38.tar.gz -O ~/upload/vep<br>tar -zxvf homo_sapiens_vep_104_GRCh38.tar.gz<br></code></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><code class="hljs bash"><span class="hljs-built_in">mkdir</span> -p ~/upload/VEP/SRX247249 && <span class="hljs-built_in">chmod</span> -R 777 ~/upload/VEP/SRX247249<br><span class="hljs-comment"># mv ~/data/refseq ~/upload</span><br><span class="hljs-comment"># chmod -R 777 ~/upload/refseq</span><br><span class="hljs-comment"># chmod -R 777 ~/upload/vep</span><br><span class="hljs-comment"># chmod -R 777 ~/upload/merged/SRX247249</span><br>sudo docker run --<span class="hljs-built_in">rm</span> -t -i -v ~/upload:/data:z ensemblorg/ensembl-vep \<br> vep --fasta /data/refseq/GRCh38.p14.fna \<br> --format vcf --vcf --fork 4 --hgvs --force_overwrite --everything \<br> --offline --dir_cache /data/vep \<br> -i /data/merged/SRX247249/SAMPLE1/snp.indel.VQSR.vcf.gz \<br> -o /data/merged/SRX247249/SAMPLE1/snp.indel.VQSR.VEP.vcf<br><span class="hljs-comment"># sudo chmod 777 ~/upload/merged/SRX247249/SAMPLE1/snp.indel.VQSR.VEP.vcf</span><br><span class="hljs-comment"># pbgzip -n 4 snp.indel.VQSR.VEP.vcf</span><br><span class="hljs-comment"># tabix -p vcf snp.indel.VQSR.VEP.vcf.gz</span><br></code></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><code class="hljs bash">├── [346M] ./snp.indel.VQSR.VEP.vcf.gz<br>├── [210K] ./snp.indel.VQSR.VEP.vcf.gz_summary.html<br>├── [1.6M] ./snp.indel.VQSR.VEP.vcf.gz.tbi<br>├── [8.2K] ./snp.indel.VQSR.VEP.vcf.gz_warnings.txt<br></code></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><code class="hljs bash"><span class="hljs-comment"># tabix snp.indel.VQSR.VEP.vcf.gz NC_000001.11 | head -n 2</span><br>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<br>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<br></code></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-cc-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-cc-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-cc-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.css')
- Fluid.utils.createScript('https://cdn.staticfile.org/waline/2.15.5/waline.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>
|