Skip to content

Commit 55fd9b4

Browse files
including files for easy installing procedures
1 parent a31bdab commit 55fd9b4

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

install.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
set -v
2+
set -e
3+
4+
# This is set in travis
5+
if [[ x$PYTHON_VERSION == x ]]; then
6+
PYTHON_VERSION=3.9
7+
fi
8+
9+
10+
echo "
11+
# GMSC-Mapper
12+
AUTHORS: Yiqian Duan, Celio Dias Santos Junior, Luis Pedro Coelho
13+
"
14+
15+
if ! which conda > /dev/null; then
16+
echo "[ Conda not found. Please install miniconda and add 'conda' to the PATH: "
17+
echo " curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"
18+
echo " sh Miniconda3-latest-Linux-x86_64.sh"
19+
exit 1
20+
fi
21+
22+
eval "$(conda shell.bash hook)"
23+
24+
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
25+
26+
27+
echo "# Creating new environment for GMSC-mapper"
28+
mkdir -p envs
29+
30+
conda config --env --add channels defaults
31+
conda config --env --add channels bioconda
32+
conda config --env --add channels conda-forge
33+
34+
if ! which mamba > /dev/null; then
35+
CONDA_INSTALL_CMD=conda
36+
else
37+
echo "# Installing packages with MAMBA"
38+
CONDA_INSTALL_CMD=mamba
39+
fi
40+
41+
${CONDA_INSTALL_CMD} env create \
42+
-p $BASEDIR/envs/gmscmapper \
43+
-f $BASEDIR/environment.yml
44+
45+
# only activate AFTER install all the packages to get the right environmental variables
46+
source activate $BASEDIR/envs/gmscmapper
47+
python3 $BASEDIR/setup.py install
48+
bash $BASEDIR/tests.sh
49+
50+
echo "############ Installation procedures finished
51+
****** Thank you for installing GMSC-Mapper ********
52+
--- Please submit bugreports/comments to
53+
https://github.com/BigDataBiology/GMSC-mapper/issues"
54+

tests.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
set -v
2+
set -e
3+
4+
echo "# GMSC-Mapper
5+
AUTHORS: Yiqian Duan, Celio Dias Santos Junior, Luis Pedro Coelho"
6+
7+
echo "Creating mocking databases"
8+
gmsc-mapper createdb -i examples/target.faa -o examples/ -m diamond
9+
gmsc-mapper createdb -i examples/target.faa -o examples/ -m mmseqs
10+
11+
echo "Testing basic usage"
12+
gmsc-mapper -i examples/example.fa --db examples/targetdb.dmnd --habitat examples/ref_habitat.txt --quality examples/ref_quality.txt --taxonomy examples/ref_taxonomy.txt
13+
gmsc-mapper --aa-genes examples/example.faa --db examples/targetdb.dmnd --habitat examples/ref_habitat.txt --quality examples/ref_quality.txt --taxonomy examples/ref_taxonomy.txt
14+
gmsc-mapper --nt-genes examples/example.fna --db examples/targetdb.dmnd --habitat examples/ref_habitat.txt --quality examples/ref_quality.txt --taxonomy examples/ref_taxonomy.txt
15+
16+
echo "Testing flags for no alternative results"
17+
gmsc-mapper -i examples/example.fa --db examples/targetdb.dmnd --habitat examples/ref_habitat.txt --quality examples/ref_quality.txt --taxonomy examples/ref_taxonomy.txt --nohabitat --notaxonomy --noquality
18+
19+
echo "Testing tool flag - MMSeqs"
20+
gmsc-mapper -i examples/example.fa --db examples/targetdb --habitat examples/ref_habitat.txt --quality examples/ref_quality.txt --taxonomy examples/ref_taxonomy.txt --tool mmseqs
21+
22+
echo "Testing tool flag - Diamond"
23+
gmsc-mapper -i examples/example.fa --db examples/targetdb --habitat examples/ref_habitat.txt --quality examples/ref_quality.txt --taxonomy examples/ref_taxonomy.txt --tool diamond
24+

0 commit comments

Comments
 (0)