diff --git a/gfp2.py b/gfp2.py index 845de8f..e945b41 100644 --- a/gfp2.py +++ b/gfp2.py @@ -330,3 +330,51 @@ diagram.draw(format="circular", circular=True, pagesize='A4', start=0, end=len(r diagram.write("pdf/plasmid_map.pdf", "PDF") print("Zapisano diagram plazmidu do pliku 'plasmid_map.pdf'") + + +#%% +class Model: + + complement = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'} + + def __init__ (self, seq=None): + self.seq = seq + + def complement_dna(self): + + complementary_sequence = ''.join(complement[base] for base in self.seq) + return complementary_sequence + + + +#%% +promoter_models = [] + +# Iterate through the features in the record +for feature in record.features: + if feature.type == "promoter": + print(f"Type: {feature.type}") + print(f"Location: {feature.location}") + print(f"Strand: {'+' if feature.strand == 1 else '-'}") + + # Extract the sequence from the feature + # Assuming the sequence is stored in feature.sequence (you might need to adjust this) + sequence = feature.extract(record.seq) # This is a common way to extract sequences in Biopython + + # Create a Model object with the sequence + model_object = Model(seq=str(sequence)) + + # Add the Model object to the list + promoter_models.append(model_object) + + +#%% +r = Model(a) + +#%% + +for feature in record.features: + if feature.type in ["promoter",]: + print(f"Type: {feature.type}") + print(f"Location: {feature.location}") + print(f"Strand: {'+' if feature.strand == 1 else '-'}")