~ruther/guix-local

a614aaecce2b1b87dfb3295a3488a11ec3198784 — Ricardo Wurmus 1 year, 5 days ago 5ece584
gnu: Add mageck.

* gnu/packages/bioinformatics.scm (mageck): New variable.

Change-Id: I0d232473c983ac98aa01ef39a96e938da8628b7d
1 files changed, 91 insertions(+), 0 deletions(-)

M gnu/packages/bioinformatics.scm
M gnu/packages/bioinformatics.scm => gnu/packages/bioinformatics.scm +91 -0
@@ 9780,6 9780,97 @@ sequences).")
              "https://mafft.cbrc.jp/alignment/software/license.txt"
              "BSD-3 with different formatting"))))

(define-public mageck
  (package
    (name "mageck")
    (version "0.5.9.5")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://sourceforge/mageck/"
                                  (version-major+minor version)
                                  "/mageck-" version ".tar.gz"))
              (sha256
               (base32
                "0fnry7d3ngiw0jarvmwd3pxy5vvsf931m4aifz6mjfd6dl1ihsmh"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:modules '((guix build pyproject-build-system)
                  (guix build utils)
                  (srfi srfi-1)
                  (ice-9 match))
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'use-python3
            (lambda _
              (substitute* "bin/mageck"
                (("python2") "python"))))
         (add-after 'unpack 'numpy-compatibility
           (lambda _
              (substitute* "mageck/cnv_normalization.py"
                (("np.float") "float"))))
          ;; The build system declares executables both in "scripts" and
          ;; "data", which all are supposed to end up in #$output/bin.  The
          ;; pyproject-build-system gets confused by this, though, so we have
          ;; to manually install the mageck executable after the 'install
          ;; phase.
          (add-after 'unpack 'patch-build-system
            (lambda _
              (substitute* "setup.py"
                (("scripts=\\['bin/mageck'\\],") ""))))
          (add-after 'install 'install-mageck
            (lambda _
              (install-file "bin/mageck" (string-append #$output "/bin"))))
          (add-after 'install-mageck 'make-excutable
            (lambda _
              (for-each (lambda (file) (chmod file #o555))
                        (find-files (string-append #$output "/bin")))))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (let ((tests '(("demo1" "run.sh")
                               ("demo2" "runmageck.sh")
                               ("demo3" "run.sh")
                               ("demo4" "run.sh"))))
                  (setenv "PATH"
                          (string-append #$output "/bin:"
                                         (getenv "PATH")))
                  (for-each (match-lambda
                              ((dir script)
                               (with-directory-excursion (string-append "demo/" dir)
                                 (invoke "bash" script))))
                            tests))))))))
    (inputs
     (list python-numpy
           python-scipy
           python-matplotlib
           python-statsmodels
           python-pyqt
           r-minimal
           r-xtable
           r-gplots))
    (home-page "https://sourceforge.net/projects/mageck/")
    (synopsis "Model-based analysis of genome-wide CRISPR-Cas9 Knockout")
    (description
     "Model-based Analysis of Genome-wide CRISPR-Cas9
Knockout (MAGeCK) is a computational tool to identify important genes
from the recent genome-scale CRISPR-Cas9 knockout screens
technology.  Its features include:

@enumerate
@item Simple, easy to use pipeline to screen genes in Genome-wide
   CRISPR-Cas9 Knockout experiments;
@item High sensitivity and low false discovery rate;
@item Fully utilize the screening data by performing both positive and
   negative screening in one dataset;
@item Provide statistical evaluation in genes, sgRNAs and pathways;
@item Require as few as 2 samples;
@item Identify cell-type specific targets;
@item A set of visualization features that generate publication
   standard figures.
@end enumerate\n")
    (license license:bsd-3)))

(define-public mash
  (package
    (name "mash")