-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Amplify P - amplicon related.""" | ||
|
||
from dataclasses import dataclass | ||
from typing import List | ||
|
||
from .dna import DNA, Primer | ||
from .repliconf import Repliconf | ||
|
||
|
||
@dataclass | ||
class Amplicon: | ||
""" | ||
A class representing the amplicons | ||
An amplicon is defined by the sequence that had been amplified. It starts | ||
with the forward replication origin, it ends with the reverse replication | ||
origin. | ||
""" | ||
|
||
sequence: DNA | ||
fwd_origin: Primer | ||
rev_origin: Primer | ||
|
||
def __post_init__(self) -> None: | ||
pass | ||
|
||
|
||
class AmpliconGenerator: | ||
""" | ||
A class for generating the amplicons | ||
""" | ||
|
||
# pylint: disable=too-few-public-methods | ||
|
||
def __init__(self, template: DNA) -> None: | ||
"""Construct an AmpliconGenerator""" | ||
self.template = template | ||
self.repliconfs: List[Repliconf] = [] | ||
|
||
def add(self, repliconf: Repliconf) -> None: | ||
"""Add a Repliconf to the AmpliconGenerator""" | ||
if self.template != repliconf.template: | ||
raise ValueError( | ||
"The Repliconf contains a different template to the AmpliconGenerator." | ||
) | ||
|
||
if not self.repliconfs: | ||
self.repliconfs.append(repliconf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters