{"id":26573243,"url":"https://github.com/linsalrob/genbank_to","last_synced_at":"2025-07-27T19:37:24.863Z","repository":{"id":57673968,"uuid":"481464683","full_name":"linsalrob/genbank_to","owner":"linsalrob","description":"Convert genbank files to a swath of other formats","archived":false,"fork":false,"pushed_at":"2023-09-29T10:58:18.000Z","size":48,"stargazers_count":11,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-26T06:21:32.107Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linsalrob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-04-14T04:25:25.000Z","updated_at":"2023-11-30T11:51:04.000Z","dependencies_parsed_at":"2022-08-31T11:22:38.323Z","dependency_job_id":"89a110d1-2ef9-49f9-b67b-14d96f628408","html_url":"https://github.com/linsalrob/genbank_to","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linsalrob%2Fgenbank_to","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linsalrob%2Fgenbank_to/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linsalrob%2Fgenbank_to/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linsalrob%2Fgenbank_to/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linsalrob","download_url":"https://codeload.github.com/linsalrob/genbank_to/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245040190,"owners_count":20551299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-23T00:39:53.454Z","updated_at":"2025-03-23T00:39:54.082Z","avatar_url":"https://github.com/linsalrob.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# genbank_to\r\n\r\n[![Edwards Lab](https://img.shields.io/badge/Bioinformatics-EdwardsLab-03A9F4)](https://edwards.flinders.edu.au/)\r\n[![DOI](https://www.zenodo.org/badge/481464683.svg)](https://www.zenodo.org/badge/latestdoi/481464683)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n![GitHub language count](https://img.shields.io/github/languages/count/linsalrob/genbank_to)\r\n[![PyPi](https://img.shields.io/pypi/pyversions/genbank_to.svg?style=flat-square\u0026label=PyPi%20Versions)](https://pypi.org/project/genbank_to/)\r\n\r\nA straightforward application to convert NCBI GenBank format files to a swath of other formats. Hopefully we have the \r\nformat you need, but if not either post [an issue](https://github.com/linsalrob/genbank_to/issues) using our template,\r\nor if you have already got it working, post [a PR](https://github.com/linsalrob/genbank_to/pulls) so we can add it and\r\nadd you to the project.\r\n\r\nYou might also be interested [deprekate's](https://github.com/deprekate/) package called [genbank](https://github.com/deprekate/genbank) which includes\r\nseveral of the features here, and you can `import genbank` into your Python projects.\r\n\r\n# What it does\r\n\r\nRead an NCBI GenBank format file (like our [test data](test/NC_001417.gbk)) and convert it to one of many\r\ndifferent formats.\r\n\r\n# Input formats\r\n\r\nAt the moment we only support NCBI GenBank format. If you want us to read other common formats, \r\n[let us know](https://github.com/linsalrob/genbank_to/issues) and we'll add them.\r\n\r\n# Output formats\r\n\r\nHere are the output formats you can request. You can request as many of these at once as you like!\r\n\r\nThese outputs are assuming you provide a (for example) genome file that contains ORFs, Proteins, and Genomes.\r\n\r\n## Nucleotide output\r\n\r\n - `-n` or `--nucleotide` outputs the whole DNA sequence (e.g. the genome)\r\n - `-o` or `--orfs` outputs the DNA sequence of the open reading frames\r\n\r\n## Protein output\r\n\r\n - `-a` or `--aminoacids` outputs the protein sequence for each of the open reading frames\r\n\r\n## Complex formats\r\n\r\n - `-p` or `--ptt` NCBI ptt protein table. This is a somewhat deprecated NCBI format from their genomes downloads\r\n - `-f` or `--functions` outputs tab separated data of `protein ID` and `protein function` (also called the `product`)\r\n - `--gff3` outputs GFF3 format\r\n - `--amr`  outputs a GFF file, an amino acid fasta file, and a nucleotide fasta file as required by [AMR Finder Plus](https://github.com/ncbi/amr/wiki/Running-AMRFinderPlus#examples). Note that this format checks for validity that often crashes AMRFinderPlus\r\n - `--phage_finder` outputs a unique format required by [phage_finder](http://phage-finder.sourceforge.net/)\r\n\r\n## Output options\r\n\r\n - `--pseudo` normally we skip pseudogenes (e.g. in creating amino acid fasta files). This will try and include pseudogenes, but often biopython complains and ignores them!\r\n - `-i` or `--seqid` only output this sequence, or these sequences if you specify more than one `-i`/`--seqid`\r\n - `-z` or `--zip` compress some of the outputs\r\n - `--log` write logs to a different file\r\n\r\n## Separate multi-GenBank files\r\n\r\nIf your GenBank files contains multiple sequence records (separated with `//`), you can provide the `--separate` flag. \r\nThis will write each entry into its own file. This is compatible with `-n`/`--nucleotide`, `-o`/`--orfs`, and\r\n`-a`/`--aminoacids`. However, if you provide the `--separate` flag on its own, it will write each entry in your \r\nmulti-GenBank file to its own GenBank file.\r\n\r\n## Examples\r\n\r\nAll of these examples use our [test data](test/NC_001417.gbk)\r\n\r\n1. Extract a `fasta` of the genome:\r\n\r\n```bash\r\ngenbank_to -g test/NC_001417.gbk -n test/NC_001417.fna\r\n```\r\n\r\n2. Extract the DNA sequences of the ORFs to a single file\r\n\r\n```bash\r\ngenbank_to -g test/NC_001417.gbk -o test/NC_001417.orfs\r\n```\r\n\r\n3. Extract the protein (amino acid) sequences of the ORFs to a file\r\n\r\n```bash\r\ngenbank_to -g test/NC_001417.gbk -a test/NC_001417.faa\r\n```\r\n\r\n4. Do all of these at once\r\n\r\n```bash\r\ngenbank_to -g test/NC_001417.gbk -n test/NC_001417.fna -o test/NC_001417.orfs -a test/NC_001417.faa\r\n```\r\n\r\n# Installation\r\n\r\nYou can install `genbank_to` in three different ways:\r\n\r\n1. Using conda\r\n\r\nThis is the easiest and recommended method.\r\n\r\n```bash\r\nmamba create -n genbank_to genbank_to\r\nconda activate genbank_to\r\ngenbank_to --help\r\n```\r\n\r\n2. Using pip\r\n\r\nI recommend putting this into a virtual environment:\r\n\r\n```bash\r\nvirtualenv venv\r\nsource venv/bin/activate\r\npip install genbank_to\r\ngenbank_to --help\r\n```\r\n\r\n3. Directly from this repository\r\n\r\n(Not really recommended as things might break)\r\n\r\n```bash\r\ngit clone https://github.com/linsalrob/genbank_to.git\r\ncd genbank_to\r\nvirtualenv venv\r\nsource venv/bin/activate\r\npython setup.py install\r\ngenbank_to --help\r\n```\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinsalrob%2Fgenbank_to","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinsalrob%2Fgenbank_to","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinsalrob%2Fgenbank_to/lists"}