<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>STOGQY | Bio</title>
    <description>Welcome to my blog! </description>
    <link>https://stogqy.github.io/</link>
    <atom:link href="https://stogqy.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 08 Sep 2023 11:23:26 +0800</pubDate>
    <lastBuildDate>Fri, 08 Sep 2023 11:23:26 +0800</lastBuildDate>
    <generator>Jekyll v3.9.3</generator>
    
      <item>
        <title>SHELL学习</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#基本用法&quot; id=&quot;markdown-toc-基本用法&quot;&gt;基本用法&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;基本用法&quot;&gt;基本用法&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;{} () [] [[]]&lt;/li&gt;
&lt;/ul&gt;

{}跟python的差不多，${var}等价于$var。
()在脚本中等价于反引号，可增加代码的可读性。
方括号语句为[ “$HOME” == “$pwd” ]，注意里面的空格。在bash里面[]里面用== &amp;gt; 之类的似乎不用转义，但在zsh里面须用/转义。
此时用[[]]就可以不用转义直接使用 == &amp;lt; &amp;gt;等比较符。所以一般用[[]]多。

&lt;ul&gt;
  &lt;li&gt;if语句&lt;/li&gt;
&lt;/ul&gt;

if [条件]; then
&lt;do thins=&quot;&quot; here=&quot;&quot;&gt;
fi

- while

while [conditions] 
do
  &lt;do things=&quot;&quot; here=&quot;&quot;&gt;
done

- for

for var in con1 con2 con3 ...
do
  &lt;do things=&quot;&quot; here=&quot;&quot;&gt;
done

for ( ( i=1; i&amp;lt;=$var; i=i+1 ) )
do
  &lt;do things=&quot;&quot; here=&quot;&quot;&gt;
done

- case

case $var in 
  &quot;one&quot; )
    &lt;do things=&quot;&quot; here=&quot;&quot;&gt;
    ;;
  &quot;two&quot; ) 
    &lt;do things=&quot;&quot; here=&quot;&quot;&gt;
    ;;
  &quot;three&quot; )
    &lt;do things=&quot;&quot; here=&quot;&quot;&gt;
    ;;
esac

### 引号

单引号不转义，里头改啥就是啥
双引号转义，可以装变量进去
反引号则执行局部代码

### 关于参数

$0  脚本本身
$1  第一个参数
$n  第n个参数
$#  参数的个数
$@  &quot;$1&quot; &quot;$2&quot; ...
$*  &quot;$1 $2 $3 ...&quot;
shift 参数往后滑移一位

&lt;/do&gt;&lt;/do&gt;&lt;/do&gt;&lt;/do&gt;&lt;/do&gt;&lt;/do&gt;&lt;/do&gt;
</description>
        <pubDate>Sat, 02 Sep 2023 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2023/09/02/Shell-learning/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2023/09/02/Shell-learning/</guid>
        
        <category>Tutorial</category>
        
        <category>Coding</category>
        
        <category>Learning</category>
        
        <category>SHELL</category>
        
        
        <category>Tutorials</category>
        
      </item>
    
      <item>
        <title>MySQL学习</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#基本用法&quot; id=&quot;markdown-toc-基本用法&quot;&gt;基本用法&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#登录&quot; id=&quot;markdown-toc-登录&quot;&gt;登录&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#创建数据库&quot; id=&quot;markdown-toc-创建数据库&quot;&gt;创建数据库&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#操作表&quot; id=&quot;markdown-toc-操作表&quot;&gt;操作表&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#约束&quot; id=&quot;markdown-toc-约束&quot;&gt;约束&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#导入数据&quot; id=&quot;markdown-toc-导入数据&quot;&gt;导入数据&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#参考信息源&quot; id=&quot;markdown-toc-参考信息源&quot;&gt;参考信息源&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;基本用法&quot;&gt;基本用法&lt;/h2&gt;
&lt;h3 id=&quot;登录&quot;&gt;登录&lt;/h3&gt;

&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mysql -u &amp;lt;user name&amp;gt; -p -h &amp;lt;host name&amp;gt;&lt;/code&gt;
如过没设置密码就跳过&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-p&lt;/code&gt;，如过本地登录就省掉&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;host name&amp;gt;&lt;/code&gt;。
root用户默认是没有密码的，通过该命令可设置密码：&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mysqladmin -u root password &quot;your_new_password&quot;&lt;/code&gt;
root用户登录后可创建新用户：&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CREATE USER 'username'@'localhost' IDENTIFIED BY 'your_password';&lt;/code&gt;

&lt;h3 id=&quot;创建数据库&quot;&gt;创建数据库&lt;/h3&gt;

MySQL的语法其实就是平铺直叙的文本，通常用大写表示命令。每个独立命令须用&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;;&lt;/code&gt;表示结尾，可以随意换行，跟C语言一样。
显示已有数据库：&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SHOW DATABASES;&lt;/code&gt;
使用某数据库：&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;USE &amp;lt;database name&amp;gt;&lt;/code&gt;
创建数据库：&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CREATE DATABASE &amp;lt;database name&amp;gt;(
    // &amp;lt;col name&amp;gt; &amp;lt;data type&amp;gt; &amp;lt;constrain&amp;gt;
    id varchar(60) primary key,
    seq text
)&lt;/code&gt;
删库：&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DROP DATABASE &amp;lt;database name&amp;gt;&lt;/code&gt;

&lt;h3 id=&quot;操作表&quot;&gt;操作表&lt;/h3&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#查看表中前几行：&lt;/span&gt;
SELECT &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; FROM &amp;lt;table name&amp;gt; LIMIT &amp;lt;row count&amp;gt;
&lt;span class=&quot;c&quot;&gt;#查看表信息：&lt;/span&gt;
DESCRIBE &amp;lt;table name&amp;gt;
&lt;span class=&quot;c&quot;&gt;#查询：&lt;/span&gt;
SELECT &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; FROM &amp;lt;table name&amp;gt; WHERE &amp;lt;condition&amp;gt;
&lt;span class=&quot;c&quot;&gt;#删除表：&lt;/span&gt;
DROP TABLE &amp;lt;table name&amp;gt;
&lt;span class=&quot;c&quot;&gt;#删除数据：&lt;/span&gt;
DELETE FROM TABLE WHERE &amp;lt;condition&amp;gt;
&lt;span class=&quot;c&quot;&gt;#清空&lt;/span&gt;
TRUNCATE &amp;lt;table name&amp;gt;
&lt;span class=&quot;c&quot;&gt;#或者&lt;/span&gt;
DELETE FROM &amp;lt;table name&amp;gt; &lt;span class=&quot;c&quot;&gt;# 前者快速删除不可回滚，后者逐条删除，可回滚。&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 查看表信息&lt;/span&gt;
SHOW TABLE STATUS LIKE &amp;lt;table name&amp;gt; &lt;span class=&quot;se&quot;&gt;\G&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;约束&quot;&gt;约束&lt;/h3&gt;

用于限制表中的数据，为了保证表中数据的准确性和可靠性,不符合约束的数据，插入时就会失败。

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;名称&lt;/th&gt;
      &lt;th&gt;作用&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;NOT NULL&lt;/td&gt;
      &lt;td&gt;非空，用于保证该字段的值不能为空&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;DEFAULT&lt;/td&gt;
      &lt;td&gt;默认值，用于保证该字段有默认值&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;PRIMARY KEY&lt;/td&gt;
      &lt;td&gt;主键，用于保证该字段的值具有唯一性并且非空&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;UNIQUE&lt;/td&gt;
      &lt;td&gt;唯一，用于保证该字段的值具有唯一性，可以为空&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;CHECK&lt;/td&gt;
      &lt;td&gt;检查约束（MySql不支持），检查字段的值是否为指定的值&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;FOREIGN KEY&lt;/td&gt;
      &lt;td&gt;外键，用于限制两个表的关系，用于保证该字段的值必须来自于主表的关联列的值，在从表添加外键约束，用于引用主表中某些的值&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;导入数据&quot;&gt;导入数据&lt;/h3&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# 逐行导入数据&lt;/span&gt;
INSERT INTO &amp;lt;table name&amp;gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&amp;lt;col1&amp;gt;, &amp;lt;col2&amp;gt;, &amp;lt;col3&amp;gt; ... &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; VALUES &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&amp;lt;value1&amp;gt;, &amp;lt;value2&amp;gt;, &amp;lt;value3&amp;gt; ...&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 更新数据&lt;/span&gt;
UPDATE &amp;lt;table name&amp;gt; SET &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&amp;lt;col name&amp;gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &amp;lt;value&amp;gt; &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&amp;lt;col name&amp;gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &amp;lt;value&amp;gt; where &amp;lt;condition&amp;gt; &lt;span class=&quot;c&quot;&gt;#如过不设置codition就对整张表进行更新&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 删除数据&lt;/span&gt;
DELETE FROM TABLE WHERE &amp;lt;condition&amp;gt;
&lt;span class=&quot;c&quot;&gt;# 批量导入，确保local-infile 设置为on&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;global &lt;span class=&quot;nv&quot;&gt;local_infile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;on
&lt;span class=&quot;c&quot;&gt;# 或者在登录的时候加上 --local_infile=1&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 查询local-infile 状态&lt;/span&gt;
SHOW GLOBAL VARIABLES LIKE &lt;span class=&quot;s2&quot;&gt;&quot;local_infile&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 然后就可以导入了&lt;/span&gt;
LOAD DATA INFILE &amp;lt;file path&amp;gt; 
INTO &amp;lt;table name&amp;gt; 
FIELDS TERMINATED BY &lt;span class=&quot;s1&quot;&gt;','&lt;/span&gt;
LINES TERMINATED BY &lt;span class=&quot;s1&quot;&gt;'\n'&lt;/span&gt;
ENCLOSED BY &lt;span class=&quot;s1&quot;&gt;'&quot;'&lt;/span&gt;
CHARACTER SET utf8
IGNORE &amp;lt;num&amp;gt; ROWS


&lt;span class=&quot;c&quot;&gt;# 使用source file.sql批量导入&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 设置关键参数&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;sql_log_bin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;OFF&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;//关闭日志
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;autocommit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;//关闭autocommit自动提交模式
START TRANSACTION&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;//开启事务
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &amp;lt;path to .sql file&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;参考信息源&quot;&gt;参考信息源&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://blog.csdn.net/m0_58878709/article/details/128817956&quot;&gt;MySQL新手快速入门&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://blog.csdn.net/weixin_37095828/article/details/104167399&quot;&gt;mysql快速导入多个大csv文件&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Thu, 17 Aug 2023 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2023/08/17/MySQL-learning/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2023/08/17/MySQL-learning/</guid>
        
        <category>Tutorial</category>
        
        <category>Coding</category>
        
        <category>Learning</category>
        
        <category>Database</category>
        
        <category>MySQL</category>
        
        
        <category>Tutorials</category>
        
      </item>
    
      <item>
        <title>多单拷贝基因串联构建物种发育树</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#基本流程&quot; id=&quot;markdown-toc-基本流程&quot;&gt;基本流程&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#所需软件&quot; id=&quot;markdown-toc-所需软件&quot;&gt;所需软件&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#流程解析&quot; id=&quot;markdown-toc-流程解析&quot;&gt;流程解析&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#通过orthofinder寻找单拷贝同源基因&quot; id=&quot;markdown-toc-通过orthofinder寻找单拷贝同源基因&quot;&gt;通过Orthofinder寻找单拷贝同源基因&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#集成脚本&quot; id=&quot;markdown-toc-集成脚本&quot;&gt;集成脚本&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;em&gt;本文参考自https://www.jianshu.com/p/25e60508a08f， 原作者为：&lt;a href=&quot;https://www.jianshu.com/u/56ef74268ccf&quot;&gt;生信小白2018&lt;/a&gt;&lt;/em&gt;

&lt;h3 id=&quot;基本流程&quot;&gt;基本流程&lt;/h3&gt;

单拷贝同源基因寻找 → 单基因多序列比对 → 串联后构建发育树

&lt;h3 id=&quot;所需软件&quot;&gt;所需软件&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;ul&gt;
    &lt;li&gt;Orthofinder: 寻找单拷贝基因&lt;/li&gt;
    &lt;li&gt;MAFFT: 多序列比对&lt;/li&gt;
    &lt;li&gt;TRIMAL: 多序列比对修剪&lt;/li&gt;
    &lt;li&gt;TRIMAL or FastTree: 串联法(concatenation)构建蛋白质系统发育树&lt;/li&gt;
    &lt;li&gt;ASTRAL: 联合/合并法(coalescence)构建系统发育&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;流程解析&quot;&gt;流程解析&lt;/h3&gt;

&lt;h4 id=&quot;通过orthofinder寻找单拷贝同源基因&quot;&gt;通过Orthofinder寻找单拷贝同源基因&lt;/h4&gt;

以下内容参考自改文章：&lt;a href=&quot;https://www.jianshu.com/p/16e0bbb2ba19&quot;&gt;「基因组学」使用OrthoFinder进行直系同源基因分析&lt;/a&gt;

OrthoFinder的分析过程分为如下几步:

&lt;ol&gt;
  &lt;li&gt;BLAST all-vs-all搜索。使用BLASTP以evalue=10e-3进行搜索，寻找潜在的同源基因。(除了BLAST, 还可以选择DIAMOND和MMSeq2)&lt;/li&gt;
  &lt;li&gt;基于基因长度和系统发育距离对BLAST bit得分进行标准化。&lt;/li&gt;
  &lt;li&gt;使用RBNHs确定同源组序列性相似度的阈值&lt;/li&gt;
  &lt;li&gt;构建直系同源组图(orthogroup graph)，用作MCL的输入&lt;/li&gt;
  &lt;li&gt;使用MCL对基因进行聚类，划分直系同源组&lt;/li&gt;
&lt;/ol&gt;

&lt;img src=&quot;https://raw.githubusercontent.com/stogqy/stogqy.github.io/master/_posts/Pics/20211103/1.png&quot; alt=&quot;img&quot; /&gt;

OrthoFinder2在OrthoFinder的基础上增加了物种系统发育树的构建，流程如下：

&lt;ol&gt;
  &lt;li&gt;为每个直系同源组构建基因系统发育树&lt;/li&gt;
  &lt;li&gt;使用STAG算法从无根基因树上构建无根物种树&lt;/li&gt;
  &lt;li&gt;使用STRIDE算法构建有根物种树&lt;/li&gt;
  &lt;li&gt;有根物种树进一步辅助构建有根基因树&lt;/li&gt;
&lt;/ol&gt;

基于Duplication-Loss-Coalescent 模型，有根基因树可以用来推断物种形成和基因复制事件，最后记录在统计信息中。

&lt;img src=&quot;https://raw.githubusercontent.com/stogqy/stogqy.github.io/master/_posts/Pics/20211103/2.png&quot; alt=&quot;img&quot; /&gt;

OrthoFinder的使用非常方便，一行命令即可，但跑起来比较花时间：

&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;orthofinder -f &amp;lt;folder contains target genomes&amp;gt; -S diamond&lt;/code&gt;

OrthoFinder结果：

运行结束后，会在&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ExampleData&lt;/code&gt;里多出一个文件夹，&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Results_Feb14&lt;/code&gt;, 其中Feb14是我运行的日期

直系同源组相关结果文件，将不同的直系同源基因进行分组。

&lt;blockquote&gt;
  Orthogroups.csv：用制表符分隔的文件，每一行是直系同源基因组对应的基因。
&lt;/blockquote&gt;

&lt;blockquote&gt;
  Orthogroups.txt: 类似于Orthogroups.csv，只不过是OrhtoMCL的输出格式
&lt;/blockquote&gt;

&lt;blockquote&gt;
  Orthogroups_UnassignedGenes.csv: 格式同Orthogroups.csv，只不过是物种特异性的基因
&lt;/blockquote&gt;

&lt;blockquote&gt;
  Orthogroups.GeneCount.csv：格式同Orthogroups.csv, 只不过不再是基因名信息，而是以基因数。
&lt;/blockquote&gt;

直系同源相关文件，分析每个直系同源基因组里的直系同源基因之间关系，结果会在&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Orthologues_Feb14&lt;/code&gt;文件夹下，其中&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Feb14&lt;/code&gt;是日期

&lt;blockquote&gt;
  Gene_Trees: 每个直系同源基因基因组里的基因树
&lt;/blockquote&gt;

&lt;blockquote&gt;
  Recon_Gene_Trees：使用OrthoFinder duplication-loss coalescent 模型进行发育树推断
&lt;/blockquote&gt;

&lt;blockquote&gt;
  Potential_Rooted_Species_Trees: 可能的有根物种树
&lt;/blockquote&gt;

&lt;blockquote&gt;
  SpeciesTree_rooted.txt: 从所有包含STAG支持的直系同源组推断的STAG物种树
&lt;/blockquote&gt;

&lt;blockquote&gt;
  SpeciesTree_rooted_node_labels.txt:  同上，只不过多了一个标签信息，用于解释基因重复数据。
&lt;/blockquote&gt;

比较基因组学的相关结果文件：

&lt;blockquote&gt;
  Orthogroups_SpeciesOverlaps.csv： 不同物种间的同源基因的交集
&lt;/blockquote&gt;

&lt;blockquote&gt;
  SingleCopyOrthogroups.txt： 单基因拷贝组的编号
&lt;/blockquote&gt;

&lt;blockquote&gt;
  Statistics_Overall.csv：总体统计信息
&lt;/blockquote&gt;

&lt;blockquote&gt;
  Statistics_PerSpecies.csv：分物种统计信息
&lt;/blockquote&gt;

STAG是一种从所有基因推测物种树的算法，不同于使用单拷贝的直系同源基因进行进化树构建。

&lt;em&gt;一些重要概念：&lt;/em&gt;

&lt;ul&gt;
  &lt;li&gt;
    Species-specific orthogroup: 一个仅来源于一个物种的直系同源组
  &lt;/li&gt;
  &lt;li&gt;
    Single-copy orthogroup:  在直系同源组中，每个物种里面只有一个基因。我们会用单拷贝直系同源组里的基因推断物种树以及其他数据分析。
  &lt;/li&gt;
  &lt;li&gt;
    Unassigned gene: 无法和其他基因进行聚类的基因。
  &lt;/li&gt;
  &lt;li&gt;
    G50和O50，指的是当你直系同源组按照基因数从大到小进行排列，然后累加，当加入某个组后，累计基因数大于50%的总基因数，那么所需要的直系同源组的数目就是O50，该组的基因树就是G50.
  &lt;/li&gt;
&lt;/ul&gt;

Orthogroups, Orthologs 和 Paralogs 这三个概念推荐看图理解。

&lt;img src=&quot;https://raw.githubusercontent.com/stogqy/stogqy.github.io/master/_posts/Pics/20211103/3.png&quot; alt=&quot;img&quot; /&gt;

&lt;ol&gt;
  &lt;li&gt;利用MAFFT进行单同源基因的多序列比对&lt;/li&gt;
&lt;/ol&gt;

&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mafft&amp;lt;input.faa&amp;gt; &amp;gt; &amp;lt;outpuit_aligned.mafft&amp;gt;&lt;/code&gt;

&lt;ol&gt;
  &lt;li&gt;TRIMAL修剪多序列比对结果&lt;/li&gt;
&lt;/ol&gt;

&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;trimal -in &amp;lt;input_aligned.mafft&amp;gt; -out &amp;lt;input_aligned.mafft.trimed&amp;gt;  -automated1&lt;/code&gt;

&lt;ol&gt;
  &lt;li&gt;Concatenation法进行系统发育分析&lt;/li&gt;
&lt;/ol&gt;

将上述trim好的多序列比对结果按照物种顺序进行串联，然后用RaxML或者FastTree进行分析。

&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;raxml -T &amp;lt;thread using&amp;gt; -f a -N &amp;lt;boostrap such as 100&amp;gt; -m &amp;lt;model such as JTT&amp;gt; -x 123456 -p 123456 -s &amp;lt;concatenated_alignment&amp;gt; -n &amp;lt;output.nwk&amp;gt;&lt;/code&gt;

&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FastTree &amp;lt;concatenated_alignment&amp;gt; &amp;gt; &amp;lt;ouput.nwk&amp;gt;&lt;/code&gt;

&lt;ol&gt;
  &lt;li&gt;Coalescence法进行系统发育分析&lt;/li&gt;
&lt;/ol&gt;

先用RaxML或者FastTree对每个单拷贝基因进行分析，然后用ASTRAL聚合：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# single gene tree&lt;/span&gt;
raxml &lt;span class=&quot;nt&quot;&gt;-T&lt;/span&gt; &amp;lt;thread using&amp;gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; a &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; &amp;lt;boostrap such as 100&amp;gt; &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &amp;lt;model such as JTT&amp;gt; &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt; 123456 &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 123456 &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &amp;lt;SingleGene_alignment&amp;gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &amp;lt;SingleGene_output.nwk&amp;gt;
&lt;span class=&quot;c&quot;&gt;# concatenation&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &amp;lt;all SingleGene_alignment&amp;gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &amp;lt;allSingleGenes_tree.nwk &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# bootstrap ana&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &amp;lt;all bootstrap file&amp;gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &amp;lt;allSingleGenes_bootstrap.txt&amp;gt;
&lt;span class=&quot;c&quot;&gt;# ASTRAL&lt;/span&gt;
java &lt;span class=&quot;nt&quot;&gt;-jar&lt;/span&gt; ASTRAL &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; allSingleGenes_tree.nwk &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; allSingleGenes_bootstrap.txt &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &amp;lt;boostrap&amp;gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &amp;lt;ASTRAL_out.res&amp;gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;nb&quot;&gt;tail&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 1 &amp;lt;ASTRAL_out.res&amp;gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &amp;lt;ASTRAL_out.res.nwk&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;集成脚本&quot;&gt;集成脚本&lt;/h3&gt;

该脚本参考自https://github.com/dongwei1220/EasySpeciesTree， 但做了一些适当的修改

</description>
        <pubDate>Thu, 22 Jul 2021 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2021/07/22/Polygen_phylogeny/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2021/07/22/Polygen_phylogeny/</guid>
        
        <category>Biology</category>
        
        <category>Bioinfo</category>
        
        <category>OrthoFinder</category>
        
        <category>RaxML</category>
        
        <category>FastTree</category>
        
        <category>ASTRAL</category>
        
        
        <category>Biotech</category>
        
      </item>
    
      <item>
        <title>Mash: 使用MinHash快速估算基因距离</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#mash-使用minhash快速估算基因距离&quot; id=&quot;markdown-toc-mash-使用minhash快速估算基因距离&quot;&gt;Mash: 使用MinHash快速估算基因距离&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#软件安装与示例&quot; id=&quot;markdown-toc-软件安装与示例&quot;&gt;软件安装与示例&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;em&gt;本文来自https://www.jianshu.com/p/cd81971b0c03， 原作者为：lakeseafly&lt;/em&gt;

&lt;h2 id=&quot;mash-使用minhash快速估算基因距离&quot;&gt;Mash: 使用MinHash快速估算基因距离&lt;/h2&gt;

Mash扩展了MinHash降维技术，使其成对的突变距离和P值显着性检验，从而可以有效地聚类和搜索大量序列集合。混搭将大序列和序列集还原为较小的代表性草图，进而可以快速估计基因组之前全局突变距离。MASH能用于聚类NCBI RefSeq中所有的基因组，基于组装或者它的reads的实时的基因组聚类，聚类大量的宏基因组数据集。 该工具最终发表在Genome Biology上。

&lt;h3 id=&quot;软件安装与示例&quot;&gt;软件安装与示例&lt;/h3&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#下载&lt;/span&gt;
wget https://github.com/marbl/Mash/releases/download/v2.2/mash-Linux64-v2.3.tar
&lt;span class=&quot;nb&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-xvf&lt;/span&gt; mash-Linux64-v2.3.tar	&lt;span class=&quot;c&quot;&gt;#即可使用&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#具体参数见帮助&lt;/span&gt;
Mash version 2.2
Type &lt;span class=&quot;s1&quot;&gt;'mash --license'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;license and copyright information.
Usage:
  mash &amp;lt;&lt;span class=&quot;nb&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;options] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;arguments ...]
Commands:
  bounds    Print a table of Mash error bounds.
  dist      Estimate the distance of query sequences to references.
  info      Display information about sketch files.
  &lt;span class=&quot;nb&quot;&gt;paste     &lt;/span&gt;Create a single sketch file from multiple sketch files.
  screen    Determine whether query sequences are within a larger mixture of
            sequences.
  sketch    Create sketches &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;reduced representations &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;fast operations&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
  triangle  Estimate a lower-triangular distance matrix.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Mash 提供两个基本功能用于序列之间的比对 sketch 和 dist。 sketch 功能将序列转化为哈希结构图，生成一个.mash文件。 dist 功能比对 序列之前的sketches结果并且返回 Jaccard index的估计值P值，还有Mash距离, 这些值能用于估计一个简单进化模型的序列突变率。
因此快速比对时可以采用先生成sketch文件，然后再计算距离的方式，分步运行。

&lt;strong&gt;估计俩基因组的mash distance&lt;/strong&gt;

