Package: taxonize-gb
Taxonize_genbankTaxonize_genbank is a python package useful to download, filter, and curated the Genbank non-redundant protein and nucleotide databases, based on a given taxonomy ID (TaxID) and/or list of keywords.InstallationDependenciesTo use this tool, make sure you have the following libraries installed:Python 3.7 or higherBiopython: 1.81tqdm: 4.64.1ete3: 3.1.3networkx: 2.6.3six: 1.16.0Please make sure to install these dependencies before using the tool.Then, you can clone this repository to your local machine usinggit.Open your terminal and run the following command:gitclonehttps://github.com/msabrysarhan/taxonize_genbankOr alternatively (recomended), you can installtaxonize_gbusing usingpip:pipinstalltaxonize-gbUsageTaxonize_gbhas three main modules:get_db.pyusage:get_db.py[-h]--db_nameDB_NAME--outOUT

DownloadNCBIdatabases.

optionalarguments:-h,--helpshowthishelpmessageandexit--db_nameDB_NAMEWhichNCBIdatabasetobedownloaded.Possiblevaluesarethefollowing:'taxdb':TheNCBItaxonomydumpdatabasefiles.'nr':Thenon-redundantproteindatabase.'nt':Thenon-redundantnucleotidedatabase.'prot_acc2taxid':GenBankproteinaccessionnumbertotaxonomyIDmappingfile.'pdb_acc2taxid':ProteinDatabase(PDB)accessionnumbertotaxonomyIDmappingfile.'nucl_gb_acc2taxid':Nucleotide(GenBank,GB)accessionnumbertotaxonomyIDmappingfile.'nucl_wgs_acc2taxid':Nucleotide(WholeGenomeShotgun,WGS)accessionnumbertotaxonomyIDmappingfile.--outOUTPathtooutputdirectorywheretheresultsaretobestored.taxonize_gb.pyusage:taxonize_gb.py[-h]--dbDB[--db_pathDB_PATH][--taxdbTAXDB][--prot_acc2taxidPROT_ACC2TAXID][--pdb_acc2taxidPDB_ACC2TAXID][--nucl_gb_acc2taxidNUCL_GB_ACC2TAXID][--nucl_wgs_acc2taxidNUCL_WGS_ACC2TAXID][--taxidTAXID][--keywordsKEYWORDS]--outOUT

FilterNCBInt/nrdatabasebasedonagiventaxid.

optionalarguments:-h,--helpshowthishelpmessageandexit--dbDBWhichNCBIdatabasetobeused.Pleaseuseeitherntfornucleotidedatabaseornrforproteindatabase--db_pathDB_PATHPathtont/nrgzippedfastafile(ifnotprovided,thelatestversionwillbedownloadedfromtheNCBI(mustbeprovidedwith--db)--taxdbTAXDBPathtogzippedtaxonomydatabasefromtheNCBI(ifnotprovided,thelatestversionwillbedownloadedfromtheNCBI--prot_acc2taxidPROT_ACC2TAXIDPathtogzippedGenBankproteinaccessionnumbertotaxidmappingfilefromtheNCBI;workswith--dbnr(ifnotprovided,thelatestversionwillbedownloadedfromtheNCBI--pdb_acc2taxidPDB_ACC2TAXIDPathtogzippedPDBproteinaccessionnumbertotaxidmappingfilefromtheNCBI;workswith--dbnr(ifnotprovided,thelatestversionwillbedownloadedfromtheNCBI--nucl_gb_acc2taxidNUCL_GB_ACC2TAXIDPathtogzippedGenbanknucleotideaccessionnumbertotaxidmappingfilefromtheNCBI;workswith--dbnt(ifnotprovided,thelatestversionwillbedownloadedfromtheNCBI--nucl_wgs_acc2taxidNUCL_WGS_ACC2TAXIDPathtogzippedwholegenomesequenceaccessionnumbertotaxidmappingfilefromtheNCBI;workswith--dbnt(ifnotprovided,thelatestversionwillbedownloadedfromtheNCBI--taxidTAXIDTargettaxonomyIDtofilterfor--keywordsKEYWORDSkeywordstobeincludedinthefastaheadersofthetargettaxonomyID--outOUTPathtooutputdirectorywheretheresultsaretobestored.get_taxonomy.pyusage:get_taxonomy.py[-h]--fastaFASTA--mapMAP--outOUT

GettaxonomiclineagesofFASTAaccessions.

optionalarguments:-h,--helpshowthishelpmessageandexit--fastaFASTANCBIFASTAfiletobefiltered.--mapMAPAccessionnumbertotaxonomyIDsgzippedmappingfile.--outOUTPathtooutputfiletowritethetaxonomiclineagesoftheGenBankaccessionnumbers.ExamplesPlant non-redundant protein databaseFirst, we need to use theget_dbmodule to download the following files to a directorydatabases:# The nr FASTA fileget_db--db_namenr--outdatabases# The NCBI accession to taxonomy ID mapping fileget_db--db_nameprot_acc2taxid--outdatabases# The PDB accession to taxonomy ID mapping fileget_db--db_namepdb_acc2taxid--outdatabases# The NCBI taxonomy databaseget_db--db_nametaxdb--outdatabasesNow that we have the databases downloaded, we can usetaxonize_gbto filter the nr FASTA to keep only the plant protein records:# we use the taxid of Viridiplantae (33090) and we write the outputs to a directory "plant_nr"taxonize_gb--dbnr--db_pathdatabases/nr.gz--taxdbdatabases/taxdump.tar.gz--prot_acc2taxiddatabases/prot.accession2taxid.gz--pdb_acc2taxidpdb.accession2taxid.gz--taxid33090--outplant_nrInsects non-redundant nucleotide databaseSimilar to the previous example, we first need to use theget_dbto download the database file:# The nt FASTA fileget_db--db_nament--outdatabases# The GenBank accession to taxonomy ID mapping fileget_db--db_namenucl_gb_acc2taxid--outdatabases# The WGS accession to taxonomy ID mapping fileget_db--db_namenucl_wgs_acc2taxid--outdatabases# The NCBI taxonomy databaseget_db--db_nametaxdb--outdatabasesNow we can use thetaxonize_gbto filter the nt FASTA to keep only the insects nucleotide records:# we use the taxid of Insecta (50557) and we write the outputs to a directory "insects_nt"taxonize_gb--dbnt--db_pathdatabases/nt.gz--taxdbdatabases/taxdump.tar.gz--nucl_gb_acc2taxiddatabases/nucl_gb.accession2taxid.gz--nucl_wgs_acc2taxiddatabases/nucl_wgs.accession2taxid.gz--taxid50557--outinsect_ntNematodes mitochondrial genomesWe can use the databases we downloaded in the previous steps, then we can proceed to the next step to use thetaxonize_dbwith the flag--keywords mitochondrion,'complete genome'to find the header that contain both words, as follow:# we use the taxid of Nematoda (6231) and we write the outputs to a directory "nematoda_mito"taxonize_gb--dbnt--db_pathdatabases/nt.gz--taxdbdatabases/taxdump.tar.gz--nucl_gb_acc2taxiddatabases/nucl_gb.accession2taxid.gz--nucl_wgs_acc2taxiddatabases/nucl_wgs.accession2taxid.gz--taxid6231--keywordsmitochondrion,'complete genome'--outnematoda_mitoLicenseThis package is distributed under theCreative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0). Please see theLICENSEfile for the full license text.