macでインフォマティクス

macでインフォマティクス

HTS (NGS) 関連のインフォマティクス情報についてまとめています。

NCBIからvirusゲノムをダウンロードする

Accession IDを使い、virusのゲノム配列(FASTA)をダウンロードする。

 

 

NCBIのvirus Genomesに移動する。

f:id:kazumaxneo:20171115201348j:plain

左下の方の"Accession list of all viral genomes"をクリックしてvirusのリストをダウンロードする。

 

このようなリストが入手できる。

user$ head taxid10239.nbr.txt 

## Neighbors data for complete genomes: Viruses (taxid 10239)

## Columns: "Representative" "Neighbor" "Host" "Selected lineage" "Taxonomy name" "Segment name"

NC_003663 KC813499 vertebrates,human Poxviridae,Orthopoxvirus,Cowpox virus Cowpox virus segment  

NC_003663 HQ420896 vertebrates,human Poxviridae,Orthopoxvirus,Cowpox virus Cowpox virus segment  

NC_003663 KC813500 vertebrates,human Poxviridae,Orthopoxvirus,Cowpox virus Cowpox virus segment  

NC_003663 KY463519 vertebrates,human Poxviridae,Orthopoxvirus,Cowpox virus Cowpox virus segment  

NC_003663 KY549148 vertebrates,human Poxviridae,Orthopoxvirus,Cowpox virus Cowpox virus segment  

NC_003663 HQ420897 vertebrates,human Poxviridae,Orthopoxvirus,Cowpox virus Cowpox virus segment  

NC_003663 LT896722 vertebrates,human Poxviridae,Orthopoxvirus,Cowpox virus Cowpox virus segment  

NC_003663 KY549149 vertebrates,human Poxviridae,Orthopoxvirus,Cowpox virus Cowpox virus segment  

 

Accesion IDだけ抽出する。また同じIDを1つにまとめる。

cut -f 1 taxid10239.nbr.txt |unique -f 1 accesssion_ID.txt

user$ head accesssion_ID.txt

NC_003663

NC_003310

NC_006998

NC_001611

NC_027213

NC_005336

NC_002188

NC_024447

NC_004002

NC_001266

 

editectを使い、ゲノムをダウンロードする。なければbrewでインストールしておく。

brew install edirect

 

efetchコマンドをループで回しダウンロードする。

cat accesssion_ID.txt | while read p; do echo $p; efetch -db nucleotide -id $p -format fasta > $p.fasta; done;

 

 

 

引用

Biostar

https://www.biostars.org/p/3297/