<commit_before>/*
 * seqJS
 * https://github.com/haydnKing/seqJS
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

var seqJS = seqJS || {};

(function(){

    /*
     * record object
     */
    seqJS.Record = function(seq, id, name, desc, annotations){
        if(! seq instanceof seqJS.Seq){
            throw("seq must be a seqJS.Seq instance");
        }
        this.seq = seq;
        this.id = id || 0;
        this.name = name || "unnamed";
        this.desc = desc || "";
        this.annotations = annotations || {};

        this.length = function() {
            return this.seq.length();
        };
    };

    /*
     * Seq object
     */
    seqJS.Alphabets = ['DNA','aDNA','RNA','aRNA','PROT','aPROT'];
    seqJS.Alphabets_RE = {
        DNA: /^[ACGT]+$/,
        aDNA: /^[ACGTRYSWKMBDHVN]+$/,<commit_msg>Can only access record annotations indirectly<commit_after>/*
 * seqJS
 * https://github.com/haydnKing/seqJS
 *
 * Copyright (c) 2014 <NAME>
 * Licensed under the MIT license.
 */

var seqJS = seqJS || {};

(function(){

    /*
     * record object
     */
    seqJS.Record = function(seq, id, name, desc, annotations){
        if(! seq instanceof seqJS.Seq){
            throw("seq must be a seqJS.Seq instance");
        }
        this.seq = seq;
        this.id = id || 0;
        this.name = name || "unnamed";
        this.desc = desc || "";
        
        var annotations = annotations || {};

        this.annotation = function(k, v) {
            if(k === undefined){
                throw "Record::annotation(k,v): key is required";
            }
            if(v === undefined){
                return annotations[k];
            }
            else {
                annotations[k] = v;
                return this;
            }
        };

        this.clearAnnotation = function(k) {
            annotations[k] = undefined;
        };

        this.length = function() {
            return this.seq.length();
        };
    };

    /*
     * Seq object
     */
    seqJS.Alphabets = ['DNA','aDNA','RNA','aRNA','PROT','aPROT'];
    seqJS.Alphabets_RE = {
        DNA: /^[ACGT]+$/,
        aDNA: /^[ACGTRYSWKMBDHVN]+$/,
{'fraction_non_alphanumeric': 0.16137931034482758, 'fraction_numerical': 0.004597701149425287, 'mean_word_length': 1.6732186732186731, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2916790', 'n_tokens_mistral': 717, 'n_tokens_neox': 658, 'n_words': 146}