File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -81,15 +81,22 @@ def plate_map(
8181 :return:
8282 a :class:`PlateMap` consisting of all strands in this Reference object from plate named
8383 `name`. Currently always makes a 96-well plate.
84+ :raises ValueError:
85+ If the `name` is not the name of a plate in the reference.
8486 """
8587 well_to_strand_name = {}
88+ found_plate_name = False
8689 for row in self .df .itertuples ():
8790 if row .Plate == name : # type: ignore
91+ found_plate_name = True
8892 well = row .Well # type: ignore
8993 sequence = row .Sequence # type: ignore
9094 strand = Strand (name = row .Name , sequence = sequence ) # type: ignore
9195 well_to_strand_name [well ] = strand .name
9296
97+ if not found_plate_name :
98+ raise ValueError (f'Plate "{ name } " not found in reference file.' )
99+
93100 plate_map = PlateMap (
94101 plate_name = name ,
95102 plate_type = plate_type ,
You can’t perform that action at this time.
0 commit comments