Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
nunofonseca committed Nov 4, 2021
2 parents 75bd15b + 19b47a8 commit 2db541f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/msi
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
# =========================================================

MSI_VERSION="0.3.5"
MSI_VERSION="0.3.6"
PATH2SCRIPT=$(dirname "${BASH_SOURCE[0]}" )
## load shell functions
source $PATH2SCRIPT/msi_shared.sh
Expand Down Expand Up @@ -49,7 +49,7 @@ CD_HIT_CLUSTER_THRESHOLD=0.99
CONF_FILE=
GEN_FASTQC_REPORT="N"
SKIP_BLAST="N"
IGNORE_UNCLASSIFIED=0 ;## process (1) or not (0) the file with unclassified reads (no barcodes)
IGNORE_UNCLASSIFIED=1 ;## process (1) or not (0) the file with unclassified reads (no barcodes)
## minimum number of reads that a cluster must have to pass the classification step (blastnig)
CLUSTER_MIN_READS=1

Expand Down
5 changes: 3 additions & 2 deletions scripts/msi_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,12 @@ function install_all {
}

function msi_to_docker {
MSI_VERSION="0.3.5"
MSI_VERSION="0.3.6"
set -e
echo "Generating docker image with MSI...this may take a while"
pushd $PATH2SCRIPT/..
docker build -f msi.dockerfile -t "msi/$MSI_VERSION" .
#docker build -f msi.dockerfile -t "msi/$MSI_VERSION" .
docker build -f Dockerfile -t "msi/$MSI_VERSION" .
exit 0
}

Expand Down
6 changes: 6 additions & 0 deletions scripts/msi_shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ function load_metadata {
perror "file $1 not found or not readable"
exit 1
fi
if [ "$1-" == "unclassified.fastq.gz-" ]; then
# nothing to do
return
fi
MD_FILE=$1
# experiment_id
local FILE=$2
Expand All @@ -163,7 +167,9 @@ function load_metadata {
set -e
if [ "$x-" == "-" ]; then
FILE=$(basename -s .fastq.gz $FILE )
set +e
x=$(grep -i -E "$EXPERIMENT_ID" $MD_FILE| grep -i -E "(^|\s)$FILE(\s|$)" |cut -f $i)
set -e
fi
MD[$C_UP]="$x"
export MDP_$C_UP=$i
Expand Down
34 changes: 34 additions & 0 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,45 @@ mbk_mt2w=
mbk_sp_discard_num=
EOF

cat <<EOF > $TMPDIR/msi2.params
METADATAFILE=tests/metadata/metadata2.tsv
blast_refdb=$TMPDIR/refdb/db1
CLUSTER_MIN_READS=1
CD_HIT_CLUSTER_THRESHOLD=0.99
EXPERIMENT_ID=
PRIMER_MAX_ERROR=0.2
TAXONOMY_DATA_DIR=$MSI_DIR/db
TL_DIR=tests/samples/
IGNORE_UNCLASSIFIED=0
OUT_FOLDER=$TMPDIR/t5a
CLUST_MAPPED_THRESHOLD=0.825
CLUST_ALIGNED_THRESHOLD=0.55
blast_evalue=0.001
blast_max_target_seqs=20
blast_perc_identity=70
mbk_Species=96
mbk_Genus=92
mbk_Family=92
mbk_AboveF=92
mbk_TopSpecies=100
mbk_TopGenus=1
mbk_TopFamily=1
mbk_TopAF=1
mbk_rm_predicted=ssciname
mbk_sp_discard_sp=
mbk_mt2w=
mbk_sp_discard_num=
EOF


must_succeed "msi -c $TMPDIR/msi.params"

must_succeed " [ $(zcat $TMPDIR/t5a/binres.tsv.gz|cut -f 1|tail -n +2|sort -u|wc -l) == 2 ]"
must_succeed " [ $(zcat $TMPDIR/t5a/results.tsv.gz|cut -f 1|tail -n +2|sort -u|wc -l) == 2 ]"

must_succeed "msi -c $TMPDIR/msi2.params -S"


must_succeed "msi -I tests/metadata/metadata2.tsv -i tests/samples/s4/ -o $TMPDIR/t4 -b $TMPDIR/refdb/db1"

Expand Down

0 comments on commit 2db541f

Please sign in to comment.