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 26, 2020
2 parents f24a1da + 1734a0d commit 9aed5a6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
7 changes: 5 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.1"
MSI_VERSION="0.3.2"
PATH2SCRIPT=$(dirname "${BASH_SOURCE[0]}" )
## load shell functions
source $PATH2SCRIPT/msi_shared.sh
Expand Down Expand Up @@ -344,6 +344,9 @@ if [ "$CONF_FILE-" != "-" ]; then
pinfo "Loading $CONF_FILE...done."
fi

## update some variables
mbk_db=$TAXONOMY_DATA_DIR

## Check and validate arguments
if [ "$TL_DIR-" == "-" ]; then
perror "no value given to parameter -i"
Expand Down Expand Up @@ -829,7 +832,7 @@ function process_fastq {
if [ "${MD[PRIMER_SET]^^}-" == "NONE-" ] ||
[ "${MD[PRIMER_SET]^^}-" == "-" ] ; then
pinfo "No primers for $fq_file"
sed -E "s/ /_/g;s/size=(.*)$/\1/;s/$/:adapter=none:/" $CENTROIDS1 > $CENTROIDS.tmp && mv $CENTROIDS.tmp $CENTROIDS
sed -E "s/ /_/g;s/size=(.*)$/\1/;s/^>(.*)$/>\1:adapter=none:/" $CENTROIDS1 > $CENTROIDS.tmp && mv $CENTROIDS.tmp $CENTROIDS

else
pinfo "Calling cutadapter"
Expand Down
13 changes: 8 additions & 5 deletions scripts/msi_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
PATH2SCRIPT=$(dirname "${BASH_SOURCE[0]}" )

## OS tools
SYSTEM_DEPS="wget gunzip grep git perl /usr/bin/time bash java pip3 python3 Rscript R make cmake"
SYSTEM_DEPS="wget gunzip grep git perl /usr/bin/time bash java pip3 python3 Rscript R make cmake EMBOSS"

SYSTEM_PACKS="ncurses-devel libcurl-devel openssl-devel pandoc python3-devel"

Expand All @@ -38,7 +38,7 @@ cutadapt_VERSION=2.10
isONclust_VERSION=0.0.6


metabinkit_VERSION=0.2.1
metabinkit_VERSION=0.2.2
metabinkit_URL=https://github.com/envmetagen/metabinkit/archive/${metabinkit_VERSION}.tar.gz

fastq_utils_VERSION=0.24.1
Expand All @@ -60,6 +60,8 @@ CD_HIT_URL=https://github.com/weizhongli/cdhit/releases/download/V$CD_HIT_VERSIO
racon_VERSION=1.4.13
racon_URL="https://github.com/lbcb-sci/racon/releases/download/$racon_VERSION/racon-v${racon_VERSION}.tar.gz"

emboss_VERSION=6.6.0

envir_name=test_msi_env
####################################################################
##
Expand Down Expand Up @@ -259,7 +261,7 @@ if (version\$major > 3 || (version\$major == 3 && version\$minor>5)) {
message("_____________________________________________________")
message("Installing packages")
packages2install<-c("Matrix","data.table","devtools","shiny","plotly","DT","r2d3","tidyr","sunburstR","d3heatmap","gplots","rmarkdown","flexdashboard","d3Tree")
packages2install<-c("Matrix","data.table","devtools","shiny","plotly","DT","r2d3","tidyr","sunburstR","d3heatmap","gplots","rmarkdown","flexdashboard","d3Tree","R.utils")
for (p in packages2install ) {
message("PACKAGE:",p,"\n")
Expand Down Expand Up @@ -322,7 +324,7 @@ function install_all {
}

function msi_to_docker {
MSI_VERSION="0.3.1"
MSI_VERSION="0.3.2"
set -e
echo "Generating docker image with MSI...this may take a while"
pushd $PATH2SCRIPT/..
Expand Down Expand Up @@ -406,7 +408,7 @@ set +u
## Python
export PYTHONUSERBASE=\$MSI_DIR/python
export PYTHONPATH=$MSI_DIR/:$PYTHONPATH
## lib64/$python_dir/site-packages:\$MSI_DIR/lib/$python_dir/site-packages:\$MSI_DIR/lib64/$python3_dir/site-packages:\$MSI_DIR/lib/$python3_dir/site-packages:$PYTHONPATH
## lib64/$python_dir/site-packages:\$MSI_DIR/lib64/:$PYTHONPATH
## R packages
export R_LIBS=\$MSI_DIR/Rlibs:\$R_LIBS
PATH=\$MSI_DIR/python/bin:\$PATH
Expand Down Expand Up @@ -440,6 +442,7 @@ if [ "$CONDA_ENVIR-" == "1-" ]; then
conda install -n $envir_name -c bioconda -c conda-forge minimap2=$minimap2_VERSION -y
conda install -n $envir_name -c bioconda -c conda-forge cd-hit=$cd_hit_VERSION -y
conda install -n $envir_name -c bioconda -c conda-forge racon=$racon_VERSION -y
conda install -n $envir_name -c bioconda -c conda-forge emboss=$emboss_VERSION -y
#1.4.13-he513fc3_0
#conda install -n $envir_name -c bioconda -c conda-forge pilon=1.23 -y
echo "type
Expand Down
11 changes: 8 additions & 3 deletions scripts/msi_rename_columns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,20 @@ OLD_COLUMN_NUM=$(get_metadata_col_pos $METADATA_COLUMN_OLD)
NEW_COLUMN_NUM=$(get_metadata_col_pos $METADATA_COLUMN_NEW)

tmp=$(mktemp -p . .msi_rename_XXX)
zcat $TSV_FILE| tail -n +2 | sort -k1,1 > $tmp.1
LC_ALL=C zcat $TSV_FILE| tail -n +2 | sort -k1b,1 > $tmp.1

## header
set +e
zcat $TSV_FILE |head -n 1
set -e
awk -v c1="${OLD_COLUMN_NUM}" -v c2="${NEW_COLUMN_NUM}" 'BEGIN {FS="\t"; OFS="\t"} {print $c1,$c2 }' $METADATAFILE | tail -n +2 | sort -k1,1 > $tmp.2
join -t$'\t' $tmp.2 $tmp.1 | cut -f 2-
if [ "$EXPERIMENT_ID-" != "-" ]; then
LC_ALL=C grep -E "(\s|^)$EXPERIMENT_ID(\s|$)" $METADATAFILE| awk -v c1="${OLD_COLUMN_NUM}" -v c2="${NEW_COLUMN_NUM}" 'BEGIN {FS="\t"; OFS="\t"} {print $c1,$c2 }' | sort -k1b,1 > $tmp.2
else
LC_ALL=C awk -v c1="${OLD_COLUMN_NUM}" -v c2="${NEW_COLUMN_NUM}" 'BEGIN {FS="\t"; OFS="\t"} {print $c1,$c2 }' $METADATAFILE | tail -n +2 | sort -k1b,1 > $tmp.2
fi


LC_ALL=C join -t$'\t' $tmp.2 $tmp.1 | cut -f 2-
rm -f $tmp.2 $tmp.1 $tmp

exit 0
Expand Down

0 comments on commit 9aed5a6

Please sign in to comment.