-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
83 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
| [![Documentation Status](https://github.com/BjornFJohansson/pydna/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/BjornFJohansson/pydna/actions/workflows/publish-docs.yml) | [![GitHub issues](https://img.shields.io/github/issues/BjornFJohansson/pydna.svg)](https://github.com/BjornFJohansson/pydna/issues) | [![Anaconda-Server Badge2](https://anaconda.org/bjornfjohansson/pydna/badges/license.svg)](https://anaconda.org/bjornfjohansson/pydna) | [![GitHub stars](https://img.shields.io/github/stars/BjornFJohansson/pydna.svg)](https://github.com/BjornFJohansson/pydna/stargazers) | | ||
|
||
|
||
|
||
Planning genetic constructs with many parts and assembly steps, such as recombinant | ||
metabolic pathways :petri_dish:, are often difficult to **properly** document as is evident from the poor | ||
state of documentation in the scientific literature :radioactive:. | ||
|
@@ -15,10 +14,8 @@ The pydna python package provide a human-readable formal descriptions of :dna: c | |
strategies in Python :snake: which allow for simulation and verification. | ||
Pydna can be used as [executable documentation](https://en.wikipedia.org/wiki/Literate_programming) for cloning. | ||
|
||
|
||
A cloning strategy expressed in pydna is **complete**, **unambiguous** and **stable**. | ||
|
||
|
||
Pydna provides simulation of: | ||
|
||
- Primer design | ||
|
@@ -47,11 +44,15 @@ For more elaborate use, look at some assembly strategies of D-xylose metabolic p | |
|
||
See below for documentation. | ||
|
||
![----]( http://bit.ly/coloredline) | ||
## Acknowledgement 🤝 | ||
|
||
If you use pydna in your research, please reference the paper: | ||
|
||
Pereira, F., Azevedo, F., Carvalho, Â., Ribeiro, G. F., Budde, M. W., & Johansson, B. (2015). Pydna: a simulation and documentation tool for DNA assembly strategies using python. BMC Bioinformatics, 16(142), 142. [doi:10.1186/s12859-015-0544-x](https://doi.org/10.1186/s12859-015-0544-x) | ||
|
||
## Usage | ||
## Documentation and usage 📚 | ||
|
||
Full documentation of all modules and classes can be found at [https://bjornfjohansson.github.io/pydna](https://bjornfjohansson.github.io/pydna). | ||
|
||
Most pydna functionality is implemented as methods for the double stranded DNA sequence record | ||
classes Dseq and Dseqrecord, which are subclasses of the [Biopython](http://biopython.org/wiki/Main_Page) | ||
|
@@ -63,132 +64,34 @@ These classes make PCR primer design, PCR simulation and cut-and-paste cloning v | |
|
||
As the example above shows, pydna keeps track of sticky ends and features. | ||
|
||
|
||
Pydna can be very compact. The eleven lines of Python below simulates the construction of a recombinant plasmid. | ||
DNA sequences are downloaded from Genbank by accession numbers that are guaranteed to be stable over time. | ||
|
||
from pydna.genbank import Genbank | ||
gb = Genbank("[email protected]") # Tell Genbank who you are! | ||
gene = gb.nucleotide("X06997") # Kluyveromyces lactis LAC12 gene for lactose permease. | ||
from pydna.parsers import parse_primers | ||
primer_f,primer_r = parse_primers(''' >760_KlLAC12_rv (20-mer) | ||
ttaaacagattctgcctctg | ||
|
||
>759_KlLAC12_fw (19-mer) | ||
aaatggcagatcattcgag ''') | ||
from pydna.amplify import pcr | ||
pcr_prod = pcr(primer_f,primer_r, gene) | ||
vector = gb.nucleotide("AJ001614") # pCAPs cloning vector | ||
from Bio.Restriction import EcoRV | ||
lin_vector = vector.linearize(EcoRV) | ||
rec_vec = ( lin_vector + pcr_prod ).looped() | ||
|
||
Another use case for pydna in the automatic generation of [sub cloning](http://en.wikipedia.org/wiki/Subcloning) examples for teaching purposes. | ||
|
||
Feedback & suggestions are very welcome! Please post a message in the [google group](https://groups.google.com/d/forum/pydna) for pydna if you need help or have problems, questions or comments :sos:. | ||
|
||
![----]( http://bit.ly/coloredline) | ||
|
||
|
||
## Who is using pydna? | ||
|
||
Taylor, L. J., & Strebel, K. (2017). | ||
Pyviko: an automated Python tool to design gene knockouts in complex viruses with overlapping genes. | ||
BMC Microbiology, 17(1), 12. | ||
[PubMed](https://www.ncbi.nlm.nih.gov/pubmed/28061810) | ||
|
||
|
||
Wang, Y., Xue, H., Pourcel, C., Du, Y., & Gautheret, D. (2021). | ||
2-kupl: mapping-free variant detection from DNA-seq data of matched samples. | ||
In Cold Spring Harbor Laboratory (p. 2021.01.17.427048). [DOI](https://doi.org/10.1101/2021.01.17.427048) | ||
[PubMed](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8180056) | ||
|
||
|
||
[An Automated Protein Synthesis Pipeline with Transcriptic and Snakemake](http://blog.booleanbiotech.com/transcriptic_protein_synthesis_pipeline.html) | ||
|
||
and other projects on [github](https://github.com/BjornFJohansson/pydna/network/dependents?package_id=UGFja2FnZS01MjQ2MjYzNQ%3D%3D) | ||
|
||
![----]( http://bit.ly/coloredline) | ||
|
||
There is an open access paper in BMC Bioinformatics describing pydna: | ||
|
||
[![abstr](https://raw.githubusercontent.com/bjornFJohansson/pydna/master/docs/pics/BMC_resized.png)](http://www.biomedcentral.com/1471-2105/16/142/abstract) | ||
|
||
Please reference the above paper: | ||
|
||
Pereira, F., Azevedo, F., Carvalho, Â., Ribeiro, G. F., Budde, M. W., & Johansson, B. (2015). Pydna: a simulation and documentation tool for DNA assembly strategies using python. BMC Bioinformatics, 16(142), 142. | ||
|
||
When using pydna. | ||
|
||
![----]( http://bit.ly/coloredline) | ||
|
||
## Documentation :page_with_curl: | ||
|
||
Documentation can be found [here](https://bjornfjohansson.github.io/pydna). It is built using [Sphinx](http://www.sphinx-doc.org/) from [docstrings](https://www.python.org/dev/peps/pep-0257/) | ||
using a GitHub [action](https://github.com/BjornFJohansson/pydna/actions/workflows/publish-docs.yml). | ||
The [numpy](www.numpy.org) [docstring format](https://numpy.org/doc/stable/dev/howto-docs.html#docstring-intro) is used. | ||
|
||
|
||
|
||
|
||
|
||
![----]( http://bit.ly/coloredline) | ||
|
||
## Installation using pip | ||
|
||
Pip is included in recent Python versions and is the | ||
officially [recommended](http://python-packaging-user-guide.readthedocs.org/en/latest) tool. | ||
|
||
Pip installs the minimal installation requirements automatically, but not the optional requirements (see below). | ||
The --pre switch to get the latest version of pydna. | ||
|
||
pip install --pre --upgrade pydna | ||
|
||
|
||
for optional functionality do: | ||
|
||
pip install --pre --upgrade pydna[clipboard,download,express,gel] | ||
|
||
Remove options inside the square brackets as required, but be sure not to leave spaces as pip will not recognize the options. See below under "Optional dependencies". | ||
|
||
### Windows: | ||
|
||
You should be able to pip install pydna from the Windows terminal as biopython now can be installed with pip as well. | ||
|
||
C:\> pip install pydna | ||
|
||
By default python and pip are not on the PATH. You can re-install Python and select this option during installation, or give the full path for pip. Try something like this, depending on where your copy of Python is installed: | ||
|
||
C:\Python37\Scripts\pip install pydna | ||
|
||
![----]( http://bit.ly/coloredline) | ||
|
||
## Source Code | ||
|
||
Pydna is developed on [Github](https://github.com/BjornFJohansson/pydna) :octocat:. | ||
I am happy to collaborate on new features or bugfixes. | ||
|
||
## Minimal installation dependencies | ||
|
||
The list below is the minimal requirements for installing pydna. | ||
Biopython and pydivsufsort has c-extensions, but the other modules are pure python. | ||
|
||
- [Python 3.8, 3.9, 3.10, 3.11 or 3.12](http://www.python.org) | ||
- [appdirs](https://pypi.python.org/pypi/appdirs) | ||
- [biopython](http://pypi.python.org/pypi/biopython) | ||
- [networkx](http://pypi.python.org/pypi/networkx) | ||
- [prettytable](https://pypi.python.org/pypi/PrettyTable) | ||
- [pydivsufsort](https://pypi.python.org/pypi/pydivsufsort) | ||
- [pyfiglet](https://pypi.python.org/pypi/pyfiglet) | ||
|
||
Pydna is importable even without pyfiglet. | ||
```python | ||
from pydna.genbank import Genbank | ||
gb = Genbank("[email protected]") # Tell Genbank who you are! | ||
gene = gb.nucleotide("X06997") # Kluyveromyces lactis LAC12 gene for lactose permease. | ||
from pydna.parsers import parse_primers | ||
primer_f,primer_r = parse_primers(''' >760_KlLAC12_rv (20-mer) | ||
ttaaacagattctgcctctg | ||
>759_KlLAC12_fw (19-mer) | ||
aaatggcagatcattcgag ''') | ||
|
||
from pydna.amplify import pcr | ||
pcr_prod = pcr(primer_f,primer_r, gene) | ||
vector = gb.nucleotide("AJ001614") # pCAPs cloning vector | ||
from Bio.Restriction import EcoRV | ||
lin_vector = vector.linearize(EcoRV) | ||
rec_vec = ( lin_vector + pcr_prod ).looped() | ||
``` | ||
|
||
## Optional dependencies | ||
## Installation 📦 | ||
|
||
These can be installed `pip install pydna[clipboard,gel,download,express]` | ||
where `[clipboard,gel,download,express]` is the list of options available. Any | ||
combination of the words inside the square brackets are allowed, but no white space. | ||
By default, pydna is installed with minimal dependencies, but there are optional dependencies for additional functionality. | ||
|
||
<details> | ||
<summary>Click here to see optional dependencies</summary> | ||
|
||
### `clipboard` | ||
|
||
|
@@ -233,40 +136,45 @@ needed, but usually installed as a dependency of biopython. | |
| [matplotlib](http://matplotlib.org) | “ | | ||
| [pillow](https://github.com/python-pillow/Pillow) | “ | | ||
|
||
</details> | ||
|
||
## Requirements for running tests, coverage and profiling | ||
### Installing with pip 🐍 | ||
|
||
- [pytest](https://pypi.org/project/pytest) | ||
- [pytest-cov](https://pypi.org/project/pytest-cov) | ||
- [pytest-doctestplus](https://pypi.org/project/pytest-doctestplus) | ||
- [pytest-profiling](https://pypi.org/project/pytest-profiling) | ||
- [coverage](https://pypi.org/project/coverage) | ||
- [nbval](https://pypi.org/project/nbval) | ||
- [requests-mock](https://pypi.org/project/requests-mock) | ||
```bash | ||
# use the `--pre` flag to get the latest version of pydna. | ||
pip install --pre --upgrade pydna | ||
|
||
for instance by `pip install pytest pytest-cov pytest-doctestplus pytest-profiling coverage nbval requests-mock` | ||
# to install the optional dependencies, you can use the following command: | ||
pip install --pre --upgrade pydna[clipboard,download,express,gel] | ||
``` | ||
|
||
Running the entire test suite also require: | ||
Remove options inside the square brackets as required, but be sure not to leave spaces as pip will not recognize the options. See below under "Optional dependencies". | ||
|
||
- scipy | ||
- matplotlib | ||
- pillow | ||
- pyparsing | ||
- requests | ||
- cai2 | ||
### Installing with poetry 🧙♂️ | ||
|
||
That can be installed by `pip install pydna[clipboard,gel,download,express]` | ||
If your project uses [poetry](https://python-poetry.org/) to manage dependencies, you can install pydna with the following commands: | ||
|
||
or by `pip install pyparsing requests cai2 scipy matplotlib pillow` | ||
```bash | ||
# Basic installation | ||
poetry add pydna | ||
# With optional dependencies (ommit the options you don't want) | ||
poetry add pydna --extras "clipboard download express gel" | ||
|
||
# If you already have it installed and you want to add or remove optional | ||
# dependencies, you have to uninstall and install again | ||
poetry remove pydna | ||
poetry add pydna --extras "express gel" | ||
``` | ||
|
||
## Contributing and feedback 🛠️ | ||
|
||
![----]( http://bit.ly/coloredline) | ||
Feedback & suggestions are very welcome! Please create an issue with your question, comment or suggestion. Please include the version of pydna you are using and code to reproduce the issue if possible. | ||
|
||
## Contributing | ||
If you don't have a github account, you can get in touch through the [google group](https://groups.google.com/d/forum/pydna) for pydna. | ||
|
||
Please direct pull requests towards the `dev_bjorn` branch. | ||
Below are the instructions for developers who want to contribute to pydna. Please direct pull requests towards the `dev_bjorn` branch. | ||
|
||
### Fork the repository and set up a dev branch | ||
### Fork the repository and set up a dev branch 🍴 | ||
|
||
Fork the entire repository (not just the `master` branch by unticking the "Copy the `master` branch only" box) | ||
|
||
|
@@ -291,8 +199,7 @@ git pull origin dev_bjorn | |
git checkout -b issue_<number> | ||
``` | ||
|
||
|
||
### Local development | ||
### Local development 💻 | ||
|
||
1. Use [Poetry](https://python-poetry.org/docs/#installation) to install dependencies and activate virtual environment. | ||
|
||
|
@@ -316,7 +223,16 @@ git checkout -b issue_<number> | |
6. Push the changes to your fork | ||
7. From your fork,make a PR towards the branch `dev_bjorn` in the original repository. | ||
#### Building the documentation locally | ||
### Continuous integration 🤖 | ||
The test_and_coverage workflow is triggered on all pushed commits for all branches except the `master` branch. This workflow run tests, doctests and a series of Jupyter notebooks using pytest on Linux, Windows and macOS with all | ||
supported python versions. | ||
### Building the documentation locally 📚 | ||
Documentation is built using [Sphinx](http://www.sphinx-doc.org/) from [docstrings](https://www.python.org/dev/peps/pep-0257/) | ||
using a GitHub [action](https://github.com/BjornFJohansson/pydna/actions/workflows/publish-docs.yml). | ||
The [numpy](www.numpy.org) [docstring format](https://numpy.org/doc/stable/dev/howto-docs.html#docstring-intro) is used. | ||
Below the commands to run a local sphinx server that auto-updated when files are changed. | ||
|
@@ -329,53 +245,36 @@ sphinx-autobuild --watch src/ docs docs/_build/html | |
``` | ||
## Automatic testing & Release process | ||
## Release process 🚀 | ||
See the [releases](https://github.com/BjornFJohansson/pydna/releases) for changes and releases. | ||
There are two github actions for this package: | ||
- `.github/workflows/pydna_test_and_coverage_workflow.yml` | ||
- `.github/workflows/pydna_pypi_build_workflow.yml` | ||
The test_and_coverage workflow is triggered on all pushed commits for all branches except the `master` branch. This workflow run tests, doctests and a series of Jupyter notebooks using pytest on Linux, Windows and macOS with all | ||
supported python versions. | ||
The build workflow builds a PyPI packages using poetry. This workflow is triggered by publishing a Github release manually from the Github web interface. | ||
![----]( http://bit.ly/coloredline) | ||
## Building a PyPI package with [Poetry](https://pypi.org/project/poetry) | ||
1. Commit changes to git | ||
2. Tag the commit according to the [Semantic Versioning](https://semver.org) format, for example "v2.0.1a3". Do not forget the "v" or poetry will not recognize the tag. | ||
git tag v2.0.1a3 | ||
3. Pydna uses the poetry [poetry-dynamic-versioning](https://pypi.org/project/poetry-dynamic-versioning) plugin. | ||
## History 📜 | ||
poetry dynamic-versioning # This sets the version number in the source files | ||
4. Verify the version | ||
poetry version | ||
5. Build package: | ||
poetry build # run this command in the root directory where the pyproject.toml file is located | ||
Pydna was made public in 2012 on [Google code](https://code.google.com/archive/p/pydna). | ||
6. Verify the filename of the files in the dist/ folder, they should match | ||
:microbe: | ||
7. Publish to pypi | ||
:portugal: | ||
poetry publish | ||
## Who is using pydna? 🧪 | ||
![----]( http://bit.ly/coloredline) | ||
Taylor, L. J., & Strebel, K. (2017). | ||
Pyviko: an automated Python tool to design gene knockouts in complex viruses with overlapping genes. | ||
BMC Microbiology, 17(1), 12. | ||
[PubMed](https://www.ncbi.nlm.nih.gov/pubmed/28061810) | ||
## History | ||
Wang, Y., Xue, H., Pourcel, C., Du, Y., & Gautheret, D. (2021). | ||
2-kupl: mapping-free variant detection from DNA-seq data of matched samples. | ||
In Cold Spring Harbor Laboratory (p. 2021.01.17.427048). [DOI](https://doi.org/10.1101/2021.01.17.427048) | ||
[PubMed](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8180056) | ||
Pydna was made public in 2012 on [Google code](https://code.google.com/archive/p/pydna). | ||
[ShareYourCloning](https://shareyourcloning.org), a web application for designing and documenting DNA cloning strategies. | ||
:microbe: | ||
[An Automated Protein Synthesis Pipeline with Transcriptic and Snakemake](http://blog.booleanbiotech.com/transcriptic_protein_synthesis_pipeline.html) | ||
:portugal: | ||
and other projects on [github](https://github.com/BjornFJohansson/pydna/network/dependents?package_id=UGFja2FnZS01MjQ2MjYzNQ%3D%3D) |