实际上已经有更好的实现方式了，原作者在Mash的的基础上开发了FastANI，用于快速比对基因组相似性，相关研究于2018年发表在Nature communications上。

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget https://gembox.cbcb.umd.edu/mash/genome1.fna
wget https://gembox.cbcb.umd.edu/mash/genome2.fna
&lt;span class=&quot;c&quot;&gt;#如果一次运行：&lt;/span&gt;
mash dist genome1.fna genome2.fna
&lt;span class=&quot;c&quot;&gt;#它将返回如下结果：&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;###Reference-ID, Query-ID, Mash-distance, P-value, and Matching-hashes&lt;/span&gt;
genome1.fna   genome2.fna     0.0222766       0       456/1000
&lt;span class=&quot;c&quot;&gt;#还可以分步运行：&lt;/span&gt;
mash sketch genome1.fna&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; mash sketch genome2.fna&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
mash dist genome1.fna.msh genome2.fna.msh
&lt;span class=&quot;c&quot;&gt;#这样得到的结果是一样的&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
除了基因组序列外，该功能还能直接应用到序列的reads中（fastq文件）。通过计算不同fastq文件之间的遗传距离，并将遗传距离结果整合可视化，你可以快速的得到你的不同个体测序序列之间的遗传关系：
关于如何具体建树我这里就不细说，但是给大家推荐一个非常实用的Github网站，这个网站已经将Mash构树的过程封装好为mashtree，使用起来非常方便。Github链接：https://github.com/lskatz/mashtree
不过这玩意要装的东西有点多，我没功夫弄它……

&lt;strong&gt;构建本地序列的mash数据库进行遗传距离分析&lt;/strong&gt;

除了上面介绍的例子之外，mash还支持使用已知的序列构建本地的数据库，然后利用该构建的数据库，来对其它序列进行遗传距离的分析。使用刚刚下载好的genome1.fna和genome2.fna进行本地mash数据库的构建：

&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mash sketch -o reference genome1.fna genome2.fna&lt;/code&gt;

构建好后可以使用info功能对构建好的数据库进行检查：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mash info reference.msh
&lt;span class=&quot;c&quot;&gt;###输出数据库的信息，证明数据库构成功：&lt;/span&gt;
Header:
  Hash &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;seed&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;:          MurmurHash3_x64_128 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;42&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  K-mer size:                    21 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;64-bit hashes&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  Alphabet:                      ACGT &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;canonical&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  Target min-hashes per sketch:  1000
  Sketches:                      2

Sketches:
  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Hashes]  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Length]  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;ID]         &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Comment]

  1000      4639675   genome1.fna  gi|49175990|ref|NC_000913.2| Escherichia coli str. K-12 substr. MG1655, &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;genome

  1000      5498450   genome2.fna  gi|47118301|dbj|BA000007.2| Escherichia coli O157:H7 str. Sakai DNA, &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;genome

&lt;span class=&quot;c&quot;&gt;#下载新的序列，与构建好的mash数据库进行遗传距离比对：&lt;/span&gt;
wget https://gembox.cbcb.umd.edu/mash/genome3.fna
mash dist reference.msh genome3.fna
&lt;span class=&quot;c&quot;&gt;###结果显示genome3.fna与数据库的比对结果，可以发现genome1和genome3遗传具体是完全一致的（同一个样本）：&lt;/span&gt;
genome1.fna     genome3.fna     0       0       1000/1000
genome2.fna     genome3.fna     0.0222766       0       456/1000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;strong&gt;与已构建好的RefSeq sketch数据库进行遗传距离比对&lt;/strong&gt;

除了自己构建mash sketch数据库外，我们当然可以下载一些已经构建好的数据库。最常用的要数RefSeq sketch数据库。

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget https://gembox.cbcb.umd.edu/mash/refseq.genomes.k21s1000.msh
&lt;span class=&quot;c&quot;&gt;#由于mash没有给出测试文件，这里从我自己服务器中大豆的数据中抽取一部分进行测试：&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 1600 SRR7817178_1.fq &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; test_1.fq
&lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 1600 SRR7817178_2.fq &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; test_2.fq
&lt;span class=&quot;nb&quot;&gt;cat &lt;/span&gt;test_1.fq test_2.fq &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;reads.fastq
&lt;span class=&quot;c&quot;&gt;#这里使用-m 2参数来进一步提高结果的质量，这个参数会忽略掉低质量的单拷贝的k-mer：&lt;/span&gt;
mash sketch &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; 2 reads.fastq
&lt;span class=&quot;c&quot;&gt;#使用已下载好的RefSeq数据库，对序列的reads进行遗传相关系查询：&lt;/span&gt;
mash dist refseq.genomes.k21s1000.msh reads.fastq.msh &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; distances.tab
&lt;span class=&quot;c&quot;&gt;#查看结果：&lt;/span&gt;
GCF_000004515.4_Glycine_max_v2.0_genomic.fna.gz reads.fastq     0.295981        2.36893e-05     1/1000
GCF_000297375.1_ASM29737v1_genomic.fna.gz       reads.fastq     0.295981        2.25234e-05     1/1000
GCF_000400935.1_ASM40093v1_genomic.fna.gz       reads.fastq     0.295981        2.16808e-05     1/1000
GCF_000400955.1_ASM40095v1_genomic.fna.gz       reads.fastq     0.295981        2.16542e-05     1/1000
GCF_000837185.1_ViralProj14097_genomic.fna.gz   reads.fastq     0.295981        1.63576e-05     1/1000
GCF_001411555.1_wgs.5d_genomic.fna.gz   reads.fastq     0.295981        2.36883e-05     1/1000
GCF_001578535.1_ASM157853v1_genomic.fna.gz      reads.fastq     0.295981        1.98188e-05     1/1000
GCF_001662445.1_ASM166244v1_genomic.fna.gz      reads.fastq     0.295981        2.31897e-05     1/1000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
首先可以看到这些reads是和大豆(G.max)有较近的遗传距离，另外reads里面还含有一些污染，与其它细菌病毒有关系。

这里我们可以发现，mash是可以将reads的污染检测出来。事实上，mash提供了screen功能专门用于污染检测：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mash screen &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; 4 refseq.genomes.k21s1000.msh|sort &lt;span class=&quot;nt&quot;&gt;-gr&lt;/span&gt; |head
&lt;span class=&quot;c&quot;&gt;#结果如下&lt;/span&gt;
0.799067        9/1000  1       6.84538e-42     GCF_001343725.1_ViralMultiSegProj188731_genomic.fna.gz  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2 seqs] NC_020234.1 Rosellinia necatrix partitivirus 2 RdRp gene &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;RNA-dependent RNA polymerase, co                                                             mplete cds &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;...]
0.798763        6/672   1       2.34994e-28     GCF_000899295.1_ViralProj176433_genomic.fna.gz  NC_018671.1 Sauropus leaf curl disease associated DNA beta, &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;genome
0.783786        6/1000  3       2.57053e-27     GCF_001401365.1_ViralProj299179_genomic.fna.gz  NC_028095.1 Torulaspora delbrueckii dsRNA Mbarr-1 killer virus strain EX1180 Kbarr-1 killer toxin gene, comple                                                             te cds
0.758374        2/666   1       2.73245e-09     GCF_000922435.1_ViralProj259986_genomic.fna.gz  NC_024777.1 Small begomovirus-associated satellite isolate Sa19-S1, &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;sequence
0.758338        3/1000  1       2.27756e-13     GCF_000911175.1_ViralMultiSegProj225924_genomic.fna.gz  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2 seqs] NC_022616.1 Red clover cryptic virus 1 isolate IPP_Nemaro segment 1 RNA-dependent RNA polymer                                                             ase gene, &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;cds &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;...]
0.743837        2/1000  27      6.16326e-09     GCF_001590135.1_ViralProj314638_genomic.fna.gz  NC_029628.1 Lake Sarah-associated circular virus-21 isolate LSaCV-21-LSMU-2013, &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;sequence
0.743837        2/1000  2       6.16326e-09     GCF_000928835.1_ViralProj268860_genomic.fna.gz  NC_025790.1 Black sea bass polyomavirus 1 isolate 2835, &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;genome
0.743837        2/1000  2       6.16326e-09     GCF_000888115.1_ViralProj45931_genomic.fna.gz   NC_013801.1 Croton yellow vein mosaic alphasatellite, &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;genome
0.743837        2/1000  2       6.16326e-09     GCF_000848385.1_ViralProj14678_genomic.fna.gz   NC_001782.1 Saccharomyces cerevisiae killer virus M1, &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;genome
0.743837        2/1000  2       6.16326e-09     GCF_000004515.4_Glycine_max_v2.0_genomic.fna.gz &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;1191 seqs] NC_016088.2 Glycine max cultivar Williams 82 chromosome 1, Glycine_max_v2.0, whole genome shotgun   
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
可以看到相对上面的结果，screen功能能够输出更加清晰的污染检测结果，包括了identity, shared-hashes, median-multiplicity, p-value, query-ID, query-comment等一系列的信息，更便于污染检测。

</description>
        <pubDate>Thu, 22 Jul 2021 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2021/07/22/Mash/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2021/07/22/Mash/</guid>
        
        <category>Biology</category>
        
        <category>Bioinfo</category>
        
        <category>Mash</category>
        
        <category>MinMash</category>
        
        <category>ANI</category>
        
        
        <category>Biotech</category>
        
      </item>
    
      <item>
        <title>树莓派</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#搭建aria2下载&quot; id=&quot;markdown-toc-搭建aria2下载&quot;&gt;搭建aria2下载&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;em&gt;本文持续更新&lt;/em&gt;

&lt;h2 id=&quot;搭建aria2下载&quot;&gt;搭建aria2下载&lt;/h2&gt;

我采用的是aria2+nginx的组合，可实现局域网内树莓派离机下载。

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#下载aria2和nginx&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;aria2 nginx
&lt;span class=&quot;c&quot;&gt;#配置aria2&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; .aria2
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; .aria2
&lt;span class=&quot;nb&quot;&gt;touch &lt;/span&gt;aria2.conf aria2.session
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

以下为aria2.conf的内容：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;## 文件保存相关 ##&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 文件保存目录&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/home/pi/Downloads
&lt;span class=&quot;c&quot;&gt;# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M&lt;/span&gt;
disk-cache&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;32M
&lt;span class=&quot;c&quot;&gt;# 断点续传&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 预分配所需时间: none &amp;lt; falloc ? trunc &amp;lt; prealloc&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# falloc和trunc则需要文件系统和内核支持&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项&lt;/span&gt;
file-allocation&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;none

&lt;span class=&quot;c&quot;&gt;## 下载连接相关 ##&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 最大同时下载任务数, 运行时可修改, 默认:5&lt;/span&gt;
max-concurrent-downloads&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;5
&lt;span class=&quot;c&quot;&gt;# 同一服务器连接数, 添加时可指定, 默认:1&lt;/span&gt;
max-connection-per-server&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;15
&lt;span class=&quot;c&quot;&gt;# 整体下载速度限制, 运行时可修改, 默认:0（不限制）&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#max-overall-download-limit=0&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 单个任务下载速度限制, 默认:0（不限制）&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#max-download-limit=0&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 整体上传速度限制, 运行时可修改, 默认:0（不限制）&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#max-overall-upload-limit=0&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 单个任务上传速度限制, 默认:0（不限制）&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#max-upload-limit=0&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 禁用IPv6, 默认:false&lt;/span&gt;
disable-ipv6&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载&lt;/span&gt;
min-split-size&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;10M
&lt;span class=&quot;c&quot;&gt;# 单个任务最大线程数, 添加时可指定, 默认:5&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;10

&lt;span class=&quot;c&quot;&gt;## 进度保存相关 ##&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 从会话文件中读取下载任务&lt;/span&gt;
input-file&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/home/pi/.aria2/aria2.session
&lt;span class=&quot;c&quot;&gt;# 在Aria2退出时保存错误的、未完成的下载任务到会话文件&lt;/span&gt;
save-session&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/home/.aria2/aria2.session
&lt;span class=&quot;c&quot;&gt;# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0&lt;/span&gt;
save-session-interval&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;60

&lt;span class=&quot;c&quot;&gt;## RPC相关设置 ##&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 启用RPC, 默认:false&lt;/span&gt;
enable-rpc&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 允许所有来源, 默认:false&lt;/span&gt;
rpc-allow-origin-all&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 允许外部访问, 默认:false&lt;/span&gt;
rpc-listen-all&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# RPC端口, 仅当默认端口被占用时修改&lt;/span&gt;
rpc-listen-port&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;6800
&lt;span class=&quot;c&quot;&gt;# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项&lt;/span&gt;
rpc-secret&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;123456

&lt;span class=&quot;c&quot;&gt;## BT/PT下载相关 ##&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#follow-torrent=true&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 客户端伪装, PT需要&lt;/span&gt;
peer-id-prefix&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-TR2770-&lt;/span&gt;
user-agent&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;Transmission/2.77
&lt;span class=&quot;c&quot;&gt;# 强制保存会话, 即使任务已经完成, 默认:false&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 较新的版本开启后会在任务完成后依然保留.aria2文件&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#force-save=false&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 继续之前的BT任务时, 无需再次校验, 默认:false&lt;/span&gt;
bt-seed-unverified&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false&lt;/span&gt;
bt-save-metadata&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

启动aria2：&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo aria2c --conf-path=/home/pi/.aria2/aria2.conf -D&lt;/code&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#可将其加入自动启动&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;update-rc.d aria2c defaults
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

配置nginx，以下为&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/nginx/nginx.conf&lt;/code&gt;的内容：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;user www-data&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
worker_processes auto&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
pid /run/nginx.pid&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# include /etc/nginx/modules-enabled/*.conf;&lt;/span&gt;

events &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        worker_connections 768&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# multi_accept on;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

http &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;

        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# Basic Settings&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;

        sendfile on&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        tcp_nopush on&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        tcp_nodelay on&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        keepalive_timeout 65&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        types_hash_max_size 2048&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# server_tokens off;&lt;/span&gt;

        &lt;span class=&quot;c&quot;&gt;# server_names_hash_bucket_size 64;&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# server_name_in_redirect off;&lt;/span&gt;

        include /etc/nginx/mime.types&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        default_type application/octet-stream&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# SSL Settings&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# Dropping SSLv3, ref: POODLE&lt;/span&gt;
        ssl_prefer_server_ciphers on&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# Logging Settings&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;

        access_log /var/log/nginx/access.log&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        error_log /var/log/nginx/error.log&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# Gzip Settings&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;

        &lt;span class=&quot;nb&quot;&gt;gzip &lt;/span&gt;on&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;c&quot;&gt;# gzip_vary on;&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# gzip_proxied any;&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# gzip_comp_level 6;&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# gzip_buffers 16 8k;&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# gzip_http_version 1.1;&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;&lt;/span&gt;
        server &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;

                listen 80&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                server_name 127.0.0.1 192.168.2.76&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                location /aria2 &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                        &lt;span class=&quot;nb&quot;&gt;alias&lt;/span&gt; /var/www/webui-aria2/docs&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                        index index.html
                        charset utf-8,gbk&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# Virtual Host Configs&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;

        &lt;span class=&quot;c&quot;&gt;# include /etc/nginx/conf.d/*.conf;&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;# include /etc/nginx/sites-enabled/*;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;


&lt;span class=&quot;c&quot;&gt;#mail {&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#       # See sample authentication script at:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#       # auth_http localhost/auth.php;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#       # pop3_capabilities &quot;TOP&quot; &quot;USER&quot;;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#       # imap_capabilities &quot;IMAP4rev1&quot; &quot;UIDPLUS&quot;;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#       server {&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#               listen     localhost:110;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#               protocol   pop3;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#               proxy      on;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#       }&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#       server {&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#               listen     localhost:143;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#               protocol   imap;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#               proxy      on;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#       }&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

启动nginx：&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo /etc/init.d/nginx start&lt;/code&gt;

然后在局域网内用打开&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https://192.168.2.76/aria2&lt;/code&gt;即可，需注意在webUI里面配置好RPC令牌，即前面&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aria2.conf&lt;/code&gt;里面的&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rpc-secret=123456&lt;/code&gt;，当然可以把它改成自己的密码。
</description>
        <pubDate>Fri, 26 Mar 2021 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2021/03/26/Raspberry/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2021/03/26/Raspberry/</guid>
        
        <category>Pi</category>
        
        
        <category>Tips</category>
        
      </item>
    
      <item>
        <title>病原菌介导植物内生菌群抑病功能的激活</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#病原菌激活植物内生菌群的抑病功能&quot; id=&quot;markdown-toc-病原菌激活植物内生菌群的抑病功能&quot;&gt;病原菌激活植物内生菌群的抑病功能&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#个人感想&quot; id=&quot;markdown-toc-个人感想&quot;&gt;个人感想&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#内容简介&quot; id=&quot;markdown-toc-内容简介&quot;&gt;内容简介&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#详细内容&quot; id=&quot;markdown-toc-详细内容&quot;&gt;详细内容&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#内生菌群落多样性和网络分析&quot; id=&quot;markdown-toc-内生菌群落多样性和网络分析&quot;&gt;内生菌群落多样性和网络分析&lt;/a&gt;        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#附图1-本研究实验设计示意图&quot; id=&quot;markdown-toc-附图1-本研究实验设计示意图&quot;&gt;&lt;strong&gt;附图1. 本研究实验设计示意图&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#附图2-内生菌群宏基因组分析流程&quot; id=&quot;markdown-toc-附图2-内生菌群宏基因组分析流程&quot;&gt;&lt;strong&gt;附图2. 内生菌群宏基因组分析流程&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#附图3-质控后数据基因注释的比例&quot; id=&quot;markdown-toc-附图3-质控后数据基因注释的比例&quot;&gt;&lt;strong&gt;附图3. 质控后数据基因注释的比例&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#附图4-宏基因组中提取的真菌序列整体分析&quot; id=&quot;markdown-toc-附图4-宏基因组中提取的真菌序列整体分析&quot;&gt;&lt;strong&gt;附图4. 宏基因组中提取的真菌序列整体分析&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#附图5-甜菜内生菌微生物组的多样性&quot; id=&quot;markdown-toc-附图5-甜菜内生菌微生物组的多样性&quot;&gt;&lt;strong&gt;附图5. 甜菜内生菌微生物组的多样性&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#图1-病原菌改变植物内生菌群落结构和功能&quot; id=&quot;markdown-toc-图1-病原菌改变植物内生菌群落结构和功能&quot;&gt;图1. 病原菌改变植物内生菌群落结构和功能&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#内生菌群落功能多样性&quot; id=&quot;markdown-toc-内生菌群落功能多样性&quot;&gt;内生菌群落功能多样性&lt;/a&gt;        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#附图9-内生菌微生物组碳水化合物活性酶的分布和多样性&quot; id=&quot;markdown-toc-附图9-内生菌微生物组碳水化合物活性酶的分布和多样性&quot;&gt;&lt;strong&gt;附图9. 内生菌微生物组碳水化合物活性酶的分布和多样性&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#附图11-内生菌微生物组中已知生物合成基因簇的分布&quot; id=&quot;markdown-toc-附图11-内生菌微生物组中已知生物合成基因簇的分布&quot;&gt;&lt;strong&gt;附图11. 内生菌微生物组中已知生物合成基因簇的分布&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#图2-内生菌群碳水化合物相关活性酶的多样性和分布&quot; id=&quot;markdown-toc-图2-内生菌群碳水化合物相关活性酶的多样性和分布&quot;&gt;图2. 内生菌群碳水化合物相关活性酶的多样性和分布&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#从头组装内生菌基因组&quot; id=&quot;markdown-toc-从头组装内生菌基因组&quot;&gt;从头组装内生菌基因组&lt;/a&gt;        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#附图13-内生菌微生物组宏基因组数据分箱&quot; id=&quot;markdown-toc-附图13-内生菌微生物组宏基因组数据分箱&quot;&gt;&lt;strong&gt;附图13. 内生菌微生物组宏基因组数据分箱&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#附图14-内生菌的宏基因组分箱与参考基因组比较&quot; id=&quot;markdown-toc-附图14-内生菌的宏基因组分箱与参考基因组比较&quot;&gt;&lt;strong&gt;附图14. 内生菌的宏基因组分箱与参考基因组比较&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#附图15-分离内生菌株的物种多样性&quot; id=&quot;markdown-toc-附图15-分离内生菌株的物种多样性&quot;&gt;&lt;strong&gt;附图15. 分离内生菌株的物种多样性&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#附图16-比较基因组分析测序和宏基因组拼接的flavobacterium基因组&quot; id=&quot;markdown-toc-附图16-比较基因组分析测序和宏基因组拼接的flavobacterium基因组&quot;&gt;&lt;strong&gt;附图16. 比较基因组分析测序和宏基因组拼接的Flavobacterium基因组&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#附图17-包含nrps的生物合成基因簇与mibig数据为中已经基因簇的big-scape网络&quot; id=&quot;markdown-toc-附图17-包含nrps的生物合成基因簇与mibig数据为中已经基因簇的big-scape网络&quot;&gt;&lt;strong&gt;附图17. 包含NRPS的生物合成基因簇与MiBIG数据为中已经基因簇的BiG-SCAPE网络&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#图3-内生菌群落生物合成基因簇的多样性和分布&quot; id=&quot;markdown-toc-图3-内生菌群落生物合成基因簇的多样性和分布&quot;&gt;图3. 内生菌群落生物合成基因簇的多样性和分布&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#抑病微生物组的重组和功能分析&quot; id=&quot;markdown-toc-抑病微生物组的重组和功能分析&quot;&gt;抑病微生物组的重组和功能分析&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#图4-抑病微生物群转录和功能分析&quot; id=&quot;markdown-toc-图4-抑病微生物群转录和功能分析&quot;&gt;图4. 抑病微生物群转录和功能分析&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;病原菌激活植物内生菌群的抑病功能&quot;&gt;病原菌激活植物内生菌群的抑病功能&lt;/h2&gt;

&lt;strong&gt;Pathogen-induced activation of disease-suppressive functions in the endophytic root microbiome&lt;/strong&gt;
Science [IF:41.037]

2019-11-1 Articles

DOI: https://doi.org/10.1126/science.aaw9285

第一作者：Víctor J. Carrión1,2,Juan Perez-Jaramillo1,3, Viviane Cordovez1,2, Vittorio Tracanna4

通讯作者：Marnix H. Medema4† , Jos M. Raaijmakers 1,2†; Email: j.raaijmakers@nioo.knaw.nl
(J.M.R.); marnix.medema@wur.nl (M.H.M.)

其它作者：Mattias de Hollander1, Daniel Ruiz-Buck1 Lucas W. Mendes5, Wilfred F.J. van Ijcken6,
Ruth Gomez-Exposito7, Somayah S. Elsayed2, Prarthana Mohanraju7, Adini Arifah7,
John van der Oost7, Joseph N. Paulson8, Rodrigo Mendes9, Gilles P. van Wezel1,2

作者单位：

1 荷兰，瓦赫宁根生态研究所，微生物生态中心（Department of Microbial Ecology, Netherlands Institute of Ecology (NIOO-KNAW), Droevendaalsesteeg 10, 6708 PB
Wageningen, Netherlands）

2 荷兰莱顿大学，生物研究所(Institute of Biology, Leiden
University, Sylviusweg 72, 2333 BE Leiden, Netherlands)

3 哥伦比亚共和国，安蒂奥基亚大学（PECET, University of Antioquia, Medellín, Antioquia 050010, Colombia）

4 荷兰，瓦赫宁根大学，生信中心(Bioinformatics Group, Wageningen University, Droevendaalsesteeg 1, 6708 PB Wageningen, Netherlands)

5 巴西，圣保罗大学（Cell and Molecular Biology Laboratory, Center for Nuclear Energy in Agriculture (CENA), University of Sao Paulo (USP), Piracicaba, Brazil）

6 荷兰，鹿特丹伊拉斯姆斯大学(Erasmus MC, University Medical Center Rotterdam, Department of Cell Biology, Center for Biomics,
3025 CN Rotterdam, Netherlands)

&lt;h2 id=&quot;个人感想&quot;&gt;个人感想&lt;/h2&gt;

抑病型土壤的研究主要集中在特异性抑病土壤上，目前已经有很多高水平文章解析过抑病型微生物群落，这篇Science无疑是最新和最全的一篇。从内容上来，描述了抑病型土壤的群落结构和功能；得到了候选功能菌株，并通过培养组得到了大量的分离株，并开展菌株功能验证；而后进行功能基因的筛选，敲除和验证，最终形成了一个完美的故事。确实是本领域研究的学习模板，并值得我们重现这篇文章的分析过程。

这篇文章关注的是抑病型微生物群落的解析，对于抑病型微生物群落的形成也十分重要，那么内生菌群是如何被植物招募并进入根系内部的呢？是否根系分泌物在这个过程中也起着重要作用？相信这将是很有意思的故事。

&lt;h2 id=&quot;内容简介&quot;&gt;内容简介&lt;/h2&gt;

一些土壤显示出显著的抑制植物病原体引起疾病的能力，这种能力归因于与植物相关的微生物群。 Carrión等研究枯萎真菌茄枯萎病菌感染甜菜，内生菌（在根中发现的亲密微生物群落）在真菌疾病抑制中的作用。转录分析表明，几种细菌内生菌种会激活生物合成基因簇，从而抑制疾病。这些生物产生抗真菌效应物，包括可消化真菌细胞壁的酶，以及次生代谢产物，包括吩嗪，聚酮化合物和铁载体，可能有助于抗真菌表型。

生活在植物内部的微生物可以促进植物的生长和健康，但是它们的基因组和功能多样性仍然难以捉摸。在这里，宏基因组学和网络推论表明，植物根部的真菌感染在根内富集了几丁质菊科和黄杆菌科，以及几丁质酶基因和编码未知核糖体肽合成酶（nonribosomal peptide synthetases，NRPSs）和聚酮化合物合酶（polyketide synthases，PKSs）的各种未知的生物合成基因簇。菌株级别合成的几丁质和黄杆菌的菌群，以持续抑制真菌根部疾病。然后定点诱变表明，以前未鉴定的黄杆菌中的NRPS-PKS基因簇对于内生菌群抑制疾病至关重要。我们的研究结果表明，内生根微生物群具有许多尚不为人所知的功能性状，可以共同保护植物内外。

