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 Oct 26, 2024
1 parent 24e4fd4 commit 03d15db
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scadnano/scadnano.py
Original file line number Diff line number Diff line change
Expand Up @@ -6611,13 +6611,19 @@ def _cadnano_v2_place_crossover(helix_from_dct: Dict[str, Any], helix_to_dct: Di
helix_from_dct[strand_type][end_from - 1][2:] = [helix_to, start_to]
helix_to_dct[strand_type][end_to-1][:2] = [helix_from, start_from]
if helix_from_dct["row"]%2 != helix_to_dct["row"]%2:
raise ValueError("Paranemic crossovers are only allowed between helices that have the same parity of row number, here helix num "+str(helix_from_dct['num'])+ " and helix num " + str(helix_to_dct['num']) + " have different parity of row number: respectively "+str(helix_from_dct["row"])+" and "+str( helix_to_dct["row"]))
raise ValueError("Paranemic crossovers are only allowed between helices that have the same parity of "
f"row number, here helix num {helix_from_dct['num']} and helix num "
f"{helix_to_dct['num']} have different parity of row number: respectively "
f"{helix_from_dct['row']} and {helix_to_dct["row"]}")

elif not forward_from and not forward_to:
helix_from_dct[strand_type][start_from][2:] = [helix_to, end_to - 1]
helix_to_dct[strand_type][end_to-1][:2] = [helix_from, start_from]
if helix_from_dct["row"]%2 != helix_to_dct["row"]%2:
raise ValueError("Paranemic crossovers are only allowed between helices that have the same parity of row number, here helix num "+str(helix_from_dct['num'])+ " and helix num " + str(helix_to_dct['num']) + " have different parity of row number: respectively "+str(helix_from_dct["row"])+" and "+str( helix_to_dct["row"]))
raise ValueError("Paranemic crossovers are only allowed between helices that have the same parity of "
f"row number, here helix num {helix_from_dct['num']} and helix num "
f"{helix_to_dct['num']} have different parity of row number: respectively "
f"{helix_from_dct['row']} and {helix_to_dct['row']}")

@staticmethod
def _cadnano_v2_color_of_stap(color: Color, domain: Domain) -> List[int]:
Expand Down

0 comments on commit 03d15db

Please sign in to comment.