diff --git a/README.md b/README.md index 2b04ec8..c6e7810 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ bash test_wheat.sh * [Introduction](#introduction) * [Inputs](#Inputs) * [Run SubPhaser](#Run-SubPhaser) + * [Run SubPhaser through Singularity/Apptainer](#Run-SubPhaser-through-Singularity/Apptainer) * [Outputs](#Outputs) * [When SubPhaser do not work](#When-SubPhaser-do-not-work) * [Citation](#Citation) @@ -133,7 +134,17 @@ Input custom feature (e.g. transposable element, gene) sequences for subgenome-s ``` subphaser -i genome.fasta.gz -c sg.config -custom_features TEs.fasta genes.fasta ``` +### Run SubPhaser through Singularity/Apptainer ### +Alternatively, you can run `subphaser` through Singularity/Apptainer container: +``` +# install +apptainer remote add --no-login SylabsCloud cloud.sylabs.io +apptainer remote use SylabsCloud +apptainer pull subphaser.sif library://shang-hongyun/collection/subphaser.sif:1.2.6 +# run +./subphaser.sif subphaser -h +``` ### Outputs ### ``` phase-results/ diff --git a/subphaser/RunCmdsMP.py b/subphaser/RunCmdsMP.py index 356bff4..f833dd5 100644 --- a/subphaser/RunCmdsMP.py +++ b/subphaser/RunCmdsMP.py @@ -24,12 +24,12 @@ import drmaa # for grid GRID = True from tempfile import NamedTemporaryFile -except (RuntimeError,ImportError,AttributeError) as e: -# if "DRMAA_LIBRARY_PATH" in format(e): -# logger.warning('Grid computing is not available because DRMAA not configured properly: {}'.format(e)) -# else: -# logger.warning('Grid computing is not available because DRMAA not installed: {}'.format(e)) -# logger.info('No DRMAA, Switching to local/cluster mode.') +except (RuntimeError,ImportError,AttributeError,OSError) as e: + if "DRMAA_LIBRARY_PATH" in format(e): + logger.warning('Grid computing is not available because DRMAA not configured properly: {}'.format(e)) + else: + logger.warning('Grid computing is not available because DRMAA not installed: {}'.format(e)) + logger.info('No DRMAA (see https://github.com/pygridtools/drmaa-python), Switching to local mode.') GRID = False __version__ = '1.1' @@ -149,6 +149,7 @@ def which_grid(self): return 'slurm' else: logger.warn('Please provide your grid system `{}` to auther'.format(name)) + return 'sge' def run_tasks(cmd_list, tc_tasks=None, mode='grid', grid_opts='', cpu=1, mem='1g', cont=1, retry=1, script=None, out_path=None, completed=None, cmd_sep='\n', **kargs): if not cmd_list: diff --git a/subphaser/api/TEsorter/modules/RunCmdsMP.py b/subphaser/api/TEsorter/modules/RunCmdsMP.py index 356bff4..f833dd5 100644 --- a/subphaser/api/TEsorter/modules/RunCmdsMP.py +++ b/subphaser/api/TEsorter/modules/RunCmdsMP.py @@ -24,12 +24,12 @@ import drmaa # for grid GRID = True from tempfile import NamedTemporaryFile -except (RuntimeError,ImportError,AttributeError) as e: -# if "DRMAA_LIBRARY_PATH" in format(e): -# logger.warning('Grid computing is not available because DRMAA not configured properly: {}'.format(e)) -# else: -# logger.warning('Grid computing is not available because DRMAA not installed: {}'.format(e)) -# logger.info('No DRMAA, Switching to local/cluster mode.') +except (RuntimeError,ImportError,AttributeError,OSError) as e: + if "DRMAA_LIBRARY_PATH" in format(e): + logger.warning('Grid computing is not available because DRMAA not configured properly: {}'.format(e)) + else: + logger.warning('Grid computing is not available because DRMAA not installed: {}'.format(e)) + logger.info('No DRMAA (see https://github.com/pygridtools/drmaa-python), Switching to local mode.') GRID = False __version__ = '1.1' @@ -149,6 +149,7 @@ def which_grid(self): return 'slurm' else: logger.warn('Please provide your grid system `{}` to auther'.format(name)) + return 'sge' def run_tasks(cmd_list, tc_tasks=None, mode='grid', grid_opts='', cpu=1, mem='1g', cont=1, retry=1, script=None, out_path=None, completed=None, cmd_sep='\n', **kargs): if not cmd_list: