Skip to content

Commit

Permalink
Update scadnano.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-doty committed Mar 29, 2022
1 parent 3fd2a86 commit e9ab4bc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scadnano/scadnano.py
Original file line number Diff line number Diff line change
Expand Up @@ -4693,7 +4693,8 @@ def from_cadnano_v2(directory: str = '', filename: Optional[str] = None,

return design

def plate_maps_markdown(self, warn_duplicate_strand_names: bool = True,
def plate_maps_markdown(self,
warn_duplicate_strand_names: bool = True,
plate_type: PlateType = PlateType.wells96,
strands: Optional[Iterable[Strand]] = None,
well_marker: Optional[str] = None) -> Dict[str, str]:
Expand Down Expand Up @@ -4729,6 +4730,9 @@ def plate_maps_markdown(self, warn_duplicate_strand_names: bool = True,
| G | | | | | | | | | | | | |
| H | | | | | | | | | | | | |
If `well_marker` is not specified, then each strand must have a name.
All :any:`Strand`'s in the design that have a field :data:`Strand.idt` with :data:`Strand.idt.plate`
specified are exported. The number of strings in the returned list is equal to the number of
different plate names specified across all :any:`Strand`'s in the design.
Expand Down Expand Up @@ -4760,8 +4764,9 @@ def plate_maps_markdown(self, warn_duplicate_strand_names: bool = True,
for strand in strands:
if strand.idt is not None and strand.idt.plate is not None:
plate_names_to_strands[strand.idt.plate].append(strand)
if strand.name is None:
raise ValueError(f'strand {strand} has no name, but has a plate, which is not allowed')
if strand.name is None and well_marker is None:
raise ValueError(f'strand {strand} has no name, but has a plate, which is not allowed '
f'unless well_marker is specified')
if strand.name in strand_names_to_plate_and_well:
if warn_duplicate_strand_names:
print(f'WARNING: found duplicate instance of strand with name {strand.name}')
Expand Down

0 comments on commit e9ab4bc

Please sign in to comment.