simple DNA complement.func
This commit is contained in:
parent
9ad74c1745
commit
787f19edb4
26
gfp2.py
26
gfp2.py
|
@ -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'}
|
||||||
|
|
||||||
|
# Tworzenie komplementarnej sekwencji
|
||||||
|
complementary_sequence = ''.join(complement[base] for base in self.seq)
|
||||||
|
|
||||||
|
return complementary_sequence
|
||||||
|
|
||||||
#%%
|
#%%
|
||||||
r = Rev(a)
|
r = Model(a)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#%%
|
#%%
|
||||||
|
r.seq
|
||||||
|
|
||||||
|
#%%
|
||||||
|
r.seq[::-1]
|
||||||
|
|
||||||
|
#%%
|
||||||
|
r.complement_dna()
|
||||||
|
|
||||||
|
#%%
|
||||||
# Sekwencja DNA
|
# Sekwencja DNA
|
||||||
dna_seq = record.seq
|
dna_seq = record.seq
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue