Edinburgh-Genome-Foundry / DnaChisel

:pencil2: A versatile DNA sequence optimizer
https://edinburgh-genome-foundry.github.io/DnaChisel/
MIT License
213 stars 38 forks source link

avoiding repeats #47

Closed aaroncooper closed 3 years ago

aaroncooper commented 3 years ago

hey-- great module! I've been using to great effect for awhile now. one feature that'd really help out is repeat avoidance to be able to synthesize DNA at providers with fewer issues. is this possible in the package currently, or would it need to be built? thanks for developing and sharing this software!

Zulko commented 3 years ago

You can write DnaOptimizationProblem(sequence, constraints=[AvoidPattern(pattern)]) where pattern can have different forms (see this section). For direct repeats in particular you can write for instance AvoidPattern("5x3mer") to forbid 3-mers repeated 5 times in a row. Other synthesis-impacting types of repeats can be destroyed with special classes such as AvoidHairpins and UniquifyAllKmers (to remove self-homologies).

aaroncooper commented 3 years ago

Thanks! I just started using this and it seems to work very well.