植物微生物组研究已经积累了大量的测序数据和丰富的信息，表明了许多植物根际、叶际、种子和胚层中不同微生物群落的多样性和丰富度。然而，迄今为止，很少有研究论证微生物菌群对特定植物表型（即植物生长、发育和健康）的影响。因此，在分子和化学层面上许多植物表型与微生物群结构和功能之间在的因果关系仍然未知。本研究旨在探讨植物内生微生物菌群的基因多样性及对真菌感染植株的保护作用。为此，我们整合了包括网络推断和宏基因组学在内的多种方法，以寻找可以抑制Rhizoctonia solani枯萎病（水稻、小麦和甜菜等几种植物根部的真菌病原菌）的内生菌菌群体和功能基因簇。

抑病土壤是一种特殊的生态系统，在这里，由于微生物群落的保护作用，植物才得以存活。各种类型的抑制性土壤都相继报道过，包括真菌、细菌、卵菌和线虫的抑病土壤。抑病性可以通过加热消失，也可以移植到没有抑病作用的土壤中，类似于人类的粪菌移植。

在田间土壤中，通过感病作物的连续栽培过程中集中爆发病害来诱导土壤对病原菌（例如：R.solani）的特异性抑制作用（类似于人类的疫苗）。一旦抑病性形成，如果种植非寄主植物时，这种抑制不表现；但在寄主植物和特定真菌病原体的存在下，抑病作用重新唤醒。这种特异性抑病性土壤一旦形成，便保护之后种植的同种作物和对病原菌产生抵抗性，但是抑病性却在种植其他作物时不表现。

因此，病原菌、寄主植物及其根际微生物群之间的相互作用是特异性抑病性产生和持续的关键因素。我们以前的研究表明，对病原菌 R.solani 有抑制作用的土壤中，发现甜菜根际的几个细菌属paraurkholderia、假单胞菌（pseudomonas）和链霉菌（streptomyces）起着重要的作用。

为了了解那些生活在植物根组织中的微生物（内生菌）在抑病性产生过程中发挥的作用，我们对生长在抑病土壤中的甜菜幼苗的根内进行了宏基因组测序分析；并鉴定了与抑病相关的微生物群落和功能组成；以区分哪些生物合成基因簇（BGCs）在感染过程中上调，然后重组内生菌群；最后进行位点定向突变，检测特异性BGCs是否在抑病过程中起着重要作用。

&lt;h2 id=&quot;详细内容&quot;&gt;详细内容&lt;/h2&gt;

&lt;h3 id=&quot;内生菌群落多样性和网络分析&quot;&gt;内生菌群落多样性和网络分析&lt;/h3&gt;

&lt;strong&gt;Taxonomic diversity and network inference of the endophytic microbiome&lt;/strong&gt;

附图1展示了研究设计：设置甜菜种植在发病(Conducive, &lt;strong&gt;C&lt;/strong&gt;)和抑病土(Suppressive, &lt;strong&gt;S&lt;/strong&gt;)壤和是否接种病原菌&lt;em&gt;R. solani&lt;/em&gt;（&lt;strong&gt;R&lt;/strong&gt;）共计四个处理。在抑病土壤中接种病原菌(S+R)的甜菜发病率为15-30%，在感病土壤中接种病原菌(C+R)的甜菜发病率为80%(&lt;strong&gt;附图1A&lt;/strong&gt;)。

&lt;h4 id=&quot;附图1-本研究实验设计示意图&quot;&gt;&lt;strong&gt;附图1. 本研究实验设计示意图&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3MxLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

因为发病率过高导致没有足够的根系材料用于深入的微生物组学分析。因此我们最终只收集了处理：C，S，和S+R的材料用于下一步测序和生物信息学分析见&lt;strong&gt;附图2&lt;/strong&gt;和附表1/2。

&lt;h4 id=&quot;附图2-内生菌群宏基因组分析流程&quot;&gt;&lt;strong&gt;附图2. 内生菌群宏基因组分析流程&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3MyLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

宏基因组测序结果显示这里有&lt;strong&gt;76.1%的序列注释为细菌，10.5%的序列注释为真菌，0.0065%的序列被注释为古细菌&lt;/strong&gt;(附图3A/B)。

&lt;h4 id=&quot;附图3-质控后数据基因注释的比例&quot;&gt;&lt;strong&gt;附图3. 质控后数据基因注释的比例&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3MzLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

对于真菌序列有监督的cpcoa分析表明内生真菌在三组之间存在显著差异（(PERMANOVA), P &amp;lt; 0.05]）(&lt;strong&gt;附图4A&lt;/strong&gt;)。这是由于在S+R组大量接种了病原真菌&lt;em&gt;R. solani&lt;/em&gt;导致的(&lt;strong&gt;附图4B/C&lt;/strong&gt;)。

&lt;h4 id=&quot;附图4-宏基因组中提取的真菌序列整体分析&quot;&gt;&lt;strong&gt;附图4. 宏基因组中提取的真菌序列整体分析&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3M0LmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

A. CSS标准化下的bray-curtis距离；B. 三元图展示真菌读长数量；C. 柱状图展示丝核菌属 &lt;em&gt;Rhizoctonia&lt;/em&gt; 的相对丰度

而且其他两组并没有准确注释到真菌的微生物门类。因此，这一结果表明在抑病土壤中接种的&lt;em&gt;R. solani&lt;/em&gt;会定殖到甜菜根系，但是却不会发病。

