Skip to content

Commit

Permalink
add container
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangrengang committed Sep 28, 2023
1 parent 15efcd6 commit dde7037
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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/
Expand Down
13 changes: 7 additions & 6 deletions subphaser/RunCmdsMP.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand Down
13 changes: 7 additions & 6 deletions subphaser/api/TEsorter/modules/RunCmdsMP.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit dde7037

Please sign in to comment.