A genome browser in your Jupyter notebook
GenomeNotebook (1.0.0)
Install
pip install genomenotebook
Upgrade
New versions of genomenotebook are released on a regular basis. Make sure to upgrade your installation to enjoy all the features.
pip install genomenotebook --upgrade
How to use
Create a simple genome browser with a search bar. The sequence appears when zooming in.
import genomenotebook as gn
=gn.GenomeBrowser(gb_path=path_to_gb_file,
g=10000,
init_pos=["gene","product","locus_tag"], #chose attributes to display among the ones available in your genbank file
attributes
) g.show()
Using GFF and fasta formats
=gn.GenomeBrowser(gff_path=gff_path,
g=fasta_path,
fasta_path=10000,
init_pos
) g.show()
Tracks can be added to visualize your favorite genomics data. See Examples for more !!!!
Contributing to GenomeNotebook
GenomeNotebook is developed using the nbdev framework, which makes it easy to develop Python packages with Jupyter Notebooks.
Setting up a Fork
1. Fork the Repository
Navigate to the GenomeNotebook GitHub repository.
Click the “Fork” button in the top-right corner to create your own copy of the repository.
2. Clone Your Fork
Clone your forked repository to your local machine by running the following command in your terminal: bash git clone https://github.com/<your-username>/genomenotebook.git
Navigate to the cloned directory: bash cd genomenotebook
3. Set Up Upstream Remote
To keep your fork updated with the original repository:
Add the upstream repository: bash git remote add upstream https://github.com/dbikard/genomenotebook.git
Verify the remotes: bash git remote -v
You should see origin pointing to your fork and upstream pointing to the original repository.
Setting Up the Development Environment
- Create a virtual environment and activate it
conda create -n gn python=3.11
conda activate gn
- Install Required Tools
It is a good idea to read the nbdev Getting Started Guide and End-To-End Walkthrough
pip install jupyterlab
pip install nbdev
nbdev_install_quarto
pip install jupyterlab-quarto
nbdev_install_hooks
- Install dependecies and genomenotebook in editable mode
pip install -e '.[dev]'
Making Changes
- Sync with Upstream Repository Before making changes, ensure your fork is up-to-date:
git fetch upstream
git checkout main
git merge upstream/main
- Create a New Branch
git checkout -b <feature-branch>
Replace
- Make and Test Changes
Open the Jupyter Notebooks in the repository to make your changes. Changes should be made to notebooks in the nbs/
folder only. The package .py
files are automatically generated from the notebooks.
Run the following command to rebuild the Python package, documentation and run the tests:
nbdev_prepare
- When ready you can create a pull request.