src/problems/rstr.lisp @ 2735aa6aab79

The great packaging of 2020
author Steve Losh <steve@stevelosh.com>
date Sun, 19 Jan 2020 20:38:29 -0500
parents 474d88a2af2e
children (none)
(defpackage :rosalind/rstr (:use :cl :rosalind :losh :iterate))
(in-package :rosalind/rstr)

(defparameter *input* "90000 0.6
ATAGCCGA")

(defparameter *output* "0.689")


(define-problem rstr (data stream) *input* *output*
  (let* ((n (read data))
         (gc (coerce (read data) 'double-float))
         (dna (read-line data))
         (prob (u:sequence-probability gc dna)))
    (u:float-string (- 1 (expt (- 1 prob) n)))))