BjornFJohansson / pydna

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

Reverse() & fill_in() edit. #56

Closed willsharpless closed 4 years ago

willsharpless commented 5 years ago

Hi Bjorn,

Having a lot of success with PyDNA so thank you. I was wondering if you would please consider implementing a reverse() function (at least I couldn't find one in the docs); to be clear, I do NOT mean a reverse_complement(). This has come up in an example where I want to switch the direction of a cassette in order to limit cross talk between promoters on the same plasmid. I have tried creating work arounds for this by doing a reverse_complement() and then by switching the watson and crick strands but it doesn't work for some reason. Note I am seeking a way to do this that PRESERVES FEATURES, otherwise it is not valuable.

Also I was wondering if you knew that the fill_in() function only fills in on 5' producing strands? Maybe this was done on purpose, but I'm not sure why. image

BjornFJohansson commented 5 years ago

The behaviour of fill_in is intentional. See here. The ._data property is perhaps useful?

BjornFJohansson commented 5 years ago

On the reverse issue, that would mean having the DNA sequence 3' to 5'? I am not sure the SeqFeature objects from biopython support that?

willsharpless commented 5 years ago

I don't want a 3' to 5' DNA, I just want to take a Dseqrecord and flip it (features and all) and tell pydna that this is a 5' to 3' strand now.

BjornFJohansson commented 5 years ago

3.0.2a1

New alpha version out! install with

pip install pydna==3.0.2a1

or

conda install -c bjornfjohansson pydna=3.0.2a1

Only some small changes, there are now .upper() and .lower() methods for the Dseq and Dseqrecord classes as suggested by @willsharpless. Some internal mods in the Dseq class now permits the sequence to be reversed using the slice notation as for strings in a somewhat unbiological way, see this notebook.