从宏基因组数据中提取16S核糖体保守序列用于注释病评估内生菌细菌群落。结果表明变形菌门和酸杆菌门主导了内生菌细菌群落。这两个菌门中得到的10个OTU均在S+R中显著富集：&lt;em&gt;Pseudomonadaceae&lt;/em&gt;
(两个), &lt;em&gt;Xanthomonadaceae&lt;/em&gt; (四个）,
&lt;em&gt;Chitinophagaceae&lt;/em&gt; (一个), &lt;em&gt;Flavobacteriaceae&lt;/em&gt;
(两个), 和 &lt;em&gt;Veillonellaceae&lt;/em&gt; (一个) (&lt;strong&gt;附图5&lt;/strong&gt;)。

&lt;h4 id=&quot;附图5-甜菜内生菌微生物组的多样性&quot;&gt;&lt;strong&gt;附图5. 甜菜内生菌微生物组的多样性&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3M1LmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

A. CAP（Constrained Analysis of Principal Coordinates）分析展示Beta多样性(可解释23%的总体差异)；conducive soil ©, suppressive soil (S) or suppressive inoculated with R. solani (S+R).

B-D展示门、纲、科水平各组中的相对丰度，其中D图上展示香农多样性指数且无显著差异；

共线性网络分析表明S+R组内生微生物群落复杂度更高&lt;strong&gt;(附表3)&lt;/strong&gt;.相关研究也表明&lt;strong&gt;连接性比较高的网络往往出现在微生物群落面对逆境的时候，比如病原菌入侵&lt;/strong&gt;。有意思的是在S+R网络中80%的连接点都属于&lt;em&gt;Chitinophaga&lt;/em&gt;, &lt;em&gt;Flavobacterium&lt;/em&gt;和 &lt;em&gt;Pseudomonas&lt;/em&gt;这三个科。当将属于&lt;em&gt;Bacteroidetes&lt;/em&gt;的序列去除，这三组差异就难以区分。这再次暗示了&lt;em&gt;Bacteroidetes&lt;/em&gt;
中的 &lt;em&gt;Chitinophaga&lt;/em&gt;和&lt;em&gt;Flavobacterium&lt;/em&gt;与抑病相关。

&lt;h3 id=&quot;图1-病原菌改变植物内生菌群落结构和功能&quot;&gt;图1. 病原菌改变植物内生菌群落结构和功能&lt;/h3&gt;

&lt;strong&gt;Fig. 1. Pathogen-induced changes in endophytic microbiome diversity and functions.&lt;/strong&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzFhLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

生长在S和S+R两个土壤中的植物内生不同菌群丰度差异

图1A. 通过宏基因组提取16S rRNA基因序列注释细菌群落并统计不同门类细菌差异，最大的圈代表门水平，逐渐缩小的圈按照梯度分别代表纲，科，属。

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzFiLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

图1B. 基于宏基因组序列注释功能和物种相关功能差异。最小的圈代表COG功能单位。圆圈大小代表了不同物种或者功能的平均丰度。S组富集的物种或者功能使用绿色标记，S+R组富集的使用蓝色标记。不显著的物种或者功能使用黄色标记。

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzFjLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

图1C. 左边散点图描绘了全部S+R组属于拟杆菌门的全部基因/S组对应基因的丰度比值，右边散点图是S组属于拟杆菌门的全部基因/C组对应基因的丰度比值。散点图从上到下排序顺序按照S+R/S比值。每个COG类别缩写对应如下：C：能量代谢；D：细胞周期，细胞分裂和染色体分区；E：氨基酸运输和代谢；F: 核甘酸转运和代谢；G:碳水化合物的运输和代谢；H:辅酶的运输和代谢；I:脂质的运输与代谢；J:翻译，核糖体结构；K:转录；L:复制，重组和修复；M:细胞壁，细胞膜和细胞被膜的生物发生；O:翻译后修饰，蛋白质转换；P：无机离子的运输和代谢；Q：次生代谢产物的生物合成，转运和分解代谢；T：信号转导机制；U：细胞内运输，分泌和囊泡运输；V：防御机制。

&lt;h3 id=&quot;内生菌群落功能多样性&quot;&gt;内生菌群落功能多样性&lt;/h3&gt;

&lt;strong&gt;Functional diversity of the endophytic microbiome&lt;/strong&gt;

从宏基因组测序数据中得到50%-70%的序列都被注释到了功能(&lt;strong&gt;附图3C-E&lt;/strong&gt;)。通过对其他基因的注释显示有56,175条与微生物类群相关的功能，其中402个功能是显著在S组中显著富集的。在S+R组我们发现部分基因上调超过10倍，这些基因属于“碳水化合物转运和代谢”和“信号转导机制“。同时发现与这些基因高度相关的微生物门类均在S+R中显著增加，包括： &lt;em&gt;Chitinophagaceae&lt;/em&gt;和&lt;em&gt;Flavobacteriaceae&lt;/em&gt; (&lt;em&gt;Bacteroidetes&lt;/em&gt;); &lt;em&gt;Pseudomonadaceae&lt;/em&gt;和 &lt;em&gt;Xanthomonadaceae&lt;/em&gt; (&lt;em&gt;Gammaproteobacteria&lt;/em&gt;); &lt;em&gt;Hyphomicrobiaceae&lt;/em&gt;和&lt;em&gt;Rhizobiaceae&lt;/em&gt; (&lt;em&gt;Alpha-proteobacteria&lt;/em&gt;); 和* Burkholderiaceae* (&lt;em&gt;Betaproteobacteria&lt;/em&gt;) &lt;strong&gt;(图1B/C, 和附图9A)&lt;/strong&gt;。

&lt;h4 id=&quot;附图9-内生菌微生物组碳水化合物活性酶的分布和多样性&quot;&gt;&lt;strong&gt;附图9. 内生菌微生物组碳水化合物活性酶的分布和多样性&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3M5LmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

A. 热图展示各组中显著差异的基因，按物种来源注释分类

B. 碳水化合物代谢相关的HMM结构域与基因间的相似网络

其中大部分增加的基因(3138/4443) 被注释为与&lt;em&gt;Chitinophagaceae&lt;/em&gt; 和&lt;em&gt;Flavobacteriaceae&lt;/em&gt; &lt;strong&gt;(图1B和附图9A)*&lt;em&gt;相关。当我们选择更严格的阈值定义上调基因时，发现有461个上调基因，这些基因大部分都与*Chitinophagaceae* 和*Flavobacteriaceae**&lt;/em&gt;相关。仅对*Bacteroidetes*相关的基因做差异分析，显示了S+R组和S组间按COG功能注释为Q类（次级代谢产物生物合成、转运和分解代谢）的基因差异最大；而S组和C组之间G类（碳水化合物转运和代谢）基因的差异最大&lt;/strong&gt;(图1C)**。

为了更详细的了解COG的G类和Q类功能的细节，我们分别查找了碳水化合物活性酶数据库（CAZymes）和次级代谢产物生物合成基因簇数据库antiSMASH。通过dbCAN, 我们注释得到1822个基因主要属于一下功能分类模块：糖苷羟化酶、糖基转移酶、多糖裂解酶和糖酯酶结构域以及非催化性糖结合模块。

因为这些结构域与进化相关并且参与相关功能，所以我们使用 hhsearch 算法计算蛋白保守结构域的相似性。从而发现按S+R组内生菌群中有&lt;strong&gt;更多的糖苷水解酶和糖基转移酶与抑病相关(图2A和附图9B/C)&lt;/strong&gt; 。与S组相比，S+R组有三类内生菌在CAZyme酶注释上显著不同 &lt;strong&gt;(FDR &amp;lt; 0.1; 图2A和附图9A/B)&lt;/strong&gt;。 此外，我们发现&lt;em&gt;Chitinophagaceae&lt;/em&gt;含有一些与真菌细胞壁降解的相关酶类。比如：几丁质酶、β-葡聚糖酶和内葡聚糖酶等。注释为&lt;em&gt;Burkholderiaceae&lt;/em&gt; 和&lt;em&gt;Xanthomonadaceae&lt;/em&gt;科&lt;strong&gt;(附图9B/C)&lt;/strong&gt;的菌有两个几丁质酶结构域和三个参与几丁质降解的蛋白酶。这五个结构域在这三种菌是共有的。表明了这些富集的内生菌在同一种功能上的冗余。细菌基因组中包含了大量的BGCs，但是大部分都没有备注到已有的模块和功能。通过antiSMASH分析次级代谢表明730个生物合成基因簇(BGCs)与非核糖体肽、聚酮、萜类、芳基多烯、核糖体合成和翻译后修饰肽（RIPS），膦酸盐、吩嗪和铁载体相关。在这些730个BGCs中已经有12个在先前的研究中报道过，并且物质化学结构也被阐明(&lt;strong&gt;附图11&lt;/strong&gt;和附表5)。

&lt;h4 id=&quot;附图11-内生菌微生物组中已知生物合成基因簇的分布&quot;&gt;&lt;strong&gt;附图11. 内生菌微生物组中已知生物合成基因簇的分布&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3MxMS5qcGc?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

其中包括两个脂肽类抗生素thanamycin和 brabantamide，并且相关产品也用在土壤中来抑制病原菌&lt;em&gt;Rhizoctonia&lt;/em&gt;。其他718个BGCs注释目前还不够成熟，其中117个BGCs显著在S+R组中过表达并且其中34个BGCs属于&lt;em&gt;Bacteroidetes&lt;/em&gt; &lt;strong&gt;(图3A-F和附图10-12)&lt;/strong&gt;。值得注意的是这34个BGCs中并不包括先前已经在根际鉴定过的&lt;em&gt;thanamycin&lt;/em&gt;和&lt;em&gt;brabantamide&lt;/em&gt;。在这过表达的117个基因中有10个NRPS基因簇属于&lt;em&gt;Bacteroidetes&lt;/em&gt;菌，并且通过antiSMASH 数据库发现这些都和MIBiG中注释到的基因簇不匹配。

&lt;h3 id=&quot;图2-内生菌群碳水化合物相关活性酶的多样性和分布&quot;&gt;图2. 内生菌群碳水化合物相关活性酶的多样性和分布&lt;/h3&gt;

&lt;strong&gt;Fig. 2. Diversity and distribution of carbohydrate-active enzymes in the endophytic microbiome.&lt;/strong&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzJhLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

图2A. 与碳水化合物酶类相关的已知蛋白和预测蛋白结构域的相似性网络。使用网络展示不同蛋白结构域之间的距离和相关性。使用CAZymes对生长在抑病土壤S组或接种病原菌的抑病土壤S+R组的植物内生菌群中注释，一共得到1822个基因。节点分为五大类：糖苷水解酶（GH，蓝色）；糖基转移酶（GT，橙色）；多糖裂解酶（PL，紫色）；糖脂酶（CE，绿色）和非催化碳水化合物结合模块（CBM，红色）。位置结构域或者功能尚未验证的蛋白结构域标记为黄色。方形节点代表物种注释为&lt;em&gt;Chitinophagaceae&lt;/em&gt;的相关酶在S+R组中显著高于S组。在S+R中过表达的并在分类学水平上属于&lt;em&gt;Burkholderiaceae&lt;/em&gt;和&lt;em&gt;Xanthomonadaceae&lt;/em&gt;的相关酶类展示在附图9 B/C**中。

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzJiLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

图2B. 展示标记的三种富集在S+R组的科水平细菌的CAZymes注释数量。韦恩图黄色代表Burkholderiaceae (黄)；蓝色代表 Chitinophagaceae (蓝)；绿色代表Xanthomonadaceae (绿)。韦恩图标记了每个酶对应Pfam数据库ID。韦恩图展示和每个物种共有的和特有的相关结构域数量。

&lt;h3 id=&quot;从头组装内生菌基因组&quot;&gt;从头组装内生菌基因组&lt;/h3&gt;

&lt;strong&gt;De novo assembly of endophytic bacterial genomes&lt;/strong&gt;

从antiSMASH数据库中鉴定得到的730个BGCs中，有157个包含在组装成的25个基因组 (MAGs)中&lt;strong&gt;(附图13/14和附表6)&lt;/strong&gt;。

&lt;h4 id=&quot;附图13-内生菌微生物组宏基因组数据分箱&quot;&gt;&lt;strong&gt;附图13. 内生菌微生物组宏基因组数据分箱&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3MxMy5qcGc?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

A. 重叠群GC含量与覆盖度的散点图；B. 不同分箱软件结果进行ChechM评估完整 性和污染率；C. 重叠群和分箱的长度累计；D. 重叠群的大小和覆盖度样式

&lt;h4 id=&quot;附图14-内生菌的宏基因组分箱与参考基因组比较&quot;&gt;&lt;strong&gt;附图14. 内生菌的宏基因组分箱与参考基因组比较&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3MxNC5qcGc?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

A. PCoA展示MAGs和参考基因组中的功能距离；B/C分别代表变形菌门和拟杆菌门类似的分析。

随后根据这些BGCs，我们设计相应的特异性引物来匹配我们分离出来的纯菌。先前我们一共&lt;strong&gt;分离得到935个菌株&lt;/strong&gt;，并使用16S rRNA基因测序鉴定&lt;strong&gt;(附图15A/B, 和附表7)&lt;/strong&gt;。

&lt;h4 id=&quot;附图15-分离内生菌株的物种多样性&quot;&gt;&lt;strong&gt;附图15. 分离内生菌株的物种多样性&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3MxNS5qcGc?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

A. 属水平内生菌物种组成。B. 培养的937个菌株；C. 拟杆菌门7个测序的基因组、与121已知菌和25个分箱的进化关系。

结果一共有八个不同的属，大部分菌株属于
&lt;em&gt;Bacteroidetes&lt;/em&gt;和&lt;em&gt;Gammaproteobacteria&lt;/em&gt;。尽管通过PCR，并没有发现BGCs和属于&lt;em&gt;Chitinophaga&lt;/em&gt;和 &lt;em&gt;Pseudomonas&lt;/em&gt;的菌株之间的联系，但是发现有四个BGCs(BGC298, BGC396, BGC471, and BGC592) 在S+R组富集的内生菌&lt;em&gt;Flavobacterium&lt;/em&gt;中。这四个BGCs中有三个 (BGC396, BGC471和 BGC592)属于NRPS基因簇，第四个属于PKS基因簇&lt;strong&gt;(BGC298, 图4A)&lt;/strong&gt;。类似的方法也发现S+R组中获得的三株&lt;em&gt;Chitinophaga&lt;/em&gt;菌含有glycosyl hydrolase (GH18)基因。随后这三个菌株用试验验证了具有降解几丁质的能力。对三株&lt;em&gt;Chitinophaga&lt;/em&gt;和四株&lt;em&gt;Flavobacterium&lt;/em&gt;（同一个属内具有99%相似度）进行基因组测序 &lt;strong&gt;(附图15C和16，附表9)&lt;/strong&gt;。

&lt;h4 id=&quot;附图16-比较基因组分析测序和宏基因组拼接的flavobacterium基因组&quot;&gt;&lt;strong&gt;附图16. 比较基因组分析测序和宏基因组拼接的Flavobacterium基因组&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3MxNi5qcGc?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

A. Progressive Mauve对齐Flavobacterium基因组。B. 在四2上基因组中生物合成基因簇的结果；C. 基因预测的功能。

结果表明了这些菌的富集的确造成了相关基因的过表达。对于关键的BGCs，与完整的Bacteroidetes基因组比对没有发现我们分箱的基因组是错配造成的&lt;strong&gt;(附图16B/C, 附图17A-C)&lt;/strong&gt;。

&lt;h4 id=&quot;附图17-包含nrps的生物合成基因簇与mibig数据为中已经基因簇的big-scape网络&quot;&gt;&lt;strong&gt;附图17. 包含NRPS的生物合成基因簇与MiBIG数据为中已经基因簇的BiG-SCAPE网络&lt;/strong&gt;&lt;/h4&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlL3MxNy5qcGc?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

A/B/C分别对应0.3/0.5/0.7一致率的阈值。

&lt;h3 id=&quot;图3-内生菌群落生物合成基因簇的多样性和分布&quot;&gt;图3. 内生菌群落生物合成基因簇的多样性和分布&lt;/h3&gt;

&lt;strong&gt;Fig. 3 Diversity and distribution of biosynthetic gene clusters in the endophytic microbiome.&lt;/strong&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzNhLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

图3A. 内生菌群中检测到的不同BGCs序列相似性网络（使用BiG-SCAPE构建；阈值选择0.8）。展示节点的物种分类注释和BGC分类注释。在网络中去除少于三条连接的节点（原始网络包含全部的节点 附图10）。节点颜色代表基于Welch’s t test检验的显著性(FDR &amp;lt; 0.1)：黄色节点代表不显著；蓝色代表在S+R中显著上调的基因。

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzNiLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

图3B. 通过antiSMASH数据库使用Clusterfinder 算法检测到不同处理植物内生菌群过表达的BGCs。

图3C-E. 分别展示变形菌门&lt;em&gt;Proteobacteria&lt;/em&gt; ©, 拟杆菌门&lt;em&gt;Bacteroidetes&lt;/em&gt; (D) 和末分类&lt;em&gt;unclassified&lt;/em&gt;(E)中显著在S+R中富集各类型BGCs的数量（注意：这些BGCs中不包含无法分类的基因）。

图3F. 33个NRPS基因簇的相对丰度聚类热图[使用CSS标准化方法转化RPKM]，与C组相比，这些基因簇在S或S+R组中一致表达。

&lt;h3 id=&quot;抑病微生物组的重组和功能分析&quot;&gt;抑病微生物组的重组和功能分析&lt;/h3&gt;

&lt;strong&gt;Reconstruction and functional analysis of disease-suppressive consortia&lt;/strong&gt;

我们选择了7株菌进行根际定植并测定特定BGCs的表达量。所有的菌株均定植甜菜幼苗的根际和根内。转录组分析也表明了接种病原菌后根际和内生菌群几丁质酶表达量显著增加&lt;strong&gt;(图4B/C, 和附图20)&lt;/strong&gt;。对于这四个基因簇，在植物受到病原菌侵染后，BGC298在根内的表达量比根际更高(*&lt;em&gt;图4C*&lt;/em&gt;)。BGC298在四个 *Flavobacterium* 基因组中都存在并且在MIBiG数据库中没有注释&lt;strong&gt;(附图17)&lt;/strong&gt;。

综合以上多个证据表明&lt;em&gt;Flavobacterium&lt;/em&gt; 和&lt;em&gt;Chitinophaga&lt;/em&gt;在抑病过程中起着重要作用。通过实验验证这一假设，三个独立的验证实验表明了&lt;em&gt;Flavobacterium&lt;/em&gt; 和&lt;em&gt;Chitinophaga&lt;/em&gt;的组合菌群抑病性能最好。为了证实黄杆菌BGC298在抑病过程中的作用，我们开发了一个SpyCas9介导的基因敲除掉系统。我们获得了两个BGC298的突变体，PKS在这两个突变株中缺失，通过单细胞测序进行了验证。通过这两个突变株同野生株进行定殖实验发现抑病性能降低。并且通过突变株重组菌群的抑病效果也降低。

&lt;h3 id=&quot;图4-抑病微生物群转录和功能分析&quot;&gt;图4. 抑病微生物群转录和功能分析&lt;/h3&gt;

&lt;strong&gt;Fig. 4. Transcriptional and functional analyses of disease-suppressive
consortia.&lt;/strong&gt;

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzRhLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

图4A. 在黄杆菌&lt;strong&gt;Flavobacterium MAG nbed44b64&lt;/strong&gt; 和四株分离的黄杆菌&lt;em&gt;endophytic Flavobacterium&lt;/em&gt;中均鉴定到了这四个基因簇：BGC298, BGC396, BGC471和BGC592。图中展示的是NRPS和PKS基因家族编码蛋白的模块类别和保守结构域。结构域和标示如下：C，凝结；A，腺苷酸化；KS，酮合酶；AT，酰基转移酶；PCP，肽载体蛋白；TE，硫酯酶。在GC298中NRPS和PKS基因家族预测底物为甘氨酸、丙二酰辅酶A和甘氨酸。

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzRiLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

图4B/C. 通过 &lt;em&gt;Chitinophaga&lt;/em&gt;和&lt;em&gt;Flavobacterium&lt;/em&gt; 菌株处理甜菜幼苗，使用荧光定量PCR对根际和根内的BGC298, BGC396, BGC471, BGC592和chitinase(GH18) 基因进行表达量的分析。使用 LogRQ进行表达量的展示：低于0表示使用管家基因（glyA）标准化之后下调。柱状图每个柱子为每组重复的均值，黑色线段代表均值的标准差。柱状图上的不同字母代表单因素方差分析和Tukey多重比较后显著的差异。

&lt;img src=&quot;https://imgconvert.csdnimg.cn/aHR0cDovLzIxMC43NS4yMjQuMTEwL05vdGUvTGl1WW9uZ1hpbi8xOTExMDFTY2llbmNlLzRkLmpwZw?x-oss-process=image/format,png&quot; alt=&quot;image&quot; /&gt;

图4D-F. 使用三&lt;em&gt;株Chitinophaga&lt;/em&gt;菌（Ch93, Ch94和 Ch95）和四株&lt;em&gt;Flavobacterium&lt;/em&gt;（Fl96, Fl97, Fl98和 Fl5B）单独或者组合验证甜菜发病率，实验表明这些处理菌降低了甜菜枯萎病发病率。

图4D/E. 使用这单独七株菌和七株组合验证发病率。

图4F. 展示敲除了BGC298基因的两种Fl98 突变株 (Fl98-1和Fl98-2)；Ch94和Fl98组合菌群和全部七株组合的发病率。

所添加单菌浓度和混合菌株浓度均为107
每克土壤。柱状图每条柱子都是均值，上面展示了标准差的误差线。发病率接种病原菌在21-28天后统计。不同字母表示ANOVA和Tukey HSD检验 多重比较后显著的处理。
</description>
        <pubDate>Tue, 06 Oct 2020 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2020/10/06/2019Science-RootPathogen/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2020/10/06/2019Science-RootPathogen/</guid>
        
        <category>Biology</category>
        
        
        <category>Literatures</category>
        
      </item>
    
      <item>
        <title>利用VPS搭建SSR</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#购买vps服务器&quot; id=&quot;markdown-toc-购买vps服务器&quot;&gt;购买VPS服务器&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#shadowsocksr服务器端设置&quot; id=&quot;markdown-toc-shadowsocksr服务器端设置&quot;&gt;ShadowsocksR服务器端设置&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;购买vps服务器&quot;&gt;购买VPS服务器&lt;/h2&gt;

我购买的是&lt;a href=&quot;https://www.facebook.com/&quot;&gt;CLOUDCONE&lt;/a&gt;的，赶上促销，价格很便宜，关键是它支持支付宝付款：

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;RAM&lt;/th&gt;
      &lt;th&gt;CPU&lt;/th&gt;
      &lt;th&gt;DISK&lt;/th&gt;
      &lt;th&gt;BandW&lt;/th&gt;
      &lt;th&gt;Cost&lt;/th&gt;
      &lt;th&gt;Link&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;512M&lt;/td&gt;
      &lt;td&gt;1核&lt;/td&gt;
      &lt;td&gt;15G&lt;/td&gt;
      &lt;td&gt;1T/月&lt;/td&gt;
      &lt;td&gt;$21.7/年&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://app.cloudcone.com/compute/328/create&quot;&gt;链接&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;1G&lt;/td&gt;
      &lt;td&gt;1核&lt;/td&gt;
      &lt;td&gt;20G&lt;/td&gt;
      &lt;td&gt;1T/月&lt;/td&gt;
      &lt;td&gt;$32.32/年&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://app.cloudcone.com/compute/329/create&quot;&gt;链接&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;2G&lt;/td&gt;
      &lt;td&gt;1核&lt;/td&gt;
      &lt;td&gt;40G&lt;/td&gt;
      &lt;td&gt;1T/月&lt;/td&gt;
      &lt;td&gt;$37.68/年&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://app.cloudcone.com/compute/330/create&quot;&gt;链接&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;2G&lt;/td&gt;
      &lt;td&gt;1核&lt;/td&gt;
      &lt;td&gt;60G&lt;/td&gt;
      &lt;td&gt;2T/月&lt;/td&gt;
      &lt;td&gt;$53.93/年&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://app.cloudcone.com/compute/331/create&quot;&gt;链接&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;3G&lt;/td&gt;
      &lt;td&gt;2核&lt;/td&gt;
      &lt;td&gt;75G&lt;/td&gt;
      &lt;td&gt;2T/月&lt;/td&gt;
      &lt;td&gt;$75.44/年&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://app.cloudcone.com/compute/332/create&quot;&gt;链接&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

因为我只是用来做SSR，因此购买最低配的就可以了，首先用支付宝打钱到自己的账户，只需要金额大于等于你所需即可：

&lt;img src=&quot;https://raw.githubusercontent.com/stogqy/stogqy.github.io/master/_posts/Pics/20190308/1.png&quot; alt=&quot;img1&quot; /&gt;

然后设置好&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Hostname&lt;/code&gt;，再&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Deploy Server&lt;/code&gt;即可：

&lt;img src=&quot;https://raw.githubusercontent.com/stogqy/stogqy.github.io/master/_posts/Pics/20190308/2.png&quot; alt=&quot;img2&quot; /&gt;

机器配置好之后，你会得到一个IP，可以通过这个IP管理远程服务器：&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh root@YourIP -p 22&lt;/code&gt;，如果可以访问的话就OK，如果不能的话，就只能把它destroy再重新购买了，我当初试了10来次才找到一个没被ban的IP。

&lt;h2 id=&quot;shadowsocksr服务器端设置&quot;&gt;ShadowsocksR服务器端设置&lt;/h2&gt;

连接到服务器后，安装并执行脚本

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wget &lt;span class=&quot;nt&quot;&gt;-N&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--no-check-certificate&lt;/span&gt; https://raw.githubusercontent.com/CecilWu/SSR-Chinese/master/ssr.sh &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;chmod&lt;/span&gt; +x ssr.sh &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; bash ssr.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

一切正常的话你会看到：

&lt;img src=&quot;https://raw.githubusercontent.com/stogqy/stogqy.github.io/master/_posts/Pics/20190308/3.png&quot; alt=&quot;img3&quot; /&gt;

这里就是SSR的设置，首次安装的话按&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1&lt;/code&gt;进入安装步骤：

&lt;img src=&quot;https://raw.githubusercontent.com/stogqy/stogqy.github.io/master/_posts/Pics/20181110/4.png&quot; alt=&quot;img4&quot; /&gt;

首先是端口设置，按照提示设置即可，比如我们最喜欢的&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1024&lt;/code&gt;端口，密码自己设，加密方式我选择的是aes-256-cfb。

&lt;img src=&quot;https://raw.githubusercontent.com/stogqy/stogqy.github.io/master/_posts/Pics/20190308/5.png&quot; alt=&quot;img5&quot; /&gt;

按照这个作者提示的做就行。

因为我是自己用，所以后面几部我全部用的默认无限，然后到了这里就设置好了：

&lt;img src=&quot;https://raw.githubusercontent.com/stogqy/stogqy.github.io/master/_posts/Pics/20190308/6.png&quot; alt=&quot;img6&quot; /&gt;

把IP地址、端口号、加密方式记下来，填写到SSR客户端即可享受没有墙的世界了。

如果不能用的话，可以重新执行&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;./ssr.sh&lt;/code&gt;按照提示修改端口号或者加密信息。
</description>
        <pubDate>Fri, 08 Mar 2019 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2019/03/08/VPS_SSR/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2019/03/08/VPS_SSR/</guid>
        
        <category>VPN</category>
        
        <category>SSR</category>
        
        <category>Tips</category>
        
        
        <category>Tips</category>
        
      </item>
    
      <item>
        <title>Vim基础</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#常用基本操作&quot; id=&quot;markdown-toc-常用基本操作&quot;&gt;常用基本操作&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;em&gt;本文持续更新&lt;/em&gt;

&lt;h2 id=&quot;常用基本操作&quot;&gt;常用基本操作&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;按键&lt;/th&gt;
      &lt;th&gt;操作&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;i/I&lt;/td&gt;
      &lt;td&gt;当前字符前插入/行首插入&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;a/A&lt;/td&gt;
      &lt;td&gt;当前字符后插入/行末插入&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Esc&lt;/td&gt;
      &lt;td&gt;进入命令行操作模式&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;!&lt;/td&gt;
      &lt;td&gt;强制执行&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;:q&lt;/td&gt;
      &lt;td&gt;退出&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;:w&lt;/td&gt;
      &lt;td&gt;保存文件&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;:wq/:x&lt;/td&gt;
      &lt;td&gt;保存并退出&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;o/O&lt;/td&gt;
      &lt;td&gt;当前行下/上新增一行并插入&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;h/j/k/l&lt;/td&gt;
      &lt;td&gt;左/下/上/右&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;x/X&lt;/td&gt;
      &lt;td&gt;删除当前光标/之前一个字符&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;r/R&lt;/td&gt;
      &lt;td&gt;单字替换/一直替换&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;s/S&lt;/td&gt;
      &lt;td&gt;删除单字/删除单行并进入编辑模式&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$/0&lt;/td&gt;
      &lt;td&gt;进入行末/进入行首&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;e/b&lt;/td&gt;
      &lt;td&gt;移动到下一个词尾/移动到上一个词首&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;^&lt;/td&gt;
      &lt;td&gt;移动至行字首&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;H/M/L&lt;/td&gt;
      &lt;td&gt;移至窗口第一行/中间/最后一行&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;G&lt;/td&gt;
      &lt;td&gt;移至文件最后一行&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;:n&lt;/td&gt;
      &lt;td&gt;进入第n行&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;n+/n-&lt;/td&gt;
      &lt;td&gt;进入所在行之后/前n行&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;d/y/p&lt;/td&gt;
      &lt;td&gt;剪切/复制/黏贴&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;dd/yy&lt;/td&gt;
      &lt;td&gt;删除/复制单行&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;u/U&lt;/td&gt;
      &lt;td&gt;撤销之前一次/所有操作&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Ctrl+r&lt;/td&gt;
      &lt;td&gt;恢复撤销&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;/字符串&lt;/td&gt;
      &lt;td&gt;向后查找&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;?字符串&lt;/td&gt;
      &lt;td&gt;往前查找&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;n/N&lt;/td&gt;
      &lt;td&gt;向下/上查找一个相同的字符串&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;%&lt;/td&gt;
      &lt;td&gt;查找“(”，“)”，“{”，“}”的配对符&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;:e&lt;/td&gt;
      &lt;td&gt;放弃所有修改并重新载入文件&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ZZ&lt;/td&gt;
      &lt;td&gt;保存并退出&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt; &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

</description>
        <pubDate>Sat, 02 Mar 2019 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2019/03/02/LearningVim/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2019/03/02/LearningVim/</guid>
        
        <category>Vim</category>
        
        
        <category>Tips</category>
        
      </item>
    
      <item>
        <title>VirtualBox一些设置</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#把ubuntu默认更新源更改为阿里源&quot; id=&quot;markdown-toc-把ubuntu默认更新源更改为阿里源&quot;&gt;把Ubuntu默认更新源更改为阿里源&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;em&gt;本文持续更新&lt;/em&gt;’

&lt;h2 id=&quot;把ubuntu默认更新源更改为阿里源&quot;&gt;把Ubuntu默认更新源更改为阿里源&lt;/h2&gt;
Ubuntu存放更新源的信息位于&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;etc/apt/sources.list&lt;/code&gt;文件，因此我们只需要修改该文件即可。

首先备份一下源文件：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo cp&lt;/span&gt; /etc/apt/sources.list /etc/apt/sources.list.bak.2018_11_17
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
然后用vim添加下列信息进去：
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
里面的bionic是ubuntu的版本号信息，我装的是18.04，版本号就是bionic。

可以通过&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lsb_release -a&lt;/code&gt;查看版本号信息。

当然最后别忘记更新一下：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#更新软件列表&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;c&quot;&gt;#更新软件包&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Fri, 16 Nov 2018 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2018/11/16/SSHloginUbuntuInVbox/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2018/11/16/SSHloginUbuntuInVbox/</guid>
        
        <category>Virtualbox</category>
        
        <category>SSH</category>
        
        
        <category>Tips</category>
        
      </item>
    
      <item>
        <title>一些常用的终端设置</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#设置终端为短路径&quot; id=&quot;markdown-toc-设置终端为短路径&quot;&gt;设置终端为短路径&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#设置终端颜色&quot; id=&quot;markdown-toc-设置终端颜色&quot;&gt;设置终端颜色&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#设置alias&quot; id=&quot;markdown-toc-设置alias&quot;&gt;设置alias&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#设置vim语法高亮&quot; id=&quot;markdown-toc-设置vim语法高亮&quot;&gt;设置vim语法高亮&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#设置tab智能补全&quot; id=&quot;markdown-toc-设置tab智能补全&quot;&gt;设置tab智能补全&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#让终端显示行号&quot; id=&quot;markdown-toc-让终端显示行号&quot;&gt;让终端显示行号&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#设置代码自动补全&quot; id=&quot;markdown-toc-设置代码自动补全&quot;&gt;设置代码自动补全&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#安装vundle&quot; id=&quot;markdown-toc-安装vundle&quot;&gt;安装Vundle&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#安装youcompleteme插件&quot; id=&quot;markdown-toc-安装youcompleteme插件&quot;&gt;安装YouCompleteMe插件&lt;/a&gt;        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#ubuntu&quot; id=&quot;markdown-toc-ubuntu&quot;&gt;ubuntu&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#centos&quot; id=&quot;markdown-toc-centos&quot;&gt;CentOS&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;em&gt;本文将持续更新&lt;/em&gt;

&lt;a href=&quot;https://www.cnblogs.com/keithtt/&quot;&gt;本文引用KeithTt的博文&lt;/a&gt;，我只是收集给自己看的，感谢分享。

&lt;h2 id=&quot;设置终端为短路径&quot;&gt;设置终端为短路径&lt;/h2&gt;

在&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bashrc&lt;/code&gt;文件中，找到PS1变量，将其中的\w\变成大写的\W\，重新source一下即可。

&lt;h2 id=&quot;设置终端颜色&quot;&gt;设置终端颜色&lt;/h2&gt;

Mac终端的设置保留在~/.bash_profile文件中，如果没有的话，直接touch一个，把这些attach上去：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#enables colorin the terminal bash shell export&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;CLICOLOR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1

&lt;span class=&quot;c&quot;&gt;#sets up thecolor scheme for list export&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;LSCOLORS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;gxfxcxdxbxegedabagacad

&lt;span class=&quot;c&quot;&gt;#sets up theprompt color (currently a green similar to linux terminal)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PS1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;#enables colorfor iTerm&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TERM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;xterm-color
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

完成后载入配置：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; .bash_profile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

其中LSCOLORS的意义为：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;a       black
b       red
c       green
d       brown
e       blue
f       magenta
g       cyan
h       light grey
A       bold black, usually shows up as dark grey
B       bold red
C       bold green
D       bold brown, usually shows up as yellow
E       bold blue
F       bold magenta
G       bold cyan
H       bold light grey&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; looks like bright white
x       default foreground or background

文件类型：
1. directory
2. symbolic &lt;span class=&quot;nb&quot;&gt;link
&lt;/span&gt;3. socket
4. pipe
5. executable
6. block special
7. character special
8. executable with setuid bit &lt;span class=&quot;nb&quot;&gt;set
&lt;/span&gt;9. executable with setgid bit &lt;span class=&quot;nb&quot;&gt;set
&lt;/span&gt;10. directory writable to others, with sticky bit
11. directory writable to others, without sticky

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;设置alias&quot;&gt;设置alias&lt;/h2&gt;

Mac的终端是没带一些常用的alias命令的，可以把这些照例添加的终端的配置文件~/.bashrc_profile中：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#some alias&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;ll &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ls -lG&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;la &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ls -a&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;设置vim语法高亮&quot;&gt;设置vim语法高亮&lt;/h2&gt;

vim的配置文件在~/.vimrc中：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;syntax on
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;ruler
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;设置tab智能补全&quot;&gt;设置tab智能补全&lt;/h2&gt;

终端自带的tab补全比较严格，大小写，空格之类常见的都不能有。这些保存在~/.inputrc文件中：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;completion-ignore-case on
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;show-all-if-ambiguous on
TAB: menu-complete
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

不仅要source，可能还需要重启终端。

&lt;h2 id=&quot;让终端显示行号&quot;&gt;让终端显示行号&lt;/h2&gt;

在.vimrc中插入&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;set number&lt;/code&gt;然后&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;source ~/.vimrc&lt;/code&gt;即可。

&lt;h2 id=&quot;设置代码自动补全&quot;&gt;设置代码自动补全&lt;/h2&gt;

需要保证你的Vim版本大于7.3584。

&lt;h3 id=&quot;安装vundle&quot;&gt;安装Vundle&lt;/h3&gt;

首先在&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~&lt;/code&gt;目录下创建&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.vimrc&lt;/code&gt;文件，如果有则无视。

然后用git把Vundle克隆下来：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

将以下内容保存到&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.vimrc&lt;/code&gt;文件:

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;/span&gt;
 
&lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;nocompatible              &lt;span class=&quot;s2&quot;&gt;&quot; be iMproved, required
filetype off                  &quot;&lt;/span&gt; required
&lt;span class=&quot;s2&quot;&gt;&quot;设置Vundle的运行路径并初始化
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
&quot;&lt;/span&gt; Vundle安装位置与插件路径不同时，需要Vundle插件的路径
&lt;span class=&quot;s2&quot;&gt;&quot;call vundle#begin('~/some/path/here')
&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;------------------&lt;/span&gt;要安装的插件不能写在此行前！------------------
 
&lt;span class=&quot;s2&quot;&gt;&quot;Vundle对自己的调用，不可删去
Plugin 'VundleVim/Vundle.vim'
&quot;&lt;/span&gt;以下是所支持的各种不同格式的示例
&lt;span class=&quot;s2&quot;&gt;&quot;需要安装的插件应写在调用的vundle#begin和vundle#end之间
&quot;&lt;/span&gt;如果插件托管在Github上，写在下方，只写作者名/项目名就行了
 
Plugin &lt;span class=&quot;s1&quot;&gt;'Valloric/YouCompleteMe'&lt;/span&gt;
Plugin &lt;span class=&quot;s1&quot;&gt;'majutsushi/tagbar'&lt;/span&gt;
Plugin &lt;span class=&quot;s1&quot;&gt;'vim-syntastic/syntastic'&lt;/span&gt;
Plugin &lt;span class=&quot;s1&quot;&gt;'vim-airline/vim-airline-themes'&lt;/span&gt;
Plugin &lt;span class=&quot;s1&quot;&gt;'vim-airline/vim-airline'&lt;/span&gt;
 
&lt;span class=&quot;s2&quot;&gt;&quot;如果插件来自vim-scripts(官方)，写插件名就行了
&quot;&lt;/span&gt; Plugin &lt;span class=&quot;s1&quot;&gt;'L9'&lt;/span&gt;
 
&lt;span class=&quot;s2&quot;&gt;&quot;如果Git仓库不在Github上，需要提供完整的链接
&quot;&lt;/span&gt; Plugin &lt;span class=&quot;s1&quot;&gt;'git://git.wincent.com/command-t.git'&lt;/span&gt;
 
&lt;span class=&quot;s2&quot;&gt;&quot;本地的插件需要提供文件路径
&quot;&lt;/span&gt; Plugin &lt;span class=&quot;s1&quot;&gt;'file:///home/gmarik/path/to/plugin'&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&quot;一定要确保插件就在提供路径的文件夹中(没有子文件夹，直接在这层目录下)
&quot;&lt;/span&gt;运行时目录的路径
&lt;span class=&quot;s2&quot;&gt;&quot;Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
&quot;&lt;/span&gt;避免插件间的命名冲突
&lt;span class=&quot;s2&quot;&gt;&quot;Plugin 'ascenator/L9', {'name': 'newL9'}
&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;------------------&lt;/span&gt;要安装的插件不能写在此行后！------------------
call vundle#end&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;            &lt;span class=&quot;s2&quot;&gt;&quot; required
filetype plugin indent on    &quot;&lt;/span&gt; required
&lt;span class=&quot;s2&quot;&gt;&quot;要忽略插件缩进更改，请改用：
&quot;&lt;/span&gt;filetype plugin on
&lt;span class=&quot;s2&quot;&gt;&quot;
&quot;&lt;/span&gt; 安装插件的相关指令
&lt;span class=&quot;s2&quot;&gt;&quot;:PluginList			- 列出已安装插件
&quot;&lt;/span&gt;:PluginInstall			- 安装新添加的插件&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;添加&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;或使用&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;:PluginUpdate&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;来更新已安装插件
&lt;span class=&quot;s2&quot;&gt;&quot;:PluginSearch xxx		- 寻找名字带有xxx的插件;添加&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;刷新本地缓存
&quot;&lt;/span&gt;:PluginClean			- 删除已经从列表移除的插件&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;添加&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;静默卸载
&lt;span class=&quot;s2&quot;&gt;&quot;:h						- 帮助和说明文档 
&quot;&lt;/span&gt;Vundle的设置到此为止了
&lt;span class=&quot;s2&quot;&gt;&quot;
&quot;&lt;/span&gt;该配置文件来自_YingCao的博客，感谢分享，原文内容在：https://blog.csdn.net/qq_33505303/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

最后在vim中执行&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;:PluginInstall&lt;/code&gt;即可，这步会有点漫长，推荐去看篇文献或者去吃个饭。

&lt;h3 id=&quot;安装youcompleteme插件&quot;&gt;安装YouCompleteMe插件&lt;/h3&gt;

&lt;h4 id=&quot;ubuntu&quot;&gt;ubuntu&lt;/h4&gt;

首先安装cmake和python头文件：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;cmake
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;python3-dev
&lt;span class=&quot;c&quot;&gt;#更新一下，安装essential&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; build-essential
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

然后&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd ~/.vim/bundle/YouCompleteMe&lt;/code&gt;进行安装：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;python3 install.py &lt;span class=&quot;nt&quot;&gt;--clang-completer&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

这个过程大概十几分钟，具体根据网速而定。

&lt;h4 id=&quot;centos&quot;&gt;CentOS&lt;/h4&gt;

突发奇想在阿里云买了三个月的主机玩玩，结果登上去发现带的Vim是7.4的不支持YCM，于是开始更新Vim：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# 卸载老版本&lt;/span&gt;
yum remove vim &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#安装ncurses&lt;/span&gt;
yum &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;ncurses-devel.x86_64
&lt;span class=&quot;c&quot;&gt;#安装git&lt;/span&gt;
yum &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;git
&lt;span class=&quot;c&quot;&gt;#克隆vim下来&lt;/span&gt;
git clone https://github.com/vim/vim.git
&lt;span class=&quot;c&quot;&gt;#安装vim&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;vim/src
make
make &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#添加路径&lt;/span&gt;
vi /etc/profiled.d/path.sh
&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;:/usr/local/bin/vim
&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; /etc/profiled.d/path.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

然后按之前ubuntu类似的操作修改&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.vimrc&lt;/code&gt;文件下载YCM等等。

但是在编译安装YCM的时候我又遇到了编译器的问题，尼玛！于是：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;yum &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; python36-devel.x86_64
 yum &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; gcc gcc-c++ ncurses-devel bison
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

然后再:

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;python36 install.py &lt;span class=&quot;nt&quot;&gt;--clang-completer&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

还是不行，提示：

YouCompleteMe unavailable: requires Vim compiled with Python (2.7.1 or 3.4 )

然后&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim -v | grep python&lt;/code&gt;一看，原来这个版本的vim不支持python，得了换个能兼容的版本吧：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#先看看系统内的vim，能卸载的全给卸载了&lt;/span&gt;
rpm &lt;span class=&quot;nt&quot;&gt;-qa&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;vim
&lt;span class=&quot;c&quot;&gt;#xxxx是你看到的vim&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;rpm &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; xxxxx
&lt;span class=&quot;c&quot;&gt;#获取vim源码&lt;/span&gt;
wget ftp://ftp.vim.org/pub/vim/unix/vim-8.1.tar.bz2
&lt;span class=&quot;c&quot;&gt;#解压&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-xjf&lt;/span&gt; vim-8.1.tar.bz2
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;vim81
&lt;span class=&quot;c&quot;&gt;#安装&lt;/span&gt;
./configure &lt;span class=&quot;nt&quot;&gt;--enable-multibyte&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--enable-rubyinterp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--enable-pythoninterp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--enable-python3interp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#这里我遇到了一些问题，chmod +x configure可解决&lt;/span&gt;
make
make &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

然后再&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vim -v | grep python&lt;/code&gt;看看，这下显示能兼容python3了，但是我的&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/local/bin&lt;/code&gt;目录里头没有python3，只有python、python36之类的，不过既然它只要求python3，那么我们直接软连接一个好了：

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /usr/local/bin/python36 /usr/local/bin/python3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

然后重新执行&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python36 install.py --clang-completer&lt;/code&gt;，顺利通过。

</description>
        <pubDate>Sun, 11 Nov 2018 00:00:00 +0800</pubDate>
        <link>https://stogqy.github.io/2018/11/11/SomeTerminalSettings/</link>
        <guid isPermaLink="true">https://stogqy.github.io/2018/11/11/SomeTerminalSettings/</guid>
        
        <category>Terminal</category>
        
        
        <category>Tips</category>
        
      </item>
    
  </channel>
</rss>
