From 787f19edb441fe07e364cdacda9291e3cee010ba Mon Sep 17 00:00:00 2001 From: mpabi Date: Wed, 12 Jun 2024 14:02:41 +0200 Subject: [PATCH] simple DNA complement.func --- gfp2.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/gfp2.py b/gfp2.py index e4b7d7c..4ee80d7 100644 --- a/gfp2.py +++ b/gfp2.py @@ -115,24 +115,38 @@ for feature in record.features: #%% t=record[25:73].seq + #%% a = str (t) + #%% -class Rev: +class Model: def __init__ (self, seq=None): self.seq = seq - def rev (self): - pass - -#%% -r = Rev(a) + def complement_dna(self): + # Tworzenie słownika komplementarnych zasad + complement = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'} - + # Tworzenie komplementarnej sekwencji + complementary_sequence = ''.join(complement[base] for base in self.seq) + + return complementary_sequence #%% +r = Model(a) + +#%% +r.seq +#%% +r.seq[::-1] + +#%% +r.complement_dna() + +#%% # Sekwencja DNA dna_seq = record.seq