Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #158

Merged
merged 13 commits into from
Dec 25, 2020
Merged

Dev #158

merged 13 commits into from
Dec 25, 2020

Conversation

dave-doty
Copy link
Member

No description provided.

@dave-doty
Copy link
Member Author

Release notes for when this gets merged into master:

Exporting IDT files with default values for idt fields no longer requires first modifying the Strand.idt field

It is no longer necessary to modify the design to set the field Strand.idt in each Strand before calling the methods that export DNA sequences in IDT-formatted files. For staple strands with no idt field, a reasonable default for each value will be chosen.

So it is now possible to do this:

import scadnano as sc

design = sc.Design(helices=[sc.Helix(max_offset=100) for _ in range(2)], grid=sc.square)
design.strand(0, 0).move(8).cross(1).move(-8)
design.strand(0, 16).move(-8).cross(1).move(8)
design.assign_dna(strands[0], 'A'*16)
design.assign_dna(strands[1], 'C'*16)

# before the change, the next line would have skipped writing the two strands since they have no idt field set,
# now, reasonable defaults are used, without requiring the side-effect of writing the field Strand.idt
design.write_idt_plate_excel_file()

# to skip exporting strands that lack an idt field, specify the parameter only_strands_with_idt
# below, only the newly added strand with T's will be exported; the previous two will not
design.strand(0, 24).move(8).cross(1).move(-8).with_idt('only_strand_to_export')
design.assign_dna(strands[2], 'T'*16)
design.write_idt_plate_excel_file(only_strands_with_idt=True)

This implies several changes in the API

  • [BREAKING CHANGE] Changed the export methods so that, by default (with no parameters specified), they behave differently. In particular, now by default they will export DNA sequences for all non-scaffold strands, using the idt field of the Strand if it is present, and otherwise using reasonable defaults, the same defaults that previously were stored in the Strand by calling Strand.set_default_idt().

  • [BREAKING CHANGE] Removed the following:

    • field Strand.use_default_idt
    • method Strand.set_default_idt()
    • method Design.set_default_idt()
    • parameter use_idt_defaults in function origami_rectangle.create()
      Now, if you want to set a Strand to have an idt field, it must be explicit, although the IDTFields constructor only requires a name parameter, so it's as easy as strand.idt = IDTFields('name_of_strand') if you are happy with the defaults for other idt fields such as idt.purification.
  • [BREAKING CHANGE] Removed parameter warning_on_non_idt_strands from the IDT export methods on Design. Now, you can either ask those methods to skip exporting Strands lacking an idt field by setting the parameter only_strands_with_idt to True, or let all (non-scaffold) strands be exported by setting only_strands_with_idt to False (the default).

  • Added parameter export_scaffold to DNA sequence export methods to allow the scaffold(s) to be exported (False by default).

  • [BREAKING CHANGE] (This one is unrelated to exporting IDT files; it is related to the circular strands implemented in v0.13.4.) Since circular strands make it easier to use the Design.add_half_crossover and Design.add_full_crossover methods, we have removed the method Design.add_crossovers and the type Crossover. Previously, that method helped avoid creating circular strands by allowing one to build up a list of Crossovers and add them in bulk, where adding them one at a time would have resulted in an intermediate circular strand, even if the final result had all linear strands. Now that circular strands are supported, this is no longer needed. The recommended method of adding many crossovers at once is simply to call Design.add_half_crossover and/or Design.add_full_crossover repeatedly, i.e., replace

    crossovers = [
        Crossover(helix=0, helix2=1, offset=16, forward=True, half=True),
        Crossover(helix=0, helix2=1, offset=24, forward=False, half=True),
        Crossover(helix=2, helix2=3, offset=32, forward=True),
        Crossover(helix=2, helix2=3, offset=40, forward=False),
    ]
    design.add_crossovers(crossovers)

    with this instead:

    design.add_half_crossover(helix=0, helix2=1, offset=16, forward=True)
    design.add_half_crossover(helix=0, helix2=1, offset=24, forward=False)
    design.add_full_crossover(helix=2, helix2=3, offset=32, forward=True)
    design.add_full_crossover(helix=2, helix2=3, offset=40, forward=False)

@dave-doty dave-doty merged commit 434ccc4 into master Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant