diff --git a/gfp2.py b/gfp2.py index 836974c..845de8f 100644 --- a/gfp2.py +++ b/gfp2.py @@ -85,7 +85,7 @@ for feature in record.features: # Przejdź przez wszystkie funkcje w rekordzie i wypisz ich szczegółowe informacje for feature in record.features: - if feature.type in ["promoter", "RBS","CDS", "protein_bind", "misc_feature", "rep_origin"]: + if feature.type in ["promoter", "RBS","CDS", "protein_bind", "misc_feature", "rep_origin", "terminator"]: print(f"Type: {feature.type}") print(f"Location: {feature.location}") print(f"Strand: {'+' if feature.strand == 1 else '-'}") @@ -156,20 +156,19 @@ t=record[25:73].seq #%% a = str (t) - +a #%% class Model: + + complement = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'} + def __init__ (self, seq=None): self.seq = seq 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 #%% @@ -184,6 +183,16 @@ r.seq[::-1] #%% r.complement_dna() +#%% +r.seq +#%% +complement = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'} +complementary_sequence = ''.join(complement[base] for base in r.seq) +complementary_sequence + +#%% + + #%% # Sekwencja DNA dna_seq = record.seq diff --git a/index.html b/index.html new file mode 100644 index 0000000..ba6e1ad --- /dev/null +++ b/index.html @@ -0,0 +1,10 @@ + + + + + Index + + + + + diff --git a/js.js b/js.js new file mode 100644 index 0000000..16a60fe --- /dev/null +++ b/js.js @@ -0,0 +1,36 @@ +/* + * js.js + * Copyright (C) 2024 user + * + * Distributed under terms of the MIT license. + */ +(function(){ + 'use strict'; + +// Assuming t is obtained from some source and contains the sequence +let t = 'CAAAAAACCCCTCAAGACCCGTTTAGAGGCCCCAAGGGGTTATGCTAG' + +let a = String(t); +console.log(a); + +class Model { + static complement = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}; + + constructor(seq = null) { + this.seq = seq; + } + + complement_dna() { + let complementary_sequence = ''; + for (let base of this.seq) { + complementary_sequence += Model.complement[base]; + } + return complementary_sequence; + } +} + +// Example usage: +let model = new Model(a); +console.log(model.complement_dna()); + +})();