guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: Add fit-sne.


From: guix-commits
Subject: branch master updated: gnu: Add fit-sne.
Date: Thu, 03 Jun 2021 06:24:12 -0400

This is an automated email from the git hooks/post-receive script.

rekado pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 0928e55  gnu: Add fit-sne.
0928e55 is described below

commit 0928e552662965f5a18fbc831e6c9758744bd042
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Thu Jun 3 12:18:35 2021 +0200

    gnu: Add fit-sne.
    
    * gnu/packages/bioinformatics.scm (fit-sne): New variable.
---
 gnu/packages/bioinformatics.scm | 63 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 94d15cc..408c93b 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -11214,6 +11214,69 @@ spliced (back-spliced) sequencing reads, indicative of 
circular RNA (circRNA)
 in RNA-seq data.")
       (license license:gpl3))))
 
+(define-public fit-sne
+  (package
+    (name "fit-sne")
+    (version "1.2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/KlugerLab/FIt-SNE";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1imq4577awc226wvygf94kpz156qdfw8xl0w0f7ss4w10lhmpmf5"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #false ; there are none
+       #:phases
+       ;; There is no build system.
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'build
+           (lambda _
+             (invoke "g++" "-std=c++11" "-O3"
+                     "src/sptree.cpp"
+                     "src/tsne.cpp"
+                     "src/nbodyfft.cpp"
+                     "-o" "bin/fast_tsne"
+                     "-pthread" "-lfftw3" "-lm"
+                     "-Wno-address-of-packed-member")))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (share (string-append out "/share/fit-sne")))
+               (for-each (lambda (file) (install-file file bin))
+                         (find-files "bin"))
+
+               (substitute* "fast_tsne.R"
+                 (("^FAST_TSNE_SCRIPT_DIR.*")
+                  (string-append "FAST_TSNE_SCRIPT_DIR = \"" out "\"\n")))
+               (install-file "fast_tsne.R" share)))))))
+    (inputs
+     `(("fftw" ,fftw)))
+    (home-page "https://github.com/KlugerLab/FIt-SNE";)
+    (synopsis "Fast Fourier Transform-accelerated interpolation-based t-SNE")
+    (description "@dfn{t-Stochastic Neighborhood Embedding} (t-SNE) is a
+method for dimensionality reduction and visualization of high dimensional
+datasets.  A popular implementation of t-SNE uses the Barnes-Hut algorithm to
+approximate the gradient at each iteration of gradient descent.  This
+implementation differs in these ways:
+
+@itemize
+@item Instead of approximating the N-body simulation using Barnes-Hut, we
+  interpolate onto an equispaced grid and use FFT to perform the convolution.
+@item Instead of computing nearest neighbors using vantage-point trees, we
+  approximate nearest neighbors using the Annoy library.  The neighbor lookups
+  are multithreaded to take advantage of machines with multiple cores.
+@end itemize
+")
+    ;; See LICENSE.txt for details on what license applies to what files.
+    (license (list license:bsd-4 license:expat license:asl2.0))))
+
 (define-public python-scanpy
   (package
     (name "python-scanpy")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]