Skip to content

Commit

Permalink
Merge pull request #102 from Goosang-Yu/dev_goosang
Browse files Browse the repository at this point in the history
✨ TwinPE design
  • Loading branch information
Goosang-Yu authored Oct 18, 2024
2 parents 4c30b93 + 76fabc0 commit b481623
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion genet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
40 changes: 40 additions & 0 deletions genet/design/TwinPE.py
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions genet/design/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .modules import *
from genet.design.functional import *
from genet.design.TwinPE import *
from genet.design.DesignUtils import *

0 comments on commit b481623

Please sign in to comment.