simple DNA complement.func

This commit is contained in:
mpabi 2024-06-12 14:02:41 +02:00
parent 9ad74c1745
commit 787f19edb4
1 changed files with 21 additions and 7 deletions

28
gfp2.py
View File

@ -115,24 +115,38 @@ for feature in record.features:
#%% #%%
t=record[25:73].seq t=record[25:73].seq
#%% #%%
a = str (t) a = str (t)
#%% #%%
class Rev: class Model:
def __init__ (self, seq=None): def __init__ (self, seq=None):
self.seq = seq self.seq = seq
def rev (self): def complement_dna(self):
pass # Tworzenie słownika komplementarnych zasad
complement = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
#%%
r = Rev(a)
# 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 # Sekwencja DNA
dna_seq = record.seq dna_seq = record.seq