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 ported easyblocks for picard and GenomeAnalysisTK #278
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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,90 @@ | ||
## | ||
# Copyright 2009-2013 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), | ||
# the Hercules foundation (http://www.herculesstichting.be/in_English) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# http://github.com/hpcugent/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
Support for building and installing GenomeAnalysisTK, implemented as an easyblock. | ||
|
||
@author: Stijn De Weirdt (Ghent University) | ||
@author: Dries Verdegem (Ghent University) | ||
@author: Kenneth Hoste (Ghent University) | ||
@author: Pieter De Baets (Ghent University) | ||
@author: Jens Timmerman (Ghent University) | ||
""" | ||
|
||
import os | ||
import shutil | ||
|
||
from easybuild.framework.easyblock import EasyBlock | ||
|
||
|
||
class EB_GenomeAnalysisTK(EasyBlock): | ||
"""Support for building and installing GenomeAnalysisTK.""" | ||
|
||
def configure_step(self): | ||
"""No configure step for GenomeAnalysisTK""" | ||
pass | ||
|
||
def build_step(self): | ||
"""No build step for GenomeAnalysisTK""" | ||
pass | ||
|
||
def install_step(self): | ||
"""Install GenomeAnalysisTK by copying required files/directories""" | ||
srcdir = self.cfg['start_dir'] | ||
for jar in ["AnalyzeCovariates.jar", "GenomeAnalysisTK.jar"]: | ||
src = os.path.join(srcdir, jar) | ||
dst = os.path.join(self.installdir, jar) | ||
try: | ||
if os.path.exists(src): | ||
shutil.copy2(src, dst) | ||
self.log.info("Successfully copied %s to %s" % (src, dst)) | ||
except OSError, err: | ||
self.log.error("Failed to copy %s to %s: %s" % (src, dst, err)) | ||
|
||
for subdir in ['resources']: | ||
try: | ||
src_dir = os.path.join(self.cfg['start_dir'], subdir) | ||
dst_dir = os.path.join(self.installdir, subdir) | ||
if os.path.exists(src_dir): | ||
shutil.copytree(src_dir, dst_dir) | ||
else: | ||
self.log.warning("No directory %s, so not copying it." % src_dir) | ||
self.log.info("Successfully copied %s to %s" % (src_dir, dst_dir)) | ||
except OSError, err: | ||
self.log.error("Failed to copy %s to %s: %s" % (src_dir, dst_dir, err)) | ||
|
||
def sanity_check_step(self): | ||
"""Custom sanity check for GenomeAnalysisTK""" | ||
custom_paths = { | ||
'files': ["GenomeAnalysisTK.jar"], | ||
'dirs': ["resources"], | ||
} | ||
super(EB_GenomeAnalysisTK, self).sanity_check_step(custom_paths=custom_paths) | ||
|
||
def make_module_extra(self): | ||
"""Add module entries specific to GenomeAnalysisTK""" | ||
txt = super(EB_GenomeAnalysisTK, self).make_module_extra() | ||
txt += self.moduleGenerator.prepend_paths('PATH', '') | ||
return txt | ||
|
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,83 @@ | ||
## | ||
# Copyright 2009-2013 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), | ||
# the Hercules foundation (http://www.herculesstichting.be/in_English) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# http://github.com/hpcugent/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
Support for building and installing picard, implemented as an easyblock. | ||
|
||
@author: Stijn De Weirdt (Ghent University) | ||
@author: Dries Verdegem (Ghent University) | ||
@author: Kenneth Hoste (Ghent University) | ||
@author: Pieter De Baets (Ghent University) | ||
@author: Jens Timmerman (Ghent University) | ||
""" | ||
|
||
import os | ||
import re | ||
import shutil | ||
|
||
from easybuild.framework.easyblock import EasyBlock | ||
|
||
|
||
class EB_picard(EasyBlock): | ||
"""Support for building and installing picard.""" | ||
|
||
def configure_step(self): | ||
"""No configure step for picard""" | ||
pass | ||
|
||
def build_step(self): | ||
"""No build step for picard""" | ||
pass | ||
|
||
def install_step(self): | ||
"""Install picard by copying required files""" | ||
# recent version may contain more than just the picard-tools subdirectory | ||
picard_tools_dir = 'picard-tools-%s' % self.version | ||
if not re.search("%s/?$" % picard_tools_dir, self.cfg['start_dir']): | ||
self.cfg['start_dir'] = os.path.join(self.cfg['start_dir'], picard_tools_dir) | ||
if not os.path.exists(self.cfg['start_dir']): | ||
self.log.error("Path %s to copy files from doesn't exist." % self.cfg['start_dir']) | ||
|
||
for jar in os.listdir(self.cfg['start_dir']): | ||
src = os.path.join(self.cfg['start_dir'], jar) | ||
dst = os.path.join(self.installdir, jar) | ||
try: | ||
shutil.copy2(src, dst) | ||
self.log.info("Successfully copied %s to %s" % (src, dst)) | ||
except OSError, err: | ||
self.log.error("Failed to copy %s to %s (%s)" % (src, dst, err)) | ||
|
||
def sanity_check_step(self): | ||
"""Custom sanity check for picard""" | ||
custom_paths = { | ||
'files': ["%s-%s.jar" % (x, self.version) for x in ['picard', 'sam']], | ||
'dirs': [], | ||
} | ||
super(EB_picard, self).sanity_check_step(custom_paths=custom_paths) | ||
|
||
def make_module_extra(self): | ||
"""Add module entries specific to picard""" | ||
txt = super(EB_picard, self).make_module_extra() | ||
txt += self.moduleGenerator.prepend_paths('PATH', '') | ||
return txt |
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.
reviewed, all fine, simply remove the extra line above if considered redundant
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.
there should be two empty lines above the class definition :)