IMG(Integrated Microbial Genomes,https://img.jgi.doe.gov/cgi-bin/m/main.cgi)由美國能源部聯合基因組研究中心(Joint GenomeInstitute,JGI)於2005年創立,是綜合的微生物基因組資料庫及比較分析系統。IMG收錄了細菌、古菌、質粒、病毒以及少量真核生物基因組數據,其數據主要來源於NCBI的RefSeq資料庫,但是增添了更加詳細的注釋信息,例如CRISPR序列、信號肽、非編碼RNA、功能基因等。IMG基於COG、Pfam、TIGRfam、InterPro、GO和KEGG等資料庫產生基因家族的注釋信息。其主頁如下所示:
IMG整理了詳細的微生物基因組信息,包括物種的分類、生存環境、基因組序列長度、GC含量、編碼基因數目、數據質量以及研究項目信息等,目前僅細菌基因組收錄的數目已超過5萬。在IMG搜索頁面(Find Genomes),每個條目均可排序篩選,查詢搜索十分方便,且基因組信息可以很方便的輸出。
基因組注釋信息我們可以很方便的導出到表格,那麼如何批量下載對應的基因組序列數據呢?在JGI Portal的主頁中(https://genome.jgi.doe.gov/portal/)列出了三種可行的下載方法,如下所示:
批量下載我們推薦第三種也即使用API進行下載,這樣我們可以很好的整合到程序裡面,在伺服器進行下載。點擊上面第三種方法,頁面上會列出curl地址及使用方法,如下所示:
首先我們需要在JGI主頁(https://img.jgi.doe.gov)註冊一個帳戶,然後使用Perl語言根據上述信息編寫下載程序:
use strict;use warnings;use Getopt::Long;
die "perl $0 -cookies yes|no $0 \n" if $#ARGV<0;my($cookies);GetOptions("cookies=s"=>\$cookies);my $user='xxxxxxxxx'; my $passwd="xxxxxxxxxx"; `curl 'https://signon-old.jgi.doe.gov/signon/create' --data-urlencode "login=$user" --data-urlencode "password=$passwd" -c cookies > login.log` unless $cookies eq "no";
while(<>){ chomp; next if /taxon_oid/; next if /^$/; my @line=split /\t+/; my $specie_name="IMG_".$line[6]; `curl 'https://genome.jgi.doe.gov/portal/ext-api/downloads/get-directory?organism=$specie_name' -b cookies > xml 2>/dev/null`; my($specie,$url)=&xml2url("xml",$specie_name); `curl 'https://genome.jgi.doe.gov/portal/ext-api/downloads/get_tape_file?blocking=true&url=$url' -b cookies -m 600 > $specie.tgz 2>/dev/null` if $url;}
sub xml2url{ my ($xml,$spe)=@_; open XML,$xml or die "Failed to open xml: $!"; my $input=join("", <XML>); if($input=~/label="(.+?)".+?url=(\/IMG.+?tar\.gz).+?md5/m){ my $label=$1; my $url=$2; $label=~s/\s+/_/g; $label=~s/[\(\)]/_/g; `mv $xml $label.xml`; return $label,$url; }else{ `cp $xml $spe.xml` ; }}此腳本最初發表於博客網站(http://blog.sina.com.cn/u/2622394401),這裡我根據IMG的curl網址變化進行了修改。我們將此腳本保存為down_genome_from_jgi.pl。接下來在IMG主頁搜索需要下載的基因組:
選中要下載的基因組後點擊Export保存xls文件到自己的電腦,然後上傳到伺服器,下載的文件如下所示:
其中第七列為IMG Genome ID,如果不是需要修改前面腳本的第18行。在伺服器批量下載這些基因組如下所示:
perl down_genome_from_jgi.pl taxontable56069_28-may-2019.xls下載完成後每個基因組均有一個後綴tgz的壓縮文件,裡面包含基因組序列與基因、蛋白序列等,如下所示: