1
0
Fork 0
factor-puzzles/rosalind/gc/gc.factor

12 lines
448 B
Factor
Raw Normal View History

2020-11-29 08:22:10 +01:00
! Copyright (C) 2020 Bubbler.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays assocs io io.encodings.utf8 io.files kernel math
prettyprint sequences sorting splitting rosalind.common ;
IN: rosalind.gc
: gc ( assoc -- item ) [ [ [ "GC" member? ] count ] [ length ] bi /f 100 * ] assoc-map sort-values last ;
: gc-main ( -- ) "datasets/rosalind/gc.txt" utf8 file-contents fasta>assoc
gc first2 swap print . ;
MAIN: gc-main