You were trying to instantiate a cas9 object by passing a seqrecord as an argument to the function cas9, that's why you were getting the error. However, the error you committed in the notebook:
TypeError Traceback (most recent call last)
Cell In[12], line 2
1 # Initializing the Cas9 protein
----> 2 enzyme = cas9(gRNA_sequence)
4 # Simulating the CRISPR-Cas9 cut
5 cut_products = target_sequence(enzyme)
TypeError: 'cas9' object is not callable
Is not the error you should be getting. Perhaps you re-assigned cas9 to a variable? Sometimes is good to restart the kernel and re-run the notebook. You should be getting the error below:
This error occurs because cas9 takes a string as an input, not a Dseqrecord. However, note that:
The string should contain the protospacer of the gRNA, not the entire gRNA.
You can extract the protospacer sequence from the entire gRNA with the function protospacer that is in pydna.crispr module.
The gRNA sequence is not only the homologous sequence, but requires some extra sequence that is always the same, I think. I don't remember exactly what the constrains are for cas9, but you should double-check.
A good place to start and see how it works is to see the examples from the tests in tests/test_module_crispr.py, you can take that as a starting example for how the cas9 enzyme works.
This is just to document an error that @JeffXiePL came across in this notebook:
https://github.com/JeffXiePL/pydna/blob/docs_peilun/docs/notebooks/CRISPR.ipynb
You were trying to instantiate a cas9 object by passing a seqrecord as an argument to the function
cas9
, that's why you were getting the error. However, the error you committed in the notebook:Is not the error you should be getting. Perhaps you re-assigned cas9 to a variable? Sometimes is good to restart the kernel and re-run the notebook. You should be getting the error below:
This error occurs because
cas9
takes a string as an input, not aDseqrecord
. However, note that:protospacer
that is inpydna.crispr
module.A good place to start and see how it works is to see the examples from the tests in
tests/test_module_crispr.py
, you can take that as a starting example for how the cas9 enzyme works.Also, you were trying to cut using:
Instead, it should be: