BjornFJohansson / pydna

Clone with Python! Data structures for double stranded DNA & simulation of homologous recombination, Gibson assembly, cut & paste cloning.
Other
160 stars 39 forks source link

Lowercase `protospacer` does not work #216

Closed dgruano closed 2 months ago

dgruano commented 3 months ago

The following code does not find a cas9 hit, when it should. Changing the input guide to uppercase solves the issue


from pydna.dseqrecord import Dseqrecord
from pydna.crispr import cas9, protospacer

guide = "gttactttacccgacgtccc"
target = "GTTACTTTACCCGACGTCCCaGG"

# Create an enzyme object with the guide RNA
enzyme = cas9(guide)

# Search for a cutsite in the target sequence
print(enzyme.search(target))  # Returns [], should return [18]

`
``

`guide = guide.upper()` fixes it.
BjornFJohansson commented 3 months ago

Thanks for the input, this is now in latest v6.0.0a30 release.

manulera commented 2 months ago

Hello, this was not completely fixed. The composite was still being created not in uppercase if instantiating cas9(guide). Should be fixed in the next PR.

btw, @BjornFJohansson, I think we should capitalise the first letter of the class cas9 -> Cas9 to be more "pythonic"