Browse Source

gn: Add mutation-simulator

Efraim Flashner 8 months ago
Signed by: efraim GPG Key ID: 41AAE7DCCA3D8351
  1. 36
  2. 80


@ -0,0 +1,36 @@
From: Andrej Shadura <>
Date: Sun, 8 Jul 2018 09:00:16 +0200
Subject: Catch StopIteration in a generator and return instead, per PEP 479
Signed-off-by: Andrej Shadura <>
blist/ | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/blist/ b/blist/
index b34f69e..1f77170 100644
--- a/blist/
+++ b/blist/
@@ -420,11 +420,14 @@ class _setmixin(object):
def __iter__(self):
it = super(_setmixin, self).__iter__()
while True:
- item = next(it)
- n = len(self)
- yield item
- if n != len(self):
- raise RuntimeError('Set changed size during iteration')
+ try:
+ item = next(it)
+ n = len(self)
+ yield item
+ if n != len(self):
+ raise RuntimeError('Set changed size during iteration')
+ except StopIteration:
+ return
def safe_cmp(f):
def g(self, other):


@ -10,6 +10,7 @@
#:use-module (guix build-system ant)
#:use-module (guix build-system cargo)
#:use-module (guix build-system cmake)
#:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
#:use-module (guix build-system meson)
#:use-module (guix build-system python)
@ -2805,3 +2806,82 @@ including @acronym{TIPP, taxonomic identical using phylogenetic placement} and
(description "Assess genome assembly and annotation completeness with
Benchmarking Universal Single-Copy Orthologs.")
(license license:expat)))
(define-public mutation-simulator
(let ((commit "9cb6bd2acf8201151bc610be14963e65b41d8899") ; March 25, 2021
(revision "1"))
(name "mutation-simulator")
(version (git-version "2.0.3" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "")
(commit commit)))
(file-name (git-file-name name version))
(base32 "1yxn5v5x804rm5ra1srmnph468yk7amsgfsj6h20rd6nmj2j0g9c"))))
(build-system copy-build-system)
'(("" "bin/"))
(modify-phases %standard-phases
(add-after 'install 'wrap-script
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(script (string-append out "/bin/")))
;; wrap-script doesn't accept arguments
(wrap-program script
`("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
(chmod script #o555)
;; When using wrap-script.
(when (file-exists?
(string-append out "/bin/"))
(chmod (string-append out "/bin/")
(add-after 'wrap-script 'check
(lambda* (#:key tests? outputs #:allow-other-keys)
(when tests?
(invoke (string-append (assoc-ref outputs "out")
"Test/test.fa" "rmt" "Test/test.rmt")))))))
`(("bash" ,bash-minimal) ; for wrap-program
;("guile" ,(@ (gnu packages guile) guile-3.0)) ; for wrap-script
("python" ,python)
("python-blist" ,python-blist)
("python-pyfaidx" ,python-pyfaidx)
("python-numpy" ,python-numpy)
("python-tqdm" ,python-tqdm)))
(home-page "")
(synopsis "Simulate mutations on given fasta files")
(description "Mutation-Simulator is a Python tool for simulating SNPs and
SVs in any reference genome with cohesive documentation about implemented
mutations. With Mutation-Simulator, the new file format @acronym{RMT, Random
Mutation Tables} is introduced, which gives more simulation power to the user by
creating an interface for more natural simulations within specific genomes.
Mutation-Simulator provides 3 different modes to simulate SNPs, insertions,
deletions, tandem duplications, inversions, translocations and interchromosomal
translocations from the commandline or with highly configureable RMT files.")
(license license:gpl3+))))
(define-public python-blist
(name "python-blist")
(version "1.3.6")
(method url-fetch)
(uri (pypi-uri "blist" version))
(base32 "1hqz9pqbwx0czvq9bjdqjqh5bwfksva1is0anfazig81n18c84is"))
(patches (search-patches "blist-stopiteration.patch"))))
(build-system python-build-system)
(home-page "")
(synopsis "List-like type for Python with better asymptotic performance")
"This package provides a list-like type for Python with better asymptotic
performance and similar performance on small lists.")
(license license:bsd-3)))