Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
nh13 committed Jan 15, 2025
1 parent b9f1c86 commit db8b12c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion prymer/primer3/primer3_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class stores user input for internal probe design and maps it to the correct Pri
```
"""

import typing
from abc import ABC, abstractmethod
from dataclasses import dataclass
from dataclasses import fields
Expand All @@ -78,6 +78,18 @@ class Primer3Parameters(ABC):
target: Span
task: Primer3TaskType

def as_amplicon_params(self) -> "AmpliconParameters":
"""Use this method when you want to treat these parameters as amplicon parameters."""
if isinstance(self, AmpliconParameters):
return typing.cast(AmpliconParameters, self)
raise Exception("The parameters are not amplicon parameters")

def as_probe_params(self) -> "ProbeParameters":
"""Use this method when you want to treat these parameters as probe parameters."""
if isinstance(self, ProbeParameters):
return typing.cast(ProbeParameters, self)
raise Exception("The parameters are not amplicon parameters")

@abstractmethod
def _to_input_tags(self) -> dict[Primer3InputTag, Any]: ...

Expand Down

0 comments on commit db8b12c

Please sign in to comment.