從ncbi下載數據
One of the most important steps in genome analysis is gathering the data required for downstream research. This sometimes requires us to have the assembled reference genomes (mostly bacterial) so we can verify the classifiers trained or bins detected are correct and useful. This is often achieved using a BLAST search against the candidate reference genomes. However, it is very convenient to have our own BLAST database set up in advance if you are going to make a lot of search queries in future. Using the NCBI Web BLAST might not be a viable option if the project is long-running one with many experiments.
基因組分析中最重要的步驟之一就是收集下游研究所需的數據。 有時這需要我們具有組裝的參考基因組(主要是細菌),因此我們可以驗證訓練的分類器或檢測到的垃圾箱是正確且有用的。 這通常是通過對候選參考基因組進行BLAST搜索來實現的。 但是,如果將來您要進行很多搜索查詢,則預先設置我們自己的BLAST數據庫非常方便。 如果該項目長期運行并進行了許多實驗,則使用NCBI Web BLAST可能不是一個可行的選擇。
In this article, we will see how we can download the set of all the available bacterial references (or assemblies) from either GenBank or RefSeq databases. This wasn't quite straightforward, hence we present an article dedicated to this particular task.
在本文中,我們將看到如何從GenBank或RefSeq數據庫下載所有可用細菌參考(或程序集)的集合。 這并不是很簡單,因此我們提供了一篇專門針對此特定任務的文章。
下載組裝信息 (Downloading Assembly Information)
Assembly metadata is available at NCBI under the URL: ftp://ftp.ncbi.nih.gov/genomes/. Here all the directories are listed and can be visited via any modern browser. In this article, we are concerned about the reference genomes from either GenBank or RefSeq databases.
程序集元數據可在NCBI的URL下找到: ftp : //ftp.ncbi.nih.gov/genomes/ 。 這里列出了所有目錄,并且可以通過任何現代瀏覽器進行訪問。 在本文中,我們關注來自GenBank或RefSeq數據庫的參考基因組。
In both databases, bacterial references are available under following paths;
在這兩個數據庫中,可以通過以下路徑獲得細菌參考。
Genbank: ftp://ftp.ncbi.nih.gov/genomes/genbank/bacteria/
Genbank: ftp : //ftp.ncbi.nih.gov/genomes/genbank/bacteria/
RefSeq: ftp://ftp.ncbi.nih.gov/genomes/refseq/bacteria/
參考序列: ftp : //ftp.ncbi.nih.gov/genomes/refseq/bacteria/
Furthermore, the information regarding individual assemblies are available under;
此外,有關單個裝配的信息可在下面獲得;
Genbank: ftp://ftp.ncbi.nih.gov/genomes/genbank/bacteria/assembly_summary.txt
Genbank: ftp : //ftp.ncbi.nih.gov/genomes/genbank/bacteria/assembly_summary.txt
RefSeq: ftp://ftp.ncbi.nih.gov/genomes/refseq/bacteria/assembly_summary.txt
參考序列: ftp : //ftp.ncbi.nih.gov/genomes/refseq/bacteria/assembly_summary.txt
Use following command to download the summary file.
使用以下命令下載摘要文件。
wget ftp://ftp.ncbi.nih.gov/genomes/genbank/bacteria/assembly_summary.txt#ORwget ftp://ftp.ncbi.nih.gov/genomes/refseq/bacteria/assembly_summary.txt
Our first step would be to download this text file. The first line of the file will say the following information.
我們的第一步是下載此文本文件。 文件的第一行將顯示以下信息。
# See ftp://ftp.ncbi.nlm.nih.gov/genomes/README_assembly_summary.txt for a description of the columns in this file.
自述文件的關鍵信息摘要 (The critical information summary of the readme)
- Column 12: “assembly_level”: this field could be one of the choices; “Complete Genome”, “Scaffold”, “Chromosome”, “Contig”. Usually, the “Complete Genome” rows are important for analysis. 第12列:“ assembly_level”:此字段可以是選擇之一; “完整基因組”,“腳手架”,“染色體”,“重疊群”。 通常,“完整基因組”行對于分析很重要。
- Column 14: “genome_rep”: Could be either “Full” or “Partial”. Full contains assemblies from WGS reads. 第14列:“ genome_rep”:可以為“ Full”或“ Partial”。 完整包含來自WGS讀取的程序集。
- Column 11: “version_status”: Could be “latest”, “replaces” or “suppressed”. It might be common to go with the “latest” assembly. 第11欄:“ version_status”:可以是“最新”,“替換”或“被抑制”。 使用“最新”程序集可能很常見。
Column 20: “ftp_path”: Path to download the files. In the assembly path, you can use the wildcard file ending “*_genomic.fna.gz” to select the fast assembly file.
第20列:“ ftp_path”:下載文件的路徑。 在匯編路徑中,可以使用以“ * _genomic.fna.gz ”結尾的通配符文件來選擇快速匯編文件。
In the Bash terminal, you can use the following command to obtain the FTP paths for downloading the references.
在Bash終端中,可以使用以下命令獲取用于下載引用的FTP路徑。
awk -F '\t' '{if($12=="Complete Genome") print $20}' assembly_summary.txt > assembly_summary_complete_genomes.txt
Here we chose Column 12 to be “Complete Genome”. Now in the assembly_summary_complete_genomes.txt
file you’ll see the available FTP paths to download the genomes from. If you check the file it’ll look like the following (first 3 lines);
在這里,我們選擇第12列作為“完整基因組”。 現在,在assembly_summary_complete_genomes.txt
文件中,您將看到可用于從中下載基因組的FTP路徑。 如果您檢查文件,它將類似于以下內容(前三行);
ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/010/525/GCF_000010525.1_ASM1052v1
ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/007/365/GCF_000007365.1_ASM736v1
ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/007/725/GCF_000007725.1_ASM772v1
下載Fasta文件 (Downloading the Fasta Files)
It is better to create a folder as references using the following command.
最好使用以下命令創建一個文件夾作為參考。
mkdir references
Now you can execute the following command to download the gzipped FASTA files.
現在,您可以執行以下命令來下載壓縮后的 FASTA文件。
for next in $(cat assembly_summary_complete_genomes.txt); do wget -P
Now you’ll see gz files for all the assemblies that satisfy your condition specified in the awk command before.
現在,您將看到滿足awk命令之前指定條件的所有程序集的gz文件。
You will be required to either extract them or gather them to a single file for downstream analysis. We suggest the readers have a look at the following article to see how to make a BLAST database.
您將需要提取它們或將它們收集到單個文件中以進行下游分析。 我們建議讀者閱讀以下文章,以了解如何制作BLAST數據庫。
We hope this article would help future researchers to obtain datasets needed for their bacterial studies. Happy reading. Cheers!
我們希望本文能幫助未來的研究人員獲得細菌研究所需的數據集。 祝您閱讀愉快。 干杯!
翻譯自: https://medium.com/computational-biology/how-to-download-all-bacterial-assemblies-from-ncbi-35f4bc5435f9
從ncbi下載數據
本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。 如若轉載,請注明出處:http://www.pswp.cn/news/387918.shtml 繁體地址,請注明出處:http://hk.pswp.cn/news/387918.shtml 英文地址,請注明出處:http://en.pswp.cn/news/387918.shtml
如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!