Skip to content

Commit

Permalink
Documentation notebooks 2 (#272)
Browse files Browse the repository at this point in the history
* Documentation notebooks (#271)

* added documentation for dseq.py

* fixed docs for Dseq.py

* fixed docs for Dseq.py

* add hook

* fix exclusions and run hook

* strip outputs of Dseq.ipynb

* update Dseq notebook

* placed notebooks in docs

* added looped and shifted methods in Dseq docs

* added docs for importing files using pydna

* added some Dseqrecord docs

* added docs+examples for Dseq_Features

* added origin spanning feats and removing feats for Dseq_Features

* some comments and todos

* added restriction page

* updated Importing_Seq page

* updated Dseq_Feature Page w/examples

* added restrict+ligate notebook

* added some PCR notes

* added examples, prints

* added tm and design

* fixed tm_default docs

* added gibson assembly

* some comments on current progress

* gibson

* fixed comments, added gibson example and CRISPR

* added Restriction example

* added Gibson example

* closes #256

* run pre-commit

* alternative example for gibson

* gibson updated example

* modified crispr

* modified crispr

* feedback changes for #260

* best practices for qualifiers

---------

Co-authored-by: Pei-Lun Xie <[email protected]>
Co-authored-by: Pei-Lun Xie <[email protected]>

* remove unnecessary file

* remove dir exclusions

* exclude test notebooks

---------

Co-authored-by: Pei-Lun Xie <[email protected]>
Co-authored-by: Pei-Lun Xie <[email protected]>
  • Loading branch information
3 people authored Sep 30, 2024
1 parent c590850 commit a629c82
Show file tree
Hide file tree
Showing 23 changed files with 131,576 additions and 18 deletions.
10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ repos:
rev: 7.0.0
hooks:
- id: flake8
exclude: scripts/|docs/|tests/
- repo: local
hooks:
- id: nbstripout
name: nbstripout with keep-output
entry: |
python -m nbstripout --keep-output $@
language: system
files: \.ipynb$
exclude: tests/
103 changes: 103 additions & 0 deletions docs/notebooks/CRISPR.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# How to Model CRISPR-Cas9 Experiments in pydna\n",
"\n",
"> Visit the full library documentation [here](https://bjornfjohansson.github.io/pydna/)\n",
"\n",
"The pydna package can simulate CRISPR-Cas9 editing, which allows one to cut DNA sequences at specific sites using guide RNAs (gRNAs) that direct the Cas9 protein. This page will guide you through the process of using the `pydna.crispr` module to model a CRISPR-Cas9 cut on a DNA sequence.\n",
"\n",
"The `pydna.crispr` module contains the `cas9` class to simulate the biological activites of the Cas9 protein and the guideRNA, which should be imported. In addtion, the `Dseqrecord` class has also been imported to generate an example target_sequence."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from pydna.crispr import cas9, protospacer\n",
"from pydna.dseqrecord import Dseqrecord"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The target sequence and guideRNA (gRNA) sequence needs to be generated. Note the the sequence can be passed as a `Dseqrecord` object."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[]\n"
]
}
],
"source": [
"# Defining the target sequence\n",
"sequence = Dseqrecord(\"GTTACTTTACCCGACGTCCCCGG\")\n",
"\n",
"# Defining the guide RNA sequence\n",
"gRNA_sequence = protospacer(guide_construct = sequence, cas=cas9)\n",
"print(gRNA_sequence)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n"
]
}
],
"source": [
"# Initializing the Cas9 protein\n",
"enzyme = cas9(protospacer=gRNA_sequence[0])\n",
"\n",
"# Simulating the CRISPR-Cas9 cut by searching for the cut sites\n",
"cas9_sites = enzyme.search(sequence)\n",
"print(len(cas9_sites))\n",
"\n",
"# The cas9_sites will contain the fragments resulting from the cut\n",
"for fragment in cas9_sites:\n",
" print(fragment.format(\"fasta\"))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
327 changes: 327 additions & 0 deletions docs/notebooks/CU329670.gb

Large diffs are not rendered by default.

Loading

0 comments on commit a629c82

Please sign in to comment.