Bioinformatics/base count: Difference between revisions

m
syntax highlighting fixup automation
(→‎{{header|APL}}: Add pretty-print)
m (syntax highlighting fixup automation)
Line 27:
{{trans|Python}}
 
<langsyntaxhighlight lang=11l>F basecount(dna)
DefaultDict[Char, Int] d
L(c) dna
Line 59:
TCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATTCGTGTAGAC\
GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT"
seq_pp(sequence)</langsyntaxhighlight>
 
{{out}}
Line 85:
=={{header|Action!}}==
I the solution the number of nucleotides per row is equal 30 to fit the screen on Atari 8-bit computer.
<langsyntaxhighlight lang=Action!>DEFINE PTR="CARD"
 
PROC PrettyPrint(PTR ARRAY data INT count,gsize,gcount)
Line 151:
 
LMARGIN=oldLMARGIN ;restore left margin on the screen
RETURN</langsyntaxhighlight>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Bioinformatics_base_count.png Screenshot from Atari 8-bit computer]
Line 179:
 
=={{header|Ada}}==
<langsyntaxhighlight lang=Ada>with Ada.Text_Io;
 
procedure Base_Count is
Line 242:
Put (Test);
Count (Test);
end Base_Count;</langsyntaxhighlight>
{{out}}
<pre> 1.. 70 CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATGCTCGTGCTTTCCAATTATGT
Line 260:
=={{header|ALGOL 68}}==
Includes a count for non-bases if they are present in the sequence, as this would presumably indicate an error.
<langsyntaxhighlight lang=algol68>BEGIN # count DNA bases in a sequence #
# returns an array of counts of the characters in s that are in c #
# an extra final element holds the count of characters not in c #
Line 369:
# totals #
print( ( newline, "Total: ", whole( total, - width ), newline ) )
END</langsyntaxhighlight>
{{out}}
<pre>
Line 397:
=={{header|APL}}==
{{works with|Dyalog APL}}
<langsyntaxhighlight lang=apl> bases←'CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATGCTCGTGCTTTCCAATTATGTAAGCGTTCC',
'GAGACGGGGTGGTCGATTCTGAGGACAAAGGTCAAGATGGAGCGCATCGAACGCAATAAGGATCATTTGATGG',
'GACGTTTCGTCGACAAAGTCTTGTTTCGAGAGTAACGGCTACCGTCTTCGATTCTGCTTATAACACTATGTTC',
Line 406:
50 {w←⍺⋄s←⍵⋄{(w×1-⍨⍵),((w÷⍨≢s) w ⍴s)[⍵;]} ⍳(≢s)÷⍺} bases
{⍵,':',+/bases=⍵}¨∪bases[⍋∪bases]
'Total:',≢bases</langsyntaxhighlight>
 
{{Out}}
Line 426:
=={{header|Arturo}}==
 
<langsyntaxhighlight lang=rebol>dna: {
CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG
Line 458:
]
 
prettyPrint dna</langsyntaxhighlight>
 
{{out}}
Line 475:
 
=={{header|AWK}}==
<langsyntaxhighlight lang=AWK>
# syntax: GAWK -f BIOINFORMATICS_BASE_COUNT.AWK
# converted from FreeBASIC
Line 518:
exit(0)
}
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 542:
=={{header|C}}==
Reads genome from a file, determines string length to ensure optimal formatting
<syntaxhighlight lang=C>
<lang C>
#include<string.h>
#include<stdlib.h>
Line 658:
return 0;
}
</syntaxhighlight>
</lang>
Run and output :
<pre>
Line 688:
=={{header|C++}}==
Creates a class DnaBase which either uses a provided string or the default DNA sequence.
<langsyntaxhighlight lang=cpp>#include <map>
#include <string>
#include <iostream>
Line 750:
delete d;
return 0;
}</langsyntaxhighlight>
{{out}}
<pre>Sequence:
Line 778:
{{libheader| Generics.Collections}}
{{libheader| System.Console}}
<langsyntaxhighlight lang=Delphi>
program base_count;
 
Line 867:
 
readln;
end.</langsyntaxhighlight>
Color [https://ibb.co/VH5pR29]
{{out}}
Line 892:
 
=={{header|Factor}}==
<langsyntaxhighlight lang=factor>USING: assocs formatting grouping io kernel literals math
math.statistics prettyprint qw sequences sorting ;
 
Line 920:
[ "TOTAL: " write [ second ] [ + ] map-reduce . ] bi ;
 
dna [ 50 .dna nl ] [ show-counts ] bi</langsyntaxhighlight>
{{out}}
<pre>
Line 944:
 
=={{header|Forth}}==
<langsyntaxhighlight lang=Forth>
( Gforth 0.7.3 )
 
Line 980:
 
dnacode basecount
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 1,006:
 
=={{header|FreeBASIC}}==
<langsyntaxhighlight lang=freebasic>#define SCW 36
#define GRP 3
 
Line 1,054:
print " T: " + str(bases(3))
print
print " total: " + str(bases(0)+bases(1)+bases(2)+bases(3))</langsyntaxhighlight>
{{out}}
<pre> 1-- 36: CGT AAA AAA TTA CAA CGT CCT TTG GCT ATC TCT TAA
Line 1,089:
 
=={{header|Go}}==
<langsyntaxhighlight lang=go>package main
 
import (
Line 1,137:
fmt.Println(" Σ:", le)
fmt.Println(" ======")
}</langsyntaxhighlight>
 
{{out}}
Line 1,164:
 
=={{header|Haskell}}==
<langsyntaxhighlight lang=haskell>import Data.List (group, sort)
import Data.List.Split (chunksOf)
import Text.Printf (printf, IsChar(..), PrintfArg(..), fmtChar, fmtPrecision, formatString)
Line 1,203:
putStrLn "\nBase Counts:"
mapM_ (uncurry (printf "%2s: %2d\n")) $ baseCounts test
putStrLn (replicate 8 '-') >> printf " Σ: %d\n\n" (length test)</langsyntaxhighlight>
{{out}}
<pre>Sequence:
Line 1,226:
=={{header|J}}==
'''Solution:'''
<langsyntaxhighlight lang=j>countBases=: (({.;#)/.~)@,
totalBases=: #@,
 
Line 1,237:
'%5s: %4d' printf countBases y
'-----------\nTotal = %3d' printf totalBases y
)</langsyntaxhighlight>
'''Required Example:'''
<langsyntaxhighlight lang=j> DNABases=: ];._2 noun define
CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG
Line 1,271:
A: 129
-----------
Total = 500</langsyntaxhighlight>
 
=={{header|Java}}==
Line 1,278:
Note that Java’s native strings are UCS-2/UTF-16: Each character is 2-byte long. If parsing from a '''very''' large ASCII/UTF8 text file, then <code>String</code> is a poor choice, as opposed to, say <code>byte[]</code>. For the purpose of this exercise though, using <code>byte[]</code> would just add uninteresting casts and bloat to the code, so we stick to <code>String</code>.
 
<langsyntaxhighlight lang=Java>import java.util.HashMap;
import java.util.Map;
 
Line 1,326:
}
 
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 1,349:
 
=={{header|JavaScript}}==
<langsyntaxhighlight lang=JavaScript>const rowLength = 50;
 
const bases = ['A', 'C', 'G', 'T'];
Line 1,416:
prettyPrint(seq);
printBases(seq, bases);
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 1,442:
=== Naive (in-memory) solution ===
First, some general utility functions:
<langsyntaxhighlight lang=jq>def lpad($len; $fill): tostring | ($len - length) as $l | ($fill * $l)[:$l] + .;
 
# Create a bag of words, i.e. a JSON object with counts of the items in the stream
def bow(stream):
reduce stream as $word ({}; .[($word|tostring)] += 1);</langsyntaxhighlight>
Next, some helper functions:<langsyntaxhighlight lang=jq>
def read_seq:
reduce inputs as $line (""; . + $line);
Line 1,462:
def pp_sequence($cols):
range(0; length / $cols) as $i
| "\($i*$cols | lpad(5; " ")): " + .[ $i * $cols : ($i+1) * $cols] ;</langsyntaxhighlight>
Finally, the task at hand:<langsyntaxhighlight lang=jq>
read_seq | pp_sequence(50), "", pp_counts</langsyntaxhighlight>
{{out}}
The invocation:
jq -nrR -f base_count.jq base_count.txt
produces:<langsyntaxhighlight lang=sh>
0: CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
50: CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG
Line 1,485:
G: 119
T: 155
Total: 500</langsyntaxhighlight>
 
=== Memory-efficient solution ===
<langsyntaxhighlight lang=jq>def lpad($len; $fill): tostring | ($len - length) as $l | ($fill * $l)[:$l] + .;
 
# "bow" = bag of words, i.e. a JSON object with counts
Line 1,529:
 
# To illustrate reformatting:
report(inputs; 33)</langsyntaxhighlight>
{{out}}
<syntaxhighlight lang=sh>
<lang sh>
0: CGTAAAAAATTACAACGTCCTTTGGCTATCTCT
33: TAAACTCCTGCTAAATGCTCGTGCTTTCCAATT
Line 1,554:
G: 119
T: 155
Total: 500</langsyntaxhighlight>
 
=={{header|Julia}}==
<langsyntaxhighlight lang=julia>const sequence =
"CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG" *
"CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG" *
Line 1,596:
 
printcounts(sequence)
</langsyntaxhighlight>{{out}}
<pre>
500nt DNA sequence:
Line 1,629:
Finally, the total count is simply the input’s length.
 
<langsyntaxhighlight lang=kotlin>fun printSequence(sequence: String, width: Int = 50) {
fun <K, V> printWithLabel(k: K, v: V) {
val label = k.toString().padStart(5)
Line 1,650:
fun main() {
printSequence(BASE_SEQUENCE)
}</langsyntaxhighlight>
 
{{out}}
Line 1,674:
 
=={{header|Lambdatalk}}==
<langsyntaxhighlight lang=scheme>
{def DNA CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATGCTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTGAGGACAAAGGTCAAGATGGAGCGCATCGAACGCAATAAGGATCATTTGATGGGACGTTTCGTCGACAAAGTCTTGTTTCGAGAGTAACGGCTACCGTCTTCGATTCTGCTTATAACACTATGTTCTTATGAAATGGATGTTCTGAGTTGGTCAGTCCCAATGTGCGGGGTTTCTTTTAGTACGTCGGGAGTGGTATTATATTTAATTTTTCTATATAGCGATCTGTATTTAAGCAATTCATTTAGGTTATCGCCGCGATGCTCGGTTCGGACCGCCAAGCATCTGGCTCCACTGCTAGTGTCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATTCGTGTAGACGACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT}
-> DNA
Line 1,697:
A+C+G+T = {+ {S}}
-> A+C+G+T = 500
</syntaxhighlight>
</lang>
 
=={{header|Lua}}==
<langsyntaxhighlight lang=lua>function prettyprint(seq) -- approx DDBJ format
seq = seq:gsub("%A",""):lower()
local sums, n = { a=0, c=0, g=0, t=0 }, 1
Line 1,726:
TCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATTCGTGTAGAC
GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT
]]</langsyntaxhighlight>
{{out}}
<pre>LOCUS AB000000 500 bp mRNA linear HUM 01-JAN-2001
Line 1,742:
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<langsyntaxhighlight lang=Mathematica>seq = "CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATGCTCGTGCTTTCCA\
ATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTGAGGACAAAGGTCAAGATGGAGCGCATCGAACGC\
AATAAGGATCATTTGATGGGACGTTTCGTCGACAAAGTCTTGTTTCGAGAGTAACGGCTACCGTCTTCGA\
Line 1,755:
ends = Rest[Accumulate[Prepend[StringLength /@ parts, 0]]];
StringRiffle[MapThread[ToString[#1] <> "-" <> ToString[#2] <> ": " <> #3 &, {begins, ends, parts}], "\n"]
StringRiffle[#1 <> ": " <> ToString[#2] & @@@ Tally[Characters[seq]], "\n"]</langsyntaxhighlight>
{{out}}
<pre>1-70: CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATGCTCGTGCTTTCCAATTATGT
Line 1,772:
=={{header|MATLAB}} / {{header|Octave}}==
 
<langsyntaxhighlight lang=Matlab>
function r = base_count(f)
fid = fopen(f,'r');
Line 1,786:
fprintf(1, '\nTotal: %d\n\n', sum(nn));
end;
</syntaxhighlight>
</lang>
 
 
Line 1,818:
Rather than inventing a new presentation format, we have chosen to use the EMBL (European Molecular Biology Laboratory) format which is well documented. See specifications here: ftp://ftp.ebi.ac.uk/pub/databases/embl/doc/usrman.txt
 
<langsyntaxhighlight lang=Nim>import strformat
import strutils
 
Line 1,876:
 
when isMainModule:
Source.display()</langsyntaxhighlight>
 
{{out}}
Line 1,892:
 
=={{header|Pascal}}==
<langsyntaxhighlight lang=pascal>program DNA_Base_Count;
{$IFDEF FPC}
{$MODE DELPHI}//String = AnsiString
Line 1,968:
OutFormatBase(TestDNA,50);
Cnt(TestDNA);
end.</langsyntaxhighlight>
{{out}}
<pre> DNA base sequence
Line 1,990:
 
=={{header|Perl}}==
<langsyntaxhighlight lang=perl>use strict;
use warnings;
use feature 'say';
Line 2,017:
CGCCGCGATGCTCGGTTCGGACCGCCAAGCATCTGGCTCCACTGCTAGTG
TCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATTCGTGTAGAC
GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT</langsyntaxhighlight>
{{out}}
<pre> 1: CGTAAAAAAT TACAACGTCC TTTGGCTATC TCTTAAACTC CTGCTAAATG
Line 2,037:
 
=={{header|Phix}}==
<!--<langsyntaxhighlight lang=Phix>(phixonline)-->
<span style="color: #008080;">constant</span> <span style="color: #000000;">dna</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">substitute</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"""
CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
Line 2,060:
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #7060A8;">printf</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"\nBase counts: A:%d, C:%d, G:%d, T:%d, total:%d\n"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">acgt</span><span style="color: #0000FF;">)</span>
<!--</langsyntaxhighlight>-->
{{out}}
<pre>
Line 2,078:
 
=={{header|Picat}}==
<langsyntaxhighlight lang=Picat>main =>
dna(DNA, ChunkSize),
Count = 0,
Line 2,108:
TCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATTCGTGTAGAC
GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT".delete_all('\n'),
ChunkSize = 50.</langsyntaxhighlight>
 
{{out}}
Line 2,131:
 
=={{header|PicoLisp}}==
<langsyntaxhighlight lang=PicoLisp>(let
(S (chop "CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG\
CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG\
Line 2,145:
(for I S (accu 'R I 1))
(for I R (println I))
(println 'Total: (sum cdr R)) )</langsyntaxhighlight>
{{out}}
<pre>
Line 2,156:
 
=={{header|PureBasic}}==
<langsyntaxhighlight lang=PureBasic>dna$ = "CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG" +
"CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG" +
"AGGACAAAGGTCAAGATGGAGCGCATCGAACGCAATAAGGATCATTTGAT" +
Line 2,187:
PrintN(~"\n" + "Total = " + RSet(Str(sigma), 5))
Input()
EndIf</langsyntaxhighlight>
{{out}}
<pre>
Line 2,212:
=={{header|Python}}==
===Procedural===
<langsyntaxhighlight lang=python>from collections import Counter
 
def basecount(dna):
Line 2,245:
GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT'''
seq_pp(sequence)
</syntaxhighlight>
</lang>
 
{{out}}
Line 2,269:
=== procedural ( dictionary version) ===
{{works with|Python| 3.10.5 }}
<langsyntaxhighlight lang=Python>
"""
Python 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0] on linux
Line 2,326:
 
 
</langsyntaxhighlight>JPD 2022/08/17
<PRE>
Sequence:
Line 2,356:
Sequence and base counts displayed in GenBank format.
{{Works with|Python|3.7}}
<langsyntaxhighlight lang=python>'''Bioinformatics – base count'''
 
from itertools import count
Line 2,508:
# MAIN ---
if __name__ == '__main__':
main()</langsyntaxhighlight>
{{Out}}
<pre>DEFINITION len=500
Line 2,526:
=={{header|Quackery}}==
 
<langsyntaxhighlight lang=Quackery>
[ over size -
space swap of
Line 2,576:
$ "GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT" join
dup prettyprint cr cr tallybases</langsyntaxhighlight>
 
{{out}}
Line 2,600:
 
=={{header|R}}==
<syntaxhighlight lang=r>
<lang r>
#Data
gene1 <- "CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
Line 2,644:
)
 
</syntaxhighlight>
</lang>
 
{{out}}
Line 2,672:
=={{header|Racket}}==
 
<langsyntaxhighlight lang=racket>#lang racket
 
(define (fold-sequence seq kons #:finalise (finalise (λ x (apply values x))) . k0s)
Line 2,726:
EOS
)
(bioinformatics-Base_count the-string))</langsyntaxhighlight>
 
{{out}}
Line 2,760:
The specs for what "pretty print" means are sadly lacking. Ah well, just makes it easily defensible if I do ''anything at all''.
 
<syntaxhighlight lang=raku perl6line>my $dna = join '', lines q:to/END/;
CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG
Line 2,780:
sub pretty ($string, $wrap = 50) {
$string.comb($wrap).map( { sprintf "%8d: %s", $++ * $wrap, $_ } ).join: "\n"
}</langsyntaxhighlight>
{{out}}
<pre> 0: CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATGCTCGTGCTTTCCAATTATGTAAGCGTTCCG
Line 2,798:
=={{header|REXX}}==
A little extra boilerplate was added to verify correct coding of the bases in a DNA string and the alignment of the (totals) numbers.
<langsyntaxhighlight lang=rexx>/*REXX program finds the number of each base in a DNA string (along with a total). */
parse arg dna .
if dna=='' | dna=="," then dna= 'cgtaaaaaattacaacgtcctttggctatctcttaaactcctgctaaatg' ,
Line 2,828:
end /*k*/ /*stick a fork in it, we're all done. */
say
say '────────total for all basecounts:' right(@.tot, w+1)</langsyntaxhighlight>
{{out|output|text=&nbsp; when using the default input:}}
<pre>
Line 2,842:
 
=={{header|Ring}}==
<langsyntaxhighlight lang=ring>
dna = "" +
"CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG" +
Line 2,882:
? "C : " + dnaBase["C"]
? "G : " + dnaBase["G"]
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 2,892:
 
=={{header|Ruby}}==
<langsyntaxhighlight lang=ruby>dna = <<DNA_STR
CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG
Line 2,915:
puts dna.chars.tally.sort.map{|ar| ar.join(" : ") }
puts "Total : #{dna.size}"
</syntaxhighlight>
</lang>
{{out}}
<pre>0 CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATGCTCGTGCTTT
Line 2,934:
 
=={{header|Rust}}==
<langsyntaxhighlight lang=rust>
use std::collections::HashMap;
 
Line 2,973:
println!("Total: {}", total_count);
}
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 3,000:
=={{header|Swift}}==
 
<langsyntaxhighlight lang=swift>import Foundation
 
let dna = """
Line 3,021:
 
print("Counts: \(counts)")
print("Total: \(counts.values.reduce(0, +))")</langsyntaxhighlight>
 
{{out}}
Line 3,041:
 
=={{header|Tcl}}==
<langsyntaxhighlight lang=tcl>namespace path ::tcl::mathop
 
proc process {data {width 50}} {
Line 3,068:
TCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATTCGTGTAGAC \
GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT]
process $test 50</langsyntaxhighlight>
{{out}}
<pre> 0 CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
Line 3,090:
=={{header|Vlang}}==
{{trans|go}}
<langsyntaxhighlight lang=vlang>fn main() {
dna := "" +
"CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG" +
Line 3,126:
println(" Σ: $le")
println(" ======")
}</langsyntaxhighlight>
 
{{out}}
Line 3,153:
 
=={{header|VBScript}}==
<syntaxhighlight lang=vb>
<lang vb>
b=_
"CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG" &_
Line 3,187:
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 3,216:
{{libheader|Wren-sort}}
{{libheader|Wren-trait}}
<langsyntaxhighlight lang=ecmascript>import "/fmt" for Fmt
import "/sort" for Sort
import "/trait" for Stepped
Line 3,253:
System.print(" ------")
System.print(" Σ: %(le)")
System.print(" ======")</langsyntaxhighlight>
 
{{out}}
Line 3,280:
 
=={{header|XPL0}}==
<langsyntaxhighlight lang=XPL0>char Bases;
int Counts(256), Cnt, I, Ch;
[Bases:= "
Line 3,314:
Text(0, "
Total: "); IntOut(0, Cnt); CrLf(0);
]</langsyntaxhighlight>
 
{{out}}
Line 3,335:
 
=={{header|zkl}}==
<langsyntaxhighlight lang=zkl>bases:=
#<<<"
CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG
Line 3,353:
 
println("\nBase Counts: ", bases.counts().pump(String,Void.Read,"%s: %d ".fmt));
println("Total: ",bases.len());</langsyntaxhighlight>
{{out}}
<pre>
10,333

edits