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

write_idt_plate_excel_file uses reasonable defaults even when some strands have no IDT field set #111

Closed
dave-doty opened this issue Jul 11, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@dave-doty
Copy link
Member

dave-doty commented Jul 11, 2020

Currently, if no IDT fields are set on any strand, then write_idt_plate_excel_file will not export any of them. The way to give them a default IDT field for export is to set their IDT fields, either directly or by calling Strand.set_default_idt.

It would be convenient to have write_idt_plate_excel_file have an option to temporarily set these for all staples (not scaffold), i.e., just use a default value for idt without setting it, so that write_idt_plate_excel_file can simply be called without having to first modify the Strands.

@dave-doty dave-doty added the enhancement New feature or request label Jul 11, 2020
@dave-doty dave-doty changed the title add option to avoid requiring a call to set_default_idt on each Strand before calling write_idt_plate_excel_file add option to avoid requiring to set IDT fields on each Strand before calling write_idt_plate_excel_file Dec 15, 2020
dave-doty added a commit that referenced this issue Dec 16, 2020
…ver, since issue #111 still need to be implemented)
@dave-doty
Copy link
Member Author

dave-doty commented Dec 16, 2020

In implementing this, I made some changes worth noting in the release notes. In particular:

The main change is that 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. 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)
  • [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).

@dave-doty dave-doty changed the title add option to avoid requiring to set IDT fields on each Strand before calling write_idt_plate_excel_file write_idt_plate_excel_file uses reasonable defaults even when some strands have no IDT field set Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant