Closed veghp closed 3 years ago
Also: missing explanation of the default option strand="from_location"
. The docstring example EnforcePatternOccurence('BsmBI_site', strand=1)
does not work.
A proposed solution is in the issue53 branch: https://github.com/Edinburgh-Genome-Foundry/DnaChisel/blob/776d8cd381b12b05ba79d30562087c913220fb42/dnachisel/builtin_specifications/EnforcePatternOccurence.py#L65
I made handling of the 6 cases of initialisation more explicit: location=None
or specified * 3 strand
options: "from_location", "both", one of [-1, 0, 1], and carried over the intended strand with https://github.com/Edinburgh-Genome-Foundry/DnaChisel/blob/776d8cd381b12b05ba79d30562087c913220fb42/dnachisel/builtin_specifications/EnforcePatternOccurence.py#L82
If this approach proves correct, I'll add more tests, and implement the changes in AvoidPattern too.
Issue for bug mentioned in https://github.com/Edinburgh-Genome-Foundry/DnaChisel/issues/52#issuecomment-810384388. If no location given;
then:
because in https://github.com/Edinburgh-Genome-Foundry/DnaChisel/blob/9c72428ae822c1e5afba480232158e604c355699/dnachisel/builtin_specifications/EnforcePatternOccurence.py#L67 from_data() returns a
None
as location, and a value is assigned to its attribute in: https://github.com/Edinburgh-Genome-Foundry/DnaChisel/blob/9c72428ae822c1e5afba480232158e604c355699/dnachisel/builtin_specifications/EnforcePatternOccurence.py#L73 This issue also exists in other classes.