-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 recipe for SNVer 0.5.3 #12265
Merged
Merged
Add recipe for SNVer 0.5.3 #12265
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d93735a
Add recipe for SNVer 0.5.3
cwuensch 0007bd8
Change command names of wrapper scripts to lowercase
1791127
Fixed typo
ab76b6c
Added licence information
f72389d
Fix another typo (sorry)
b0e8242
Update meta.yaml
bgruening 25bd8a0
Add LICENSE file
cwuensch b1ba3c0
Add license-file entry
cwuensch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Wrapper script for Java Conda packages that ensures that the java runtime | ||
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). | ||
|
||
# | ||
# Program Parameters | ||
# | ||
import os | ||
import subprocess | ||
import sys | ||
import shutil | ||
from os import access | ||
from os import getenv | ||
from os import X_OK | ||
jar_file = 'SNVerIndividual.jar' | ||
|
||
|
||
default_jvm_mem_opts = ['-Xms512m', '-Xmx1g'] | ||
|
||
# !!! End of parameter section. No user-serviceable code below this line !!! | ||
|
||
|
||
def real_dirname(path): | ||
"""Return the symlink-resolved, canonicalized directory-portion of path.""" | ||
return os.path.dirname(os.path.realpath(path)) | ||
|
||
|
||
def java_executable(): | ||
"""Return the executable name of the Java interpreter.""" | ||
java_home = getenv('JAVA_HOME') | ||
java_bin = os.path.join('bin', 'java') | ||
|
||
if java_home and access(os.path.join(java_home, java_bin), X_OK): | ||
return os.path.join(java_home, java_bin) | ||
else: | ||
return 'java' | ||
|
||
|
||
def jvm_opts(argv): | ||
"""Construct list of Java arguments based on our argument list. | ||
|
||
The argument list passed in argv must not include the script name. | ||
The return value is a 3-tuple lists of strings of the form: | ||
(memory_options, prop_options, passthrough_options) | ||
""" | ||
mem_opts = [] | ||
prop_opts = [] | ||
pass_args = [] | ||
exec_dir = None | ||
|
||
for arg in argv: | ||
if arg.startswith('-D'): | ||
prop_opts.append(arg) | ||
elif arg.startswith('-XX'): | ||
prop_opts.append(arg) | ||
elif arg.startswith('-Xm'): | ||
mem_opts.append(arg) | ||
elif arg.startswith('--exec_dir='): | ||
exec_dir = arg.split('=')[1].strip('"').strip("'") | ||
if not os.path.exists(exec_dir): | ||
shutil.copytree(real_dirname(sys.argv[0]), exec_dir, symlinks=False, ignore=None) | ||
else: | ||
pass_args.append(arg) | ||
|
||
# In the original shell script the test coded below read: | ||
# if [ "$jvm_mem_opts" == "" ] && [ -z ${_JAVA_OPTIONS+x} ] | ||
# To reproduce the behaviour of the above shell code fragment | ||
# it is important to explictly check for equality with None | ||
# in the second condition, so a null envar value counts as True! | ||
|
||
if mem_opts == [] and getenv('_JAVA_OPTIONS') is None: | ||
mem_opts = default_jvm_mem_opts | ||
|
||
return (mem_opts, prop_opts, pass_args, exec_dir) | ||
|
||
|
||
def main(): | ||
java = java_executable() | ||
(mem_opts, prop_opts, pass_args, exec_dir) = jvm_opts(sys.argv[1:]) | ||
jar_dir = exec_dir if exec_dir else real_dirname(sys.argv[0]) | ||
|
||
if pass_args != [] and pass_args[0].startswith('eu'): | ||
jar_arg = '-cp' | ||
else: | ||
jar_arg = '-jar' | ||
|
||
jar_path = os.path.join(jar_dir, jar_file) | ||
|
||
java_args = [java] + mem_opts + prop_opts + [jar_arg] + [jar_path] + pass_args | ||
|
||
sys.exit(subprocess.call(java_args)) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Wrapper script for Java Conda packages that ensures that the java runtime | ||
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). | ||
|
||
# | ||
# Program Parameters | ||
# | ||
import os | ||
import subprocess | ||
import sys | ||
import shutil | ||
from os import access | ||
from os import getenv | ||
from os import X_OK | ||
jar_file = 'SNVerPool.jar' | ||
|
||
|
||
default_jvm_mem_opts = ['-Xms512m', '-Xmx1g'] | ||
|
||
# !!! End of parameter section. No user-serviceable code below this line !!! | ||
|
||
|
||
def real_dirname(path): | ||
"""Return the symlink-resolved, canonicalized directory-portion of path.""" | ||
return os.path.dirname(os.path.realpath(path)) | ||
|
||
|
||
def java_executable(): | ||
"""Return the executable name of the Java interpreter.""" | ||
java_home = getenv('JAVA_HOME') | ||
java_bin = os.path.join('bin', 'java') | ||
|
||
if java_home and access(os.path.join(java_home, java_bin), X_OK): | ||
return os.path.join(java_home, java_bin) | ||
else: | ||
return 'java' | ||
|
||
|
||
def jvm_opts(argv): | ||
"""Construct list of Java arguments based on our argument list. | ||
|
||
The argument list passed in argv must not include the script name. | ||
The return value is a 3-tuple lists of strings of the form: | ||
(memory_options, prop_options, passthrough_options) | ||
""" | ||
mem_opts = [] | ||
prop_opts = [] | ||
pass_args = [] | ||
exec_dir = None | ||
|
||
for arg in argv: | ||
if arg.startswith('-D'): | ||
prop_opts.append(arg) | ||
elif arg.startswith('-XX'): | ||
prop_opts.append(arg) | ||
elif arg.startswith('-Xm'): | ||
mem_opts.append(arg) | ||
elif arg.startswith('--exec_dir='): | ||
exec_dir = arg.split('=')[1].strip('"').strip("'") | ||
if not os.path.exists(exec_dir): | ||
shutil.copytree(real_dirname(sys.argv[0]), exec_dir, symlinks=False, ignore=None) | ||
else: | ||
pass_args.append(arg) | ||
|
||
# In the original shell script the test coded below read: | ||
# if [ "$jvm_mem_opts" == "" ] && [ -z ${_JAVA_OPTIONS+x} ] | ||
# To reproduce the behaviour of the above shell code fragment | ||
# it is important to explictly check for equality with None | ||
# in the second condition, so a null envar value counts as True! | ||
|
||
if mem_opts == [] and getenv('_JAVA_OPTIONS') is None: | ||
mem_opts = default_jvm_mem_opts | ||
|
||
return (mem_opts, prop_opts, pass_args, exec_dir) | ||
|
||
|
||
def main(): | ||
java = java_executable() | ||
(mem_opts, prop_opts, pass_args, exec_dir) = jvm_opts(sys.argv[1:]) | ||
jar_dir = exec_dir if exec_dir else real_dirname(sys.argv[0]) | ||
|
||
if pass_args != [] and pass_args[0].startswith('eu'): | ||
jar_arg = '-cp' | ||
else: | ||
jar_arg = '-jar' | ||
|
||
jar_path = os.path.join(jar_dir, jar_file) | ||
|
||
java_args = [java] + mem_opts + prop_opts + [jar_arg] + [jar_path] + pass_args | ||
|
||
sys.exit(subprocess.call(java_args)) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
outdir=$PREFIX/opt/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM | ||
mkdir -p $outdir | ||
mkdir -p $PREFIX/bin | ||
cp -R * $outdir/ | ||
cp $RECIPE_DIR/SNVerIndividual.py $outdir/SNVerIndividual.py | ||
cp $RECIPE_DIR/SNVerPool.py $outdir/SNVerPool.py | ||
ln -s $outdir/SNVerIndividual.py $PREFIX/bin/snver | ||
ln -s $outdir/SNVerPool.py $PREFIX/bin/snver-pool | ||
chmod 0755 "${PREFIX}/bin/snver" | ||
chmod 0755 "${PREFIX}/bin/snver-pool" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{% set name = "snver" %} | ||
{% set version = "0.5.3" %} | ||
|
||
about: | ||
home: http://snver.sourceforge.net/ | ||
license: GNU General Public License version 3.0 (GPLv3) | ||
summary: | | ||
SNVer is a statistical tool for calling common and rare variants in analysis of pool or individual next-generation sequencing data. | ||
It reports one single overall p-value for evaluating the significance of a candidate locus being a variant, based on which multiplicity control can be obtained. | ||
Loci with any (low) coverage can be tested and depth of coverage will be quantitatively factored into final significance calculation. | ||
SNVer runs very fast, making it feasible for analysis of whole-exome sequencing data, or even whole-genome sequencing data. | ||
|
||
package: | ||
name: snver | ||
version: {{ version }} | ||
|
||
build: | ||
noarch: generic | ||
number: 0 | ||
|
||
source: | ||
url: https://sourceforge.net/projects/snver/files/SNVer-{{ version }}.tar.gz | ||
sha256: ac387873370941ab1b379def51252f40e819b0529e06f8cd8f04b61fea1b6cf8 | ||
|
||
requirements: | ||
host: | ||
run: | ||
- openjdk >=6 | ||
- python | ||
|
||
test: | ||
commands: | ||
- snver | ||
- snver-pool | ||
|
||
extra: | ||
notes: | | ||
SNVer is Java program that comes with a custom wrapper shell script. | ||
This shell wrapper is called "opsin" and is on $PATH by default. By default | ||
"-Xms512m -Xmx1g" is set in the wrapper. If you want to overwrite it you can | ||
specify these values directly after your binaries. If you have _JAVA_OPTIONS | ||
set globally this will take precedence. | ||
For example run it with "snver -Xms512m -Xmx1g" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPL requires that distributions be accompanied by a copy of the license, so
license_file
must be set. Should be somewhere in the tarball.