Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NGSPlotDB-hg19-data recipe #9157

Merged
merged 31 commits into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f0180d7
Add NGSPlotDB-hg19-data recipe
Jun 5, 2018
f4d66f2
Okay, lets test this
Jun 5, 2018
1975340
Add fix for ngsplot recipe
Jun 6, 2018
e9bd34b
Removed
Jun 6, 2018
3d214fb
Added @mbargull 's suggestions
Jun 6, 2018
e486e49
More suggestions
Jun 6, 2018
f5af8a9
Add suggestions of @mbargull
Jun 6, 2018
3ead683
Adjusted build.sh script
Jun 6, 2018
b1ae475
Removed source, as this is provided by post-link
Jun 6, 2018
cf50794
Hopefully more permant file URL
Jun 6, 2018
ae6e95a
Double check
Jun 6, 2018
1590814
Add check for hg19 database, removed sha256
Jun 6, 2018
e4eb39e
Better tests for ngsplot
Jun 6, 2018
721e3a2
More specific copying
Jun 6, 2018
054a918
Post and Pre Unlink scripts for r-ngsplot-hg19 updated
Jun 6, 2018
a76b668
No need for images in there
Jun 6, 2018
2a7f5e4
Fixing tests
Jun 6, 2018
484b1f2
Fixing tests
Jun 6, 2018
e16b597
Updated Build Script
Jun 6, 2018
95efbc3
Add Activate / Deactivate scripts for ENV variable
Jun 8, 2018
9c44497
Wrong path
Jun 8, 2018
b35f91a
Removing unrequired fbname
Jun 8, 2018
05101fa
Add exact name of package
Jun 8, 2018
8fb135d
Fixing pipes
Jun 8, 2018
30d2a97
Get rid of old activate script
Jun 8, 2018
9b168e6
Add patch for environment variable in R script
Jun 8, 2018
7977757
r-ngsplot: patch all scripts, avoid activation script
mbargull Jun 9, 2018
a40cf32
r-ngsplot: debugging: show output if test failed
mbargull Jun 9, 2018
f097068
r-ngsplot: try || in subshells
mbargull Jun 9, 2018
de5d1a6
r-ngsplot: add missing python dependency
mbargull Jun 9, 2018
88af4ed
r-ngsplot-hg19: fix variable name in post-link.sh
mbargull Jun 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions recipes/r-ngsplot-hg19/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% set version = "3.00" %}
{% set name = "ngsplotdb-hg19" %}

package:
name: 'ngsplotdb-{{ name|lower }}'
version: '{{ version }}'
build:
number: 0
requirements:
run:
- r-ngsplot
- r-base
- wget
test:
commands:
- (ngsplotdb.py list | grep -qF "hg19" || ngsplotdb.py list)
about:
home: 'https://github.com/shenlab-sinai/ngsplot'
license: GPL-2.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder: does the database have another home URL? Is the database itself also licensed under the GPL-2.0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they are on GDrive and linked from the same Github repository - so I think its fine to use the same licence (as they didn't state explicitly another one).

Thanks for all the help - learned a lot here and will add two more databases today to finalize things here :-)

summary: 'HG19 genome database for NGSplot'
44 changes: 44 additions & 0 deletions recipes/r-ngsplot-hg19/post-link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
FN="ngsplotdb_hg19_75_3.00.tar.gz"
URLS=(
"https://drive.google.com/uc?export=download&id=0B5hDZ2BucCI6SURYWW5XdUxnbW8"
)
MD5="172a6a93de3d1ae8a3ad6d6d79e911f7"

# Use a staging area in the conda dir rather than temp dirs, both to avoid
# permission issues as well as to have things downloaded in a predictable
# manner.
STAGING=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM
mkdir -p $STAGING
TARBALL=$STAGING/$FN

SUCCESS=0
for URL in ${URLS[@]}; do
wget -O- -q ${URL} > $TARBALL
[[ $? == 0 ]] || continue

# Platform-specific md5sum checks.
if [[ $(uname -s) == "Linux" ]]; then
if md5sum -c <<<"$MD5 $TARBALL"; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use a sha256 hash, you'll have to use sha256sum here.
But note that on macOS you'll likely have to use another command for this. Can't remember what, though.
The safe route might be to add a dependency on openssl and use openssl sha256? (E.g.,

openssl sha256 libStatGen-v$VERSION.tar.gz | grep 70a504c5cc4838c6ac96cdd010644454615cc907df4e3794c999baf958fa734b
)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed back to md5

SUCCESS=1
break
fi
else if [[ $(uname -s) == "Darwin" ]]; then
if [[ $(md5 $TARBALL | cut -f4 -d " ") == "$MD5" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sha256, see above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to md5

SUCCESS=1
break
fi
fi
fi
done

if [[ $SUCCESS != 1 ]]; then
echo "ERROR: post-link.sh was unable to download any of the following URLs with the md5sum $MD5:" >> "${PREFIX}/.messages.txt" 2>&1
printf '%s\n' "${URLS[@]}" >> "${PREFIX}/.messages.txt" 2>&1
exit 1
fi

# Install and clean up
ngsplotdb.py install "${TARBALL}" >> "${PREFIX}/.messages.txt" 2>&1
rm $TARBALL
rmdir $STAGING
1 change: 1 addition & 0 deletions recipes/r-ngsplot-hg19/pre-unlink.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ngsplotdb.py remove hg19 >> "${PREFIX}/.messages.txt" 2>&1
22 changes: 15 additions & 7 deletions recipes/r-ngsplot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
outdir=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM
mkdir -p $outdir
mkdir -p $PREFIX/bin
cp -R * $outdir
#Set up links for
for f in $outdir/*; do
ln -s $outdir/* $PREFIX/bin
fbname=$(basename "$f")
chmod 0755 ${PREFIX}/bin/$fbname
done
cp -R {bin,database,example,galaxy,lib,LICENSE} ${outdir}/
# Set up links for
for f in ${outdir}/bin/*; do
ln -s ${f} ${PREFIX}/bin
done

# Patch scripts to use proper path and not depend on NGSPLOT env variable
for f in "${outdir}"/bin/*.py ; do
sed -Ei.bak "s|os\.environ\[\"NGSPLOT\"\]|\"${outdir}\"|g" "${f}"
rm "${f}.bak"
done
for f in "${outdir}"/bin/{,backup}/*.r ; do
sed -Ei.bak "s|Sys\.getenv\('NGSPLOT'\)|\"${outdir}\"|g" "${f}"
rm "${f}.bak"
done
8 changes: 3 additions & 5 deletions recipes/r-ngsplot/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ source:

build:
number: 0
skip: True
rpaths:
- lib/R/lib/
- lib/
Expand All @@ -23,13 +22,12 @@ requirements:
- bioconductor-rsamtools
- bioconductor-bsgenome
- bioconductor-shortread
- python <3.0a0

test:
commands:
- ngsplotdb.py list | true
- ngs.plot.r 2>&1 | true
- replot.r 2>&1 | true
- plotCorrGram.r 2>&1 | true
- (ngsplotdb.py list 2>&1 | grep -qF "your ngs.plot database may be corrupted." || ngsplotdb.py list)
- (ngs.plot.r | grep -qF "Visit https://github.com/shenlab-sinai/ngsplot/wiki/ProgramArguments101 for details" || ngs.plot.r)

about:
license: GPL-2.0
Expand Down