<commit_before>//
//  DNASequenceGenerator.swift
//  BioSwiftGenerate
//
//  Created by <NAME> on 27/03/2015.
//  Copyright (c) 2015 bluetatami. All rights reserved.
//

import Foundation
import BioSwiftCore

public class DNASequenceGenerator {
    public static func generateSequence(ofLength length: Int) -> DNASequence {
        var nucleotideArray = [Nucleotide]()
        
        for i in 0..<length {
            let randomNumber = arc4random_uniform(4)
            
            let nucleotide: Nucleotide
            switch randomNumber {
            case 0:
                nucleotide = .A
            case 1:
                nucleotide = .C
            case 2:
                nucleotide = .G
            case 3:
                nucleotide = .T
            default:
                assertionFailure("Random number generator generated number out of 0..<4 range")
            }
            
            nucleotideArray.append(nucleotide)
        }
        
        assert(nucleotideArray.count == length, "NucleotideArray length doesn't match up")
        
        return DNASequence(nucleotideSlice: nucleotideArray)
    }
}<commit_msg>update usage of init DNASequence from sequence in generator<commit_after>//
//  DNASequenceGenerator.swift
//  BioSwiftGenerate
//
//  Created by <NAME> on 27/03/2015.
//  Copyright (c) 2015 bluetatami. All rights reserved.
//

import Foundation
import BioSwiftCore

public class DNASequenceGenerator {
    public static func generateSequence(ofLength length: Int) -> DNASequence {
        var nucleotideArray = [Nucleotide]()
        
        for i in 0..<length {
            let randomNumber = arc4random_uniform(4)
            
            let nucleotide: Nucleotide
            switch randomNumber {
            case 0:
                nucleotide = .A
            case 1:
                nucleotide = .C
            case 2:
                nucleotide = .G
            case 3:
                nucleotide = .T
            default:
                assertionFailure("Random number generator generated number out of 0..<4 range")
            }
            
            nucleotideArray.append(nucleotide)
        }
        
        assert(nucleotideArray.count == length, "NucleotideArray length doesn't match up")
        
        return DNASequence(nucleotideArray)
    }
}
{'fraction_non_alphanumeric': 0.07460112117291937, 'fraction_numerical': 0.018111254851228976, 'mean_word_length': 1.6126126126126126, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '415325', 'n_tokens_mistral': 702, 'n_tokens_neox': 565, 'n_words': 169}