Edinburgh-Genome-Foundry / DnaCauldron

:alembic: Simple cloning simulator (Golden Gate etc.) for single and combinatorial assemblies
https://edinburgh-genome-foundry.github.io/DnaCauldron/
MIT License
50 stars 11 forks source link

Linear assemblies? #5

Open gjerman opened 3 years ago

gjerman commented 3 years ago

I am trying to simulate a three fragment golden gate type assembly where the end product is not a circular dna but a linear dna.

If i run the below code with three fragments suitable for circular assembly i get the expected ouput of:

If i run the code with three fragments that are suitable for linear assembly, but cannot be circularized it get:

Is there a way to specify that I am expecting a linear assembly and not a cirucular?

repository = dc.SequenceRepository()
repository.import_records(files=['seqs.fa'])

parts_list = list(repository.collections["parts"])

assembly = dc.Type2sRestrictionAssembly(
                                        name="golden_gate",
                                        parts=parts_list,
                                        expected_constructs="any_number",
                                        )

simulation = assembly.simulate(sequence_repository=repository)

report_writer = dc.AssemblyReportWriter(include_mix_graphs=True, include_part_plots=True)

simulation.write_report(
                        target="output",
                        report_writer=report_writer,
                        )

golden_gate_type2s_mix_parts_graph.pdf

Zulko commented 3 years ago

The short answer is that DnaCauldron can export linear assembly sequences, but the interface you are using doesn't support it yet.There are two ways forward:

1) Use a restriction mix instead and its compute_linear_assemblies method. It's just a few more line to get the records and the plots. Should be something like that:

mix = dc.RestrictionLigationMix(parts, enzyme)
for assembly in mix.compute_linear_assemblies():
    SeqIO.write(assembly, "record.gb") # assemly should be a biopython record
ax = mix.plot_connections_graph()
ax.figure.savefig("connections_graph.pdf")

2) There may be a way to expand the Type2sRestrictionAssembly class and in particular this line in the code so it will support linear assemblies.

gjerman commented 3 years ago

Great, I found the method compute_linear_assemblies() on the ConstructsMixin class but was scratching my head trying to figure out how to apply it. Will try you snippet asap. Thank you,.

veghp commented 2 years ago

A solution for linear assembly, using oligos, can be found here: https://github.com/Edinburgh-Genome-Foundry/DnaCauldron/issues/14#issuecomment-1138371834