/* * 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()); })();