|
| 1 | +from Bio.Seq import reverse_complement |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +def twinPE(spacer_f:str, spacer_r:str, replace_seq:str, overlap:int=25, pbs_f:int=12, pbs_r:int=12) -> str: |
| 6 | + """TwinPE에 필요한 pegRNA 2개의 RT-PBS를 디자인해주는 함수 |
| 7 | +
|
| 8 | + Args: |
| 9 | + spacer_f (str): pegRNA upper strand의 spacer |
| 10 | + spacer_r (str): pegRNA bottom strand의 spacer |
| 11 | + replace_seq (str): TwinPE로 replacement 하고 싶은 sequence |
| 12 | + overlap (int, optional): TwinPE로 만들어지는 cDNA들의 overlap 길이. Defaults to 25. |
| 13 | + pbs_f (int, optional): _description_. Defaults to 12. |
| 14 | + pbs_r (int, optional): _description_. Defaults to 12. |
| 15 | +
|
| 16 | + Returns: |
| 17 | + str: RT-PBS 2개 세트를 만들어 줌 |
| 18 | + """ |
| 19 | + |
| 20 | + if len(replace_seq) < overlap: |
| 21 | + raise ValueError('The length of replace sequence must be longer than overlap length.') |
| 22 | + |
| 23 | + spacer_f = spacer_f.upper() |
| 24 | + spacer_r = spacer_r.upper() |
| 25 | + replace_seq = replace_seq.upper() |
| 26 | + |
| 27 | + pbs_f = reverse_complement(spacer_f[17-pbs_f:17]) |
| 28 | + pbs_r = reverse_complement(spacer_r[17-pbs_r:17]) |
| 29 | + |
| 30 | + RepSeq_center = int(len(replace_seq)/2) |
| 31 | + half_overlap = int(overlap/2) |
| 32 | + |
| 33 | + cdna_f = reverse_complement(replace_seq[:RepSeq_center+half_overlap]) |
| 34 | + cdna_r = replace_seq[RepSeq_center-(overlap-half_overlap):] |
| 35 | + |
| 36 | + rtpbs_1 = cdna_f + pbs_f |
| 37 | + rtpbs_2 = cdna_r + pbs_r |
| 38 | + |
| 39 | + return rtpbs_1, rtpbs_2 |
| 40 | + |
0 commit comments