[PATCH] gnu: Add filtlong.

  • Done
  • quality assurance status badge
Details
3 participants
  • Leo Famulari
  • Ludovic Courtès
  • pimi
Owner
unassigned
Submitted by
pimi
Severity
normal

Debbugs page

pimi wrote 6 years ago
(address . guix-patches@gnu.org)(address . ricardo.wurmus@mdc-berlin.de)(name . pimi)(address . madalinionel.patrascu@mdc-berlin.de)
20181008091741.31531-1-madalinionel.patrascu@mdc-berlin.de
* gnu/packages/bioinformatics.scm (filtlong): New variable.
---
gnu/packages/bioinformatics.scm | 63 +++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)

Toggle diff (73 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index ab9dc185a..43cdf811e 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14057,3 +14057,66 @@ absolute GSEA.")
(description "Ngless is a domain-specific language for
@dfn{next-generation sequencing} (NGS) data processing.")
(license license:expat)))
+
+(define-public filtlong
+ ;; The recommended way to install is to clone the git repository
+ ;; https://github.com/rrwick/Filtlong#installation
+ ;; and the lastest release is more than nine months old
+ (let ((commit "d1bb46dfe8bc7efe6257b5ce222c04bfe8aedaab")
+ (revision "1"))
+ (package
+ (name "filtlong")
+ (version (git-version "0.2.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rrwick/Filtlong.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1xr92r820x8qlkcr3b57iw223yq8vjgyi42jr79w2xgw47qzr575"))))
+ ;;(properties `((upstream-name . "Filtlong")))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; no check target
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (scripts (string-append out "/scripts")))
+ (mkdir-p bin)
+ (mkdir-p scripts)
+ (install-file "bin/filtlong" bin)
+ (install-file "scripts/histogram.py" scripts)
+ (install-file "scripts/read_info_histograms.sh" scripts))
+ #t))
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (path (getenv "PYTHONPATH")))
+ ;;(wrap-program (string-apend scripts "scripts/read_info_histograms.sh")
+ (wrap-program (string-append out "/scripts/histogram.py")
+ `("PYTHONPATH" ":" prefix (,path))))
+ #t))
+ (add-before 'check 'patch-tests
+ (lambda _
+ (substitute* "scripts/read_info_histograms.sh"
+ (("awk") (which "gawk")))
+ #t)))))
+ (inputs
+ `(("gawk" ,gawk) ;for read_info_histograms.sh
+ ("python" ,python-2) ; required for histogram.py
+ ("zlib" ,zlib)))
+ (home-page "https://github.com/rrwick/Filtlong/")
+ (synopsis "Tool for quality filtering of Nanopore and PacBio data")
+ (description
+ "The @code{filtlong} package is a tool for filtering long reads by quality.
+It can take a set of long reads and produce a smaller, better subset. It uses
+both read length (longer is better) and read identity (higher is better) when
+choosing which reads pass the filter.")
+ (license (list license:gpl3 ;filtlong
+ license:asl2.0))))) ;histogram.py
--
2.17.1
Ludovic Courtès wrote 6 years ago
(name . pimi)(address . madalinionel.patrascu@mdc-berlin.de)(address . ricardo.wurmus@mdc-berlin.de)(address . 32984-done@debbugs.gnu.org)
87murowgah.fsf@gnu.org
Hello,

pimi <madalinionel.patrascu@mdc-berlin.de> skribis:

Toggle quote (2 lines)
> * gnu/packages/bioinformatics.scm (filtlong): New variable.

Applied with the changes below; let me know if anything is amiss.

Thanks!

Ludo’.
Toggle diff (43 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 43cdf811e..ed713cd14 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14076,7 +14076,6 @@ absolute GSEA.")
(file-name (git-file-name name version))
(sha256
(base32 "1xr92r820x8qlkcr3b57iw223yq8vjgyi42jr79w2xgw47qzr575"))))
- ;;(properties `((upstream-name . "Filtlong")))
(build-system gnu-build-system)
(arguments
`(#:tests? #f ; no check target
@@ -14087,9 +14086,7 @@ absolute GSEA.")
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
- (scripts (string-append out "/scripts")))
- (mkdir-p bin)
- (mkdir-p scripts)
+ (scripts (string-append out "/share/filtlong/scripts")))
(install-file "bin/filtlong" bin)
(install-file "scripts/histogram.py" scripts)
(install-file "scripts/read_info_histograms.sh" scripts))
@@ -14098,8 +14095,8 @@ absolute GSEA.")
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(path (getenv "PYTHONPATH")))
- ;;(wrap-program (string-apend scripts "scripts/read_info_histograms.sh")
- (wrap-program (string-append out "/scripts/histogram.py")
+ (wrap-program (string-append out
+ "/share/filtlong/scripts/histogram.py")
`("PYTHONPATH" ":" prefix (,path))))
#t))
(add-before 'check 'patch-tests
@@ -14114,7 +14111,7 @@ absolute GSEA.")
(home-page "https://github.com/rrwick/Filtlong/")
(synopsis "Tool for quality filtering of Nanopore and PacBio data")
(description
- "The @code{filtlong} package is a tool for filtering long reads by quality.
+ "The Filtlong package is a tool for filtering long reads by quality.
It can take a set of long reads and produce a smaller, better subset. It uses
both read length (longer is better) and read identity (higher is better) when
choosing which reads pass the filter.")
Closed
pimi wrote 6 years ago
[PATCH] gnu: filtlong: update path in aux script.
(address . 32984@debbugs.gnu.org)(name . pimi)(address . madalinionel.patrascu@mdc-berlin.de)
20181009162239.17415-1-madalinionel.patrascu@mdc-berlin.de
* gnu/packages/bioinformatics.scm (filtlong)[extra scritps]: corrected
the loading path for the filtlong in the script read_info_histograms.sh.
---
gnu/packages/bioinformatics.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index ed713cd14..cb9ce4df0 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -14103,6 +14103,8 @@ absolute GSEA.")
(lambda _
(substitute* "scripts/read_info_histograms.sh"
(("awk") (which "gawk")))
+ (substitute* "scripts/read_info_histograms.sh"
+ (("/../") "/../../../"))
#t)))))
(inputs
`(("gawk" ,gawk) ;for read_info_histograms.sh
--
2.17.1
Leo Famulari wrote 6 years ago
(name . pimi)(address . madalinionel.patrascu@mdc-berlin.de)(address . 32984@debbugs.gnu.org)
20181011205550.GF7201@jasmine.lan
On Tue, Oct 09, 2018 at 06:22:39PM +0200, pimi wrote:
Toggle quote (3 lines)
> * gnu/packages/bioinformatics.scm (filtlong)[extra scritps]: corrected
> the loading path for the filtlong in the script read_info_histograms.sh.

[...]

Toggle quote (7 lines)
> (lambda _
> (substitute* "scripts/read_info_histograms.sh"
> (("awk") (which "gawk")))
> + (substitute* "scripts/read_info_histograms.sh"
> + (("/../") "/../../../"))
> #t)))))

Can you add a code comment explaining the effect of this change? It's
rather cryptic! :)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlu/uNYACgkQJkb6MLrK
fwhh6BAAsigRcAvjpZVDfxLVWsbYp4cruZdTIlUlBpTAl61K1bTfrpbHX5B53tKW
2BgjEUsMTXD4DU1QHuOxudgOdhCt4/FJHT+WP2PeJPzynmN5sBp7tmfElewTlHIy
YfGb5WjONI8pbmsEgMxqI6IMGiyHiW66DRpm0YMvs3pLTqGKa+TIAPTlgOHkkAsP
P71b7kSDMBnLfrdhEoxi9L6dSuAcCj/vG2+JvCyomuFpUymRi4D6+dZWx8bXVr8t
sNhGiB5EJbrFq74w4SOG3dUPrQFMXvS09J1UnUP2N/ESqQRsJDfkmL/XzaqXXwBE
amCsSRxCCS6bA+hBQlxMp4K4gac+/NMDin4J5uhGpC7aXDDWxisq1NKOSeAC4w0k
ntYz48UIjP/qxzmoPBaQ7uNfzOUu+yiqjM6w6+JJG7kN+jL7qdfpkc+dEiIsf8s9
5PCqwXb/8kNoTWydCbVEqcs617XIy4UY70MAH7MMv463XiiDSlm3JKLT3NOZ4HCx
c+VlzGKo4/AkcY2oFeuFYKdGQvNPHWLSnO21ePHy2tGpmCDWPAIAQfKocHVo14+y
knWQ8EuJRQCorlxCqiBZGpgMSMTkAKnJziucV7TUS6OEi7Rn5baCdVPHmP6aEbna
OwmZ32+5qDfapKYmBY8qL2RZXfWkWilXZlrH9PPloBvPhDWNBVs=
=wQe2
-----END PGP SIGNATURE-----


mpatras wrote 6 years ago
(name . Leo Famulari)(address . leo@famulari.name)(address . 32984@debbugs.gnu.org)
92b28f6e-4a68-5b5f-dcb7-40c376774f22@mdc-berlin.de
Hello Leo,

I am sorry for this delayed response!

In the initial version of this description, I have put the auxiliary
scripts in /scripts/.

I didn't know that all auxiliary scripts should be put in
/share/name_of_package/scripts.

The script loads the package using a relative path.

Ludo corrected my description and changed my substitute lines to this,

- (wrap-program (string-append out "/scripts/histogram.py")
+ (wrap-program (string-append out
+ "/share/filtlong/scripts/histogram.py")

Now the script is on the right place
(/share/filtlong/scripts/histogram.py), but it does not contain the
right relative path. So, this patch is needed to correct the relative path.

+ (substitute* "scripts/read_info_histograms.sh"
+ (("/../") "/../../../"))

Sorry, from the beginning was my mistake!
On 11.10.2018 22:55, Leo Famulari wrote:
Toggle quote (14 lines)
> On Tue, Oct 09, 2018 at 06:22:39PM +0200, pimi wrote:
>> * gnu/packages/bioinformatics.scm (filtlong)[extra scritps]: corrected
>> the loading path for the filtlong in the script read_info_histograms.sh.
> [...]
>
>> (lambda _
>> (substitute* "scripts/read_info_histograms.sh"
>> (("awk") (which "gawk")))
>> + (substitute* "scripts/read_info_histograms.sh"
>> + (("/../") "/../../../"))
>> #t)))))
> Can you add a code comment explaining the effect of this change? It's
> rather cryptic! :)

--
All the best!

Mădălin Ionel Patrașcu

System Administrator
The Berlin Institute for Medical Systems Biology (BIMSB)
Max Delbrück Center (MDC)
Robert-Rössle-Straße 10
House 87, room 1.10
13125 Berlin, Germany
Attachment: file
?
Your comment

This issue is archived.

To comment on this conversation send an email to 32984@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 32984
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help