From 76fabc0045735445f92e6990ec1e1df080a3d97b Mon Sep 17 00:00:00 2001 From: Goosang Yu Date: Fri, 18 Oct 2024 19:08:51 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20TwinPE=20design?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- genet/__init__.py | 2 +- genet/design/TwinPE.py | 40 ++++++++++++++++++++++++++++++++++++++++ genet/design/__init__.py | 1 + 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 genet/design/TwinPE.py diff --git a/genet/__init__.py b/genet/__init__.py index be3e0e7..2fe5629 100644 --- a/genet/__init__.py +++ b/genet/__init__.py @@ -7,7 +7,7 @@ # How to release with 2FA accounts # [주의!] 먼저 아래의 version을 변경한다!! -__version__ = '0.17.0' +__version__ = '0.17.1' # hatch build # twine upload --username __token__ dist/* diff --git a/genet/design/TwinPE.py b/genet/design/TwinPE.py new file mode 100644 index 0000000..1dbb4a0 --- /dev/null +++ b/genet/design/TwinPE.py @@ -0,0 +1,40 @@ +from Bio.Seq import reverse_complement + + + +def twinPE(spacer_f:str, spacer_r:str, replace_seq:str, overlap:int=25, pbs_f:int=12, pbs_r:int=12) -> str: + """TwinPE에 필요한 pegRNA 2개의 RT-PBS를 디자인해주는 함수 + + Args: + spacer_f (str): pegRNA upper strand의 spacer + spacer_r (str): pegRNA bottom strand의 spacer + replace_seq (str): TwinPE로 replacement 하고 싶은 sequence + overlap (int, optional): TwinPE로 만들어지는 cDNA들의 overlap 길이. Defaults to 25. + pbs_f (int, optional): _description_. Defaults to 12. + pbs_r (int, optional): _description_. Defaults to 12. + + Returns: + str: RT-PBS 2개 세트를 만들어 줌 + """ + + if len(replace_seq) < overlap: + raise ValueError('The length of replace sequence must be longer than overlap length.') + + spacer_f = spacer_f.upper() + spacer_r = spacer_r.upper() + replace_seq = replace_seq.upper() + + pbs_f = reverse_complement(spacer_f[17-pbs_f:17]) + pbs_r = reverse_complement(spacer_r[17-pbs_r:17]) + + RepSeq_center = int(len(replace_seq)/2) + half_overlap = int(overlap/2) + + cdna_f = reverse_complement(replace_seq[:RepSeq_center+half_overlap]) + cdna_r = replace_seq[RepSeq_center-(overlap-half_overlap):] + + rtpbs_1 = cdna_f + pbs_f + rtpbs_2 = cdna_r + pbs_r + + return rtpbs_1, rtpbs_2 + diff --git a/genet/design/__init__.py b/genet/design/__init__.py index 4e174d3..297cbe1 100644 --- a/genet/design/__init__.py +++ b/genet/design/__init__.py @@ -1,3 +1,4 @@ from .modules import * from genet.design.functional import * +from genet.design.TwinPE import * from genet.design.DesignUtils import * \ No newline at end of file