安装librocksdb.so.4.1的共享库

安装librocksdb.so.4.1
本文介绍如何安装librocksdb.so.4.1共享库,包括从GitHub克隆rocksdb仓库、切换到指定分支并编译、拷贝库文件到指定目录、配置共享库路径及运行ldconfig命令。

安装librocksdb.so.4.1的共享库

注:以下命令需在root模式下进行

1、clone rocksDB

命令行运行git clone https://github.com/facebook/rocksdb.git

2、切换到4.1.fb分支,编译

cd rocksdb
git checkout 4.1.fb
make shared_lib

3、拷贝/usr/local/lib目录

cp librocksdb.so /usr/local/lib
cp librocksdb.so.4 /usr/local/lib
cp librocksdb.so.4.1 /usr/local/lib
cp librocksdb.so4.1.0 /usr/local/lib

4、配置新共享库目录

共享库文件安装到了/usr/local/lib(很多开源的共享库都会安装到该目录下)或其它”非/lib或/usr/lib”目录下, 那么在执行ldconfig命令前, 还要把新共享库目录加入到共享库配置文件/etc/ld.so.conf中, 如下:

# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
# echo "/usr/local/lib" >> /etc/ld.so.conf

5、运行ldconfig

# ldconfig

可能会提示/sbin/ldconfig.real: /usr/local/lib/librocksdb.so.4.1 is not a symbolic link,但是geth version已经可以正常运行了

参考

共享库错误

XX is not a symbolic link

Chr01 phytozomev13 gene 13697 17702 . - . ID=Potri.001G000400.v4.1;Name=Potri.001G000400;ancestorIdentifier=Potri.001G000400.v3.1 Chr01 phytozomev13 mRNA 13697 17702 . - . ID=Potri.001G000400.5.v4.1;Name=Potri.001G000400.5;pacid=42788989;longest=1;Parent=Potri.001G000400.v4.1 Chr01 phytozomev13 five_prime_UTR 17511 17702 . - . ID=Potri.001G000400.5.v4.1.five_prime_UTR.1;Parent=Potri.001G000400.5.v4.1;pacid=42788989 Chr01 phytozomev13 CDS 16368 16452 . - 0 ID=Potri.001G000400.5.v4.1.CDS.1;Parent=Potri.001G000400.5.v4.1;pacid=42788989 Chr01 phytozomev13 five_prime_UTR 16453 16463 . - . ID=Potri.001G000400.5.v4.1.five_prime_UTR.2;Parent=Potri.001G000400.5.v4.1;pacid=42788989 Chr01 phytozomev13 CDS 16186 16258 . - 2 ID=Potri.001G000400.5.v4.1.CDS.2;Parent=Potri.001G000400.5.v4.1;pacid=42788989 Chr01 phytozomev13 three_prime_UTR 13697 13934 . - . ID=Potri.001G000400.5.v4.1.three_prime_UTR.1;Parent=Potri.001G000400.5.v4.1;pacid=42788989 Chr01 phytozomev13 CDS 13935 13947 . - 1 ID=Potri.001G000400.5.v4.1.CDS.3;Parent=Potri.001G000400.5.v4.1;pacid=42788989 Chr01 phytozomev13 gene 14683 14997 . - . ID=Potri.001G000450.v4.1;Name=Potri.001G000450 Chr01 phytozomev13 mRNA 14683 14997 . - . ID=Potri.001G000450.1.v4.1;Name=Potri.001G000450.1;pacid=42789197;longest=1;Parent=Potri.001G000450.v4.1 Chr01 phytozomev13 CDS 14683 14997 . - 0 ID=Potri.001G000450.1.v4.1.CDS.1;Parent=Potri.001G000450.1.v4.1;pacid=42789197 Chr01 phytozomev13 gene 40811 43197 . - . ID=Potri.001G000500.v4.1;Name=Potri.001G000500;ancestorIdentifier=Potri.001G000500.v3.1 Chr01 phytozomev13 mRNA 40811 43197 . - . ID=Potri.001G000500.1.v4.1;Name=Potri.001G000500.1;pacid=42791718;longest=1;ancestorIdentifier=Potri.001G000500.1.v3.1;Parent=Potri.001G000500.v4.1 Chr01 phytozomev13 CDS 42833 43080 . - 0 ID=Potri.001G000500.1.v4.1.CDS.1;Parent=Potri.001G000500.1.v4.1;pacid=42791718 Chr01 phytozomev13 five_prime_UTR 43081 43197 . - . ID=Potri.001G000500.1.v4.1.five_prime_UTR.1;Parent=Potri.001G000500.1.v4.1;pacid=42791718 Chr01 phytozomev13 CDS 41633 42739 . - 1 ID=Potri.001G000500.1.v4.1.CDS.2;Parent=Potri.001G000500.1.v4.1;pacid=42791718 Chr01 phytozomev13 three_prime_UTR 40811 41195 . - . ID=Potri.001G000500.1.v4.1.three_prime_UTR.1;Parent=Potri.001G000500.1.v4.1;pacid=42791718 Chr01 phytozomev13 CDS 41196 41496 . - 1 ID=Potri.001G000500.1.v4.1.CDS.3;Parent=Potri.001G000500.1.v4.1;pacid=42791718 Chr01 phytozomev13 gene 50630 52697 . + . ID=Potri.001G000600.v4.1;Name=Potri.001G000600;ancestorIdentifier=Potri.001G000600.v3.1 Chr01 phytozomev13 mRNA 50630 52697 . + . ID=Potri.001G000600.1.v4.1;Name=Potri.001G000600.1;pacid=42793077;longest=1;ancestorIdentifier=Potri.001G000600.1.v3.1;Parent=Potri.001G000600.v4.1 Chr01 phytozomev13 five_prime_UTR 50630 50733 . + . ID=Potri.001G000600.1.v4.1.five_prime_UTR.1;Parent=Potri.001G000600.1.v4.1;pacid=42793077 Chr01 phytozomev13 CDS 50734 52094 . + 0 ID=Potri.001G000600.1.v4.1.CDS.1;Parent=Potri.001G000600.1.v4.1;pacid=42793077 Chr01 phytozomev13 CDS 52227 52527 . + 1 ID=Potri.001G000600.1.v4.1.CDS.2;Parent=Potri.001G000600.1.v4.1;pacid=42793077 Chr01 phytozomev13 three_prime_UTR 52528 52697 . + . ID=Potri.001G000600.1.v4.1.three_prime_UTR.1;Parent=Potri.001G000600.1.v4.1;pacid=42793077 Chr01 phytozomev13 gene 60431 65133 . - . ID=Potri.001G000700.v4.1;Name=Potri.001G000700;ancestorIdentifier=Potri.001G000700.v3.1 Chr01 phytozomev13 mRNA 60431 65133 . - . ID=Potri.001G000700.2.v4.1;Name=Potri.001G000700.2;pacid=42787630;longest=1;ancestorIdentifier=Potri.001G000700.2.v3.1;Parent=Potri.001G000700.v4.1 Chr01 phytozomev13 CDS 64525 64830 . - 0 ID=Potri.001G000700.2.v4.1.CDS.1;Parent=Potri.001G000700.2.v4.1;pacid=42787630 Chr01 phytozomev13 five_prime_UTR 64831 65133 . - . ID=Potri.001G000700.2.v4.1.five_prime_UTR.1;Parent=Potri.001G000700.2.v4.1;pacid=42787630 Chr01 phytozomev13 CDS 64366 64413 . - 0 ID=Potri.001G000700.2.v4.1.CDS.2;Parent=Potri.001G000700.2.v4.1;pacid=42787630 Chr01 phytozomev13 CDS 61677 61817 . - 0 ID=Potri.001G000700.2.v4.1.CDS.3;Parent=Potri.001G000700.2.v4.1;pacid=42787630 Chr01 phytozomev13 CDS 61309 61554 . - 0 ID=Potri.001G000700.2.v4.1.CDS.4;Parent=Potri.001G000700.2.v4.1;pacid=42787630 Chr01 phytozomev13 three_prime_UTR 60431 60905 . - . ID=Potri.001G000700.2.v4.1.three_prime_UTR.1;Parent=Potri.001G000700.2.v4.1;pacid=42787630 Chr01 phytozomev13 CDS 60906 61058 . - 0 ID=Potri.001G000700.2.v4.1.CDS.5;Parent=Potri.001G000700.2.v4.1;pacid=42787630 Chr01 phytozomev13 gene 65954 72514 . - . ID=Potri.001G000800.v4.1;Name=Potri.001G000800;ancestorIdentifier=Potri.001G000800.v3.1 Chr01 phytozomev13 mRNA 65966 72511 . - . ID=Potri.001G000800.1.v4.1;Name=Potri.001G000800.1;pacid=42792210;longest=1;ancestorIdentifier=Potri.001G000800.1.v3.1;Parent=Potri.001G000800.v4.1 Chr01 phytozomev13 CDS 71069 71264 . - 0 ID=Potri.001G000800.1.v4.1.CDS.1;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 five_prime_UTR 71265 72511 . - . ID=Potri.001G000800.1.v4.1.five_prime_UTR.1;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 70877 70960 . - 2 ID=Potri.001G000800.1.v4.1.CDS.2;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 70413 70580 . - 2 ID=Potri.001G000800.1.v4.1.CDS.3;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 70181 70287 . - 2 ID=Potri.001G000800.1.v4.1.CDS.4;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 69810 69988 . - 0 ID=Potri.001G000800.1.v4.1.CDS.5;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 69394 69555 . - 1 ID=Potri.001G000800.1.v4.1.CDS.6;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 68993 69208 . - 1 ID=Potri.001G000800.1.v4.1.CDS.7;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 68753 68790 . - 1 ID=Potri.001G000800.1.v4.1.CDS.8;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 68357 68484 . - 2 ID=Potri.001G000800.1.v4.1.CDS.9;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 66579 68028 . - 0 ID=Potri.001G000800.1.v4.1.CDS.10;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 three_prime_UTR 65966 66215 . - . ID=Potri.001G000800.1.v4.1.three_prime_UTR.1;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 CDS 66216 66331 . - 2 ID=Potri.001G000800.1.v4.1.CDS.11;Parent=Potri.001G000800.1.v4.1;pacid=42792210 Chr01 phytozomev13 mRNA 65965 72177 . - . ID=Potri.001G000800.3.v4.1;Name=Potri.001G000800.3;pacid=42792211;longest=0;Parent=Potri.001G000800.v4.1 Chr01 phytozomev13 five_prime_UTR 71821 72177 . - . ID=Potri.001G000800.3.v4.1.five_prime_UTR.1;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 71069 71264 . - 0 ID=Potri.001G000800.3.v4.1.CDS.1;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 five_prime_UTR 71265 71287 . - . ID=Potri.001G000800.3.v4.1.five_prime_UTR.2;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 70877 70960 . - 2 ID=Potri.001G000800.3.v4.1.CDS.2;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 70413 70580 . - 2 ID=Potri.001G000800.3.v4.1.CDS.3;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 70181 70287 . - 2 ID=Potri.001G000800.3.v4.1.CDS.4;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 69810 69988 . - 0 ID=Potri.001G000800.3.v4.1.CDS.5;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 69394 69555 . - 1 ID=Potri.001G000800.3.v4.1.CDS.6;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 68993 69208 . - 1 ID=Potri.001G000800.3.v4.1.CDS.7;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 68753 68790 . - 1 ID=Potri.001G000800.3.v4.1.CDS.8;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 68357 68484 . - 2 ID=Potri.001G000800.3.v4.1.CDS.9;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 66579 68028 . - 0 ID=Potri.001G000800.3.v4.1.CDS.10;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 three_prime_UTR 65965 66215 . - . ID=Potri.001G000800.3.v4.1.three_prime_UTR.1;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 CDS 66216 66331 . - 2 ID=Potri.001G000800.3.v4.1.CDS.11;Parent=Potri.001G000800.3.v4.1;pacid=42792211 Chr01 phytozomev13 mRNA 66087 72177 . - . ID=Potri.001G000800.4.v4.1;Name=Potri.001G000800.4;pacid=42792212;longest=0;Parent=Potri.001G000800.v4.1 Chr01 phytozomev13 five_prime_UTR 71821 72177 . - . ID=Potri.001G000800.4.v4.1.five_prime_UTR.1;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 71069 71264 . - 0 ID=Potri.001G000800.4.v4.1.CDS.1;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 five_prime_UTR 71265 71389 . - . ID=Potri.001G000800.4.v4.1.five_prime_UTR.2;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 70877 70960 . - 2 ID=Potri.001G000800.4.v4.1.CDS.2;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 70413 70580 . - 2 ID=Potri.001G000800.4.v4.1.CDS.3;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 70181 70287 . - 2 ID=Potri.001G000800.4.v4.1.CDS.4;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 69810 69988 . - 0 ID=Potri.001G000800.4.v4.1.CDS.5;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 69394 69555 . - 1 ID=Potri.001G000800.4.v4.1.CDS.6;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 68993 69208 . - 1 ID=Potri.001G000800.4.v4.1.CDS.7;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 68753 68790 . - 1 ID=Potri.001G000800.4.v4.1.CDS.8;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 68357 68484 . - 2 ID=Potri.001G000800.4.v4.1.CDS.9;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 66579 68028 . - 0 ID=Potri.001G000800.4.v4.1.CDS.10;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 three_prime_UTR 66087 66215 . - . ID=Potri.001G000800.4.v4.1.three_prime_UTR.1;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 CDS 66216 66331 . - 2 ID=Potri.001G000800.4.v4.1.CDS.11;Parent=Potri.001G000800.4.v4.1;pacid=42792212 Chr01 phytozomev13 mRNA 65968 72426 . - . ID=Potri.001G000800.2.v4.1;Name=Potri.001G000800.2;pacid=42792213;longest=0;Parent=Potri.001G000800.v4.1 Chr01 phytozomev13 five_prime_UTR 71821 72426 . - . ID=Potri.001G000800.2.v4.1.five_prime_UTR.1;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 71069 71264 . - 0 ID=Potri.001G000800.2.v4.1.CDS.1;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 five_prime_UTR 71265 71369 . - . ID=Potri.001G000800.2.v4.1.five_prime_UTR.2;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 70877 70960 . - 2 ID=Potri.001G000800.2.v4.1.CDS.2;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 70413 70580 . - 2 ID=Potri.001G000800.2.v4.1.CDS.3;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 70181 70287 . - 2 ID=Potri.001G000800.2.v4.1.CDS.4;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 69810 69988 . - 0 ID=Potri.001G000800.2.v4.1.CDS.5;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 69394 69555 . - 1 ID=Potri.001G000800.2.v4.1.CDS.6;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 68993 69208 . - 1 ID=Potri.001G000800.2.v4.1.CDS.7;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 68753 68790 . - 1 ID=Potri.001G000800.2.v4.1.CDS.8;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 68357 68484 . - 2 ID=Potri.001G000800.2.v4.1.CDS.9;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 66579 68028 . - 0 ID=Potri.001G000800.2.v4.1.CDS.10;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 three_prime_UTR 65968 66215 . - . ID=Potri.001G000800.2.v4.1.three_prime_UTR.1;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 CDS 66216 66331 . - 2 ID=Potri.001G000800.2.v4.1.CDS.11;Parent=Potri.001G000800.2.v4.1;pacid=42792213 Chr01 phytozomev13 mRNA 65954 70855 . - . ID=Potri.001G000800.6.v4.1;Name=Potri.001G000800.6;pacid=42792214;longest=0;Parent=Potri.001G000800.v4.1 Chr01 phytozomev13 CDS 70181 70183 . - 0 ID=Potri.001G000800.6.v4.1.CDS.1;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 five_prime_UTR 70184 70855 . - . ID=Potri.001G000800.6.v4.1.five_prime_UTR.1;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 CDS 69810 69988 . - 0 ID=Potri.001G000800.6.v4.1.CDS.2;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 CDS 69394 69555 . - 1 ID=Potri.001G000800.6.v4.1.CDS.3;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 CDS 68993 69208 . - 1 ID=Potri.001G000800.6.v4.1.CDS.4;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 CDS 68753 68790 . - 1 ID=Potri.001G000800.6.v4.1.CDS.5;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 CDS 68357 68484 . - 2 ID=Potri.001G000800.6.v4.1.CDS.6;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 CDS 66579 68028 . - 0 ID=Potri.001G000800.6.v4.1.CDS.7;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 three_prime_UTR 65954 66215 . - . ID=Potri.001G000800.6.v4.1.three_prime_UTR.1;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 CDS 66216 66331 . - 2 ID=Potri.001G000800.6.v4.1.CDS.8;Parent=Potri.001G000800.6.v4.1;pacid=42792214 Chr01 phytozomev13 mRNA 65966 72514 . - . ID=Potri.001G000800.5.v4.1;Name=Potri.001G000800.5;pacid=42792215;longest=0;Parent=Potri.001G000800.v4.1 Chr01 phytozomev13 five_prime_UTR 71069 72514 . - . ID=Potri.001G000800.5.v4.1.five_prime_UTR.1;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 five_prime_UTR 70877 70960 . - . ID=Potri.001G000800.5.v4.1.five_prime_UTR.2;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 CDS 70181 70183 . - 0 ID=Potri.001G000800.5.v4.1.CDS.1;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 five_prime_UTR 70184 70580 . - . ID=Potri.001G000800.5.v4.1.five_prime_UTR.3;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 CDS 69810 69988 . - 0 ID=Potri.001G000800.5.v4.1.CDS.2;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 CDS 69394 69555 . - 1 ID=Potri.001G000800.5.v4.1.CDS.3;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 CDS 68993 69208 . - 1 ID=Potri.001G000800.5.v4.1.CDS.4;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 CDS 68753 68790 . - 1 ID=Potri.001G000800.5.v4.1.CDS.5;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 CDS 68357 68484 . - 2 ID=Potri.001G000800.5.v4.1.CDS.6;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 CDS 66579 68028 . - 0 ID=Potri.001G000800.5.v4.1.CDS.7;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 three_prime_UTR 65966 66215 . - . ID=Potri.001G000800.5.v4.1.three_prime_UTR.1;Parent=Potri.001G000800.5.v4.1;pacid=42792215 Chr01 phytozomev13 CDS 66216 66331 . - 2 ID=Potri.001G000800.5.v4.1.CDS.8;Parent=Potri.001G000800.5.v4.1;pacid=42792215 我的gff文件中正链和负链都有出现
10-11
<think>我们面对的是一个包含正链和负链基因注释的GFF文件。用户可能希望了解如何正确处理这种文件,特别是链方向对特征坐标的影响。我将结合生物学背景和计算处理方法进行系统阐述。 ### **GFF文件链方向处理的核心原则** 1. **链方向标识**: - `+`表示正链:特征从低坐标向高坐标转录 - `-`表示负链:特征从高坐标向低坐标转录 - `.`表示方向未知或无关 2. **坐标排序差异**: - 正链特征:按`start`升序排列(5'→3') - 负链特征:按`start`降序排列(5'→3')[^3] ### **处理流程(以Python为例)** #### **步骤1:按转录本分组** ```python from collections import defaultdict # 读取GFF文件 transcripts = defaultdict(list) with open("annotation.gff") as f: for line in f: if line.startswith("#"): continue fields = line.strip().split("\t") chrom, source, feat_type, start, end, _, strand = fields[:7] attr = {k:v for k,v in [x.split("=") for x in fields[8].split(";")]} # 提取父转录本ID(关键步骤) parent_id = attr.get("Parent") if parent_id: transcripts[parent_id].append({ "type": feat_type, "start": int(start), "end": int(end), "strand": strand }) ``` #### **步骤2:按链方向排序特征** ```python for parent_id, features in transcripts.items(): # 判断链方向 strand = features[0]["strand"] # 假设同转录本特征链方向一致 # 负链按起始位置降序,正链升序 reverse_sort = (strand == '-') features.sort(key=lambda x: x["start"], reverse=reverse_sort) ``` #### **步骤3:合并连续特征形成外显子** ```python def merge_features(features): merged = [] current = features[0] for feat in features[1:]: # 检查是否连续:当前特征结束+1 = 下一特征起始 if current["end"] + 1 == feat["start"]: current["end"] = feat["end"] # 合并区间 else: merged.append(current) current = feat merged.append(current) return merged exonic_regions = merge_features(sorted_features) ``` #### **步骤4:计算内含子位置** ```python introns = [] for i in range(1, len(exonic_regions)): prev = exonic_regions[i-1] curr = exonic_regions[i] # 负链内含子计算(注意坐标方向) if strand == '-': intron_start = curr["end"] + 1 # 后一个外显子结束+1 intron_end = prev["start"] - 1 # 前一个外显子开始-1 else: # 正链 intron_start = prev["end"] + 1 intron_end = curr["start"] - 1 introns.append((chrom, intron_start, intron_end, strand)) ``` ### **生物学意义验证** 1. **启动子位置**: - 正链基因:转录起始位点(TSS)在最小坐标处 - 负链基因:TSS在最大坐标处(需从特征最高坐标找)[^2] 2. **内含子剪接信号**: - 检查内含子两端是否符合`GT-AG`规则(真核生物保守信号) - 示例代码验证: ```python def check_splice_site(seq, intron): five_ss = seq[intron.start-1:intron.start+1] # 取内含子起始端两个碱基 three_ss = seq[intron.end-2:intron.end] # 取末端两个碱基 return (five_ss == "GT") and (three_ss == "AG") ``` ### **工具推荐** - **gffutils**:创建GFF数据库实现高效查询 ```python import gffutils db = gffutils.create_db("input.gff", dbfn="anno.db", force=True) for gene in db.features_of_type("gene"): print(gene.id, gene.strand) ``` - **BCBio.GFF**:解析GFF到标准对象[^1] > 注:处理真实数据时需注意GFF版本差异(推荐GFF3)[^4] ### **应用场景** 1. **可变剪接分析**:比较同一基因不同转录本的外显子结构差异 2. **基因家族分析**:通过保守内含子位置判断基因进化关系 3. **突变影响预测**:定位突变是否发生在剪接位点区域 §§相关问题§§ 1. 如何从基因组序列中提取外显子拼接的转录本序列? 2. 负链基因的启动子预测方法与正链有何不同? 3. GFF文件中如何识别和解析可变剪接事件? 4. 内含子长度分布与基因功能有什么关系? </think>### 包含正负链信息的GFF文件处理与分析指南 在生物信息学中,GFF(General Feature Format)文件是描述基因组特征的重要格式。当文件包含正链(`+`)和负链(`-`)信息时,需特别注意链方向对特征坐标的影响。以下是系统处理方法: --- #### **1. 链方向对特征识别的影响** - **正链基因**:特征坐标按数值递增顺序排列(5'→3'方向) ```python # 正链特征排序示例 sorted_features = sorted(features, key=lambda x: x['start']) ``` - **负链基因**:特征坐标需反向解析(3'→5'方向)[^3] ```python # 负链特征排序:先按start降序,再按end降序 sorted_features = sorted(features, key=lambda x: (-x['start'], -x['end'])) ``` #### **2. 外显子-内含子结构提取流程** ```mermaid graph TD A[读取GFF文件] --> B{判断链方向} B -->|正链| C[按start升序排列特征] B -->|负链| D[按start降序排列特征] C & D --> E[合并连续区域形成外显子] E --> F[计算相邻外显子间隙为内含子] ``` ##### **关键计算公式** - **内含子位置**(通用公式): $$ \text{内含子} = \left( \min(\text{exon}_i^{\text{end}}, \text{exon}_j^{\text{start}}) + 1, \quad \max(\text{exon}_i^{\text{end}}, \text{exon}_j^{\text{start}}) - 1 \right) $$ 其中 $i,j$ 为相邻外显子索引 - **负链特殊处理**: ```python if strand == '-': intron_start = downstream_exon_end + 1 # 下游外显子结束+1 intron_end = upstream_exon_start - 1 # 上游外显子开始-1 ``` #### **3. 生物学意义解读** - **正负链基因结构差异**: | 特征 | 正链 | 负链 | |-------------|------------------------------|------------------------------| | 5' UTR | 最小坐标区域 | 最大坐标区域 | | 启动子位置 | 基因起始坐标上游 | 基因终止坐标下游 | | 内含子相位 | 相同计算方法 | 相同计算方法 | - **剪接位点保守性验证**: - 使用基因组序列验证内含子两端的`GT-AG`规则 - 负链基因需反向互补处理序列: ```python reverse_complement = lambda s: s[::-1].translate(str.maketrans('ATCG', 'TAGC')) ``` #### **4. 实用工具推荐** 1. **Biopython解析**: ```python from Bio.SeqIO import parse for record in parse("genome.fasta", "fasta"): # 结合GFF提取序列 ``` 2. **gffutils高效处理**: ```python import gffutils db = gffutils.create_db("input.gff", dbfn="anno.db") for gene in db.features_of_type("gene"): if gene.strand == "-": # 负链特殊处理 ``` 3. **IGV可视化**: - 导入GFF+基因组序列,直观对比正负链结构差异 #### **5. 注意事项** 1. **坐标系统转换**: - GFF使用1-based坐标系统,与BED格式(0-based)转换时需±1调整 2. **复杂情况处理**: - 嵌套基因(如内含子中的小RNA基因) - 跨链基因(罕见但需特殊处理) 3. **文件版本兼容**: - GFF3标准推荐使用`##gff-version 3`声明[^4] - 属性字段遵循`tag=value`格式,URL保留字符需转义 --- ### **应用场景案例** **研究问题**:分析水稻抗病基因中负链基因的内含子长度特征 **处理流程**: 1. 过滤`strand="-"`的基因 2. 提取内含子位置并计算长度 3. 比较正负链基因的内含子长度分布 4. 验证长内含子中的调控元件(如enhancer) > 关键发现:负链基因常含更长的第一个内含子(调控元件富集区)[^2]
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值