Skip to content

Commit

Permalink
add command to display installed banks list
Browse files Browse the repository at this point in the history
  • Loading branch information
pgdurand committed Mar 25, 2017
1 parent 3b716cb commit 6dd483a
Show file tree
Hide file tree
Showing 14 changed files with 778 additions and 32 deletions.
13 changes: 12 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
<property name="KLMirrorClass" value="${rootpkg}.CmdLineInstaller" />
<property name="KLUIMirrorClass" value="${rootpkg}.UiInstaller" />
<property name="KLQueryMirrorClass" value="${rootpkg}.CmdLineQuery" />
<property name="KLMirrorAnnot" value="${rootpkg}.Annotate" />
<property name="KLMirrorAnnot" value="${rootpkg}.Annotate" />
<property name="KLMirrorInfo" value="${rootpkg}DumpBankList" />

<path id="class.path">
<pathelement path="${classpath}" />
Expand Down Expand Up @@ -147,6 +148,11 @@
<filter token="APP_MAIN_CLASS" value="${KLMirrorAnnot}" />
</filterset>
</copy>
<copy file="${scripts}/info.sh" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorInfo}" />
</filterset>
</copy>
<copy file="${scripts}/install.bat" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorClass}" />
Expand All @@ -167,6 +173,11 @@
<filter token="APP_MAIN_CLASS" value="${KLMirrorAnnot}" />
</filterset>
</copy>
<copy file="${scripts}/info.bat" todir="${Dscripts}">
<filterset>
<filter token="APP_MAIN_CLASS" value="${KLMirrorInfo}" />
</filterset>
</copy>

<!-- Copy the DBMS main config file -->
<copy file="${scripts}/dbms.config" todir="${Dscripts}" />
Expand Down
117 changes: 117 additions & 0 deletions conf/system/dbmsVersion-html.vm
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>$bdminfo.config.name</title>
<meta charset="UTF-8">
</head>

<body>

<!-- CONFIGURATION -->
<div id="conf">
<h4>Banks managed by $bdminfo.config.name</h4>
<h5>Configuration</h5>
<p>
<ul>
<li><i>Install path: </i>$bdminfo.config.instpath</li>
<li><i>Master configuration: </i>$bdminfo.config.instconfpath</li>
<li><i>Logs path: </i>$bdminfo.config.logpath</li>
<li><i>Working path: </i>$bdminfo.config.wkpath</li>
<li><i>Bank configuration: </i>$bdminfo.config.confpath</li>
<li><i>Bank storage path: </i>$bdminfo.config.dbpath</li>
<li><i>Bank repository size: </i>$bdminfo.config.reposize</i></li>
</ul>
</p>
</div>

<div id="db">
<!-- DATABANK: protein -->
#set( $dbTable = $bdminfo.databases2.mirror_p )
<h4>Protein banks: <span>${dbTable.size()}</span></h4>
#if( ${dbTable.size()} == 0 )
<p>none</p>
#else
<table border="1">
<tr>
<th>Name</th>
<!-- <th>Code</th> -->
<th>Description</th>
<th>Annotated</th>
<th>Size (sequences)</th>
<th>Size on disk</th>
<th>Install date</th>
</tr>
#foreach( $db in $dbTable )
<tr>
<td>$db.getName()</td>
<!-- <td>$db.getCode()</td> -->
<td>$db.getDescription()</br>BLAST+ use: -db $db.getDbPath().substring(0, $db.getDbPath().lastIndexOf("."))</td>
<td>$db.hasAnnotation()</td>
<td>$db.getNbSequence()</td>
<td>$db.getDiskSize()</td>
<td>$db.getTimeStamp()</td>
</tr>
#end
</table>
#end

<!-- DATABANK: nucleotide -->
#set( $dbTable = $bdminfo.databases2.mirror_n )
<h4>Nucleotide banks: <span>${dbTable.size()}</span></h4>
#if( ${dbTable.size()} == 0 )
<p>none</p>
#else
<table border="1">
<tr>
<th>Name</th>
<!-- <th>Code</th> -->
<th>Description</th>
<th>Annotated</th>
<th>Size (sequences)</th>
<th>Size on disk</th>
<th>Install date</th>
</tr>
#foreach( $db in $dbTable )
<tr>
<td>$db.getName()</td>
<!-- <td>$db.getCode()</td> -->
<td>$db.getDescription()</br>BLAST+ use: -db $db.getDbPath().substring(0, $db.getDbPath().lastIndexOf("."))</td>
<td>$db.hasAnnotation()</td>
<td>$db.getNbSequence()</td>
<td>$db.getDiskSize()</td>
<td>$db.getTimeStamp()</td>
</tr>
#end
</table>
#end
<!-- DATABANK: bco -->
#set( $dbTable = $bdminfo.databases2.mirror_d )
<h4>Biological classification banks: <span>${dbTable.size()}</span></h4>
#if( ${dbTable.size()} == 0 )
<p>none</p>
#else
<table border="1">
<tr>
<th>Name</th>
<!-- <th>Code</th> -->
<th>Description</th>
<th>Size (sequences)</th>
<th>Size on disk</th>
<th>Install date</th>
</tr>
#foreach( $db in $dbTable )
<tr>
<td>$db.getName()</td>
<!-- <td>$db.getCode()</td> -->
<td>$db.getDescription()</td>
<td>$db.getNbSequence()</td>
<td>$db.getDiskSize()</td>
<td>$db.getTimeStamp()</td>
</tr>
#end
</table>
#end
</div>

</body>
</html>
52 changes: 52 additions & 0 deletions conf/system/dbmsVersion-txt.vm
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
$bdminfo.config.name

Configuration:

Install path : $bdminfo.config.instpath
Master configuration : $bdminfo.config.instconfpath
Log path : $bdminfo.config.logpath
Work path : $bdminfo.config.wkpath
Bank configuration file: $bdminfo.config.confpath
Bank repository path : $bdminfo.config.dbpath
Bank repository size : $bdminfo.config.reposize

Installed banks
#set( $pTable = $bdminfo.databases2.mirror_p )
- Protein banks: ${pTable.size()}
#if( ${pTable.size()} != 0 )
#foreach( $db in $pTable )
* $db.getName()
Description: $db.getDescription()
BLAST+ use: -db $db.getDbPath().substring(0, $db.getDbPath().lastIndexOf("."))
Annotated bank: $db.hasAnnotation()
Size (sequences): $db.getNbSequence()
Size on disk: $db.getDiskSize()
Install date: $db.getTimeStamp()
#end
#end

#set( $nTable = $bdminfo.databases2.mirror_n )
- Nucleotide banks: ${nTable.size()}
#if( ${nTable.size()} != 0 )
#foreach( $db in $nTable )
* $db.getName()
Description: $db.getDescription()
BLAST+ use: -db $db.getDbPath().substring(0, $db.getDbPath().lastIndexOf("."))
Annotated bank: $db.hasAnnotation()
Size (sequences): $db.getNbSequence()
Size on disk: $db.getDiskSize()
Install date: $db.getTimeStamp()
#end
#end

#set( $dTable = $bdminfo.databases2.mirror_d )
- Biological classification banks: ${dTable.size()}
#if( ${dTable.size()} != 0 )
#foreach( $db in $dTable )
* $db.getName()
Description: $db.getDescription()
Size (terms): $db.getNbSequence()
Size on disk: $db.getDiskSize()
Install date: $db.getTimeStamp()
#end
#end
23 changes: 18 additions & 5 deletions docker/deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
<os family="unix"/>
</condition>

<!-- ============================================================= -->
<target name="help">
<echo>This is the Ant project file to install DBMS for Docker container.</echo>
<echo/>
<echo>Available target is: install</echo>
<echo/>
</target>

<!-- ============================================================= -->
<target name="install">
<echo>Current configuration is:</echo>
Expand Down Expand Up @@ -56,7 +64,8 @@
<chmod file="${installDir}/UiInstall.sh" perm="ugo+x" />
<chmod file="${installDir}/install.sh" perm="ugo+x" />
<chmod file="${installDir}/query.sh" perm="ugo+x" />
<chmod file="${installDir}/annotate.sh" perm="ugo+x" />
<chmod file="${installDir}/annotate.sh" perm="ugo+x" />
<chmod file="${installDir}/info.sh" perm="ugo+x" />
</target>

<!-- ============================================================= -->
Expand Down Expand Up @@ -98,10 +107,14 @@
<param name="kscript" value="query"/>
<param name="kext" value="sh"/>
</antcall>
<antcall target="prepareScript">
<param name="kscript" value="annotate"/>
<param name="kext" value="sh"/>
</antcall>
<antcall target="prepareScript">
<param name="kscript" value="annotate"/>
<param name="kext" value="sh"/>
</antcall>
<antcall target="prepareScript">
<param name="kscript" value="info"/>
<param name="kext" value="sh"/>
</antcall>
<!-- Copy and configure the KDBMS main config file-->
<copy file="${installDir}/scripts/dbms.config" todir="${installDir}/conf">
<filterset>
Expand Down
11 changes: 7 additions & 4 deletions docker/run_bdm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#
# Use: ./run_bdm.sh -c <command> <arguments>
#
# <command>: one of install, query, annotate
# <command>: one of install, query, annotate, info
# <arguments>: remaining arguments passed in after <command> are passed
# to the appropriate BeeDeeM program: install.sh, query.sh
# or annotate.sh. Please refer to these programs to review
# their expected arguments.
# to the appropriate BeeDeeM program: install.sh, query.sh,
# annotate.sh or info.sh. Please refer to these programs to
# review their expected arguments.
#
# Copyright (c) 2017, Patrick G. Durand
# ========================================================================================
Expand Down Expand Up @@ -50,6 +50,9 @@ case "$COMMAND" in
annotate)
. /opt/beedeem/annotate.sh $ALL_ARGS
;;
info)
. /opt/beedeem/info.sh
;;
esac

exit 0
11 changes: 10 additions & 1 deletion scripts/deploy-std.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
<chmod file="${installDir}/UiInstall.sh" perm="ugo+x" />
<chmod file="${installDir}/install.sh" perm="ugo+x" />
<chmod file="${installDir}/query.sh" perm="ugo+x" />
<chmod file="${installDir}/annotate.sh" perm="ugo+x" />
<chmod file="${installDir}/annotate.sh" perm="ugo+x" />
<chmod file="${installDir}/info.sh" perm="ugo+x" />
</target>

<!-- ============================================================= -->
Expand Down Expand Up @@ -138,6 +139,10 @@
<param name="kscript" value="annotate"/>
<param name="kext" value="bat"/>
</antcall>
<antcall target="prepareScript">
<param name="kscript" value="info"/>
<param name="kext" value="bat"/>
</antcall>
<!-- Copy and configure the DBMS main config file-->
<copy file="${installDir}/scripts/dbms.config" tofile="${installDir}/conf/dbms.tmp">
<filterset>
Expand Down Expand Up @@ -170,6 +175,10 @@
<param name="kscript" value="annotate"/>
<param name="kext" value="sh"/>
</antcall>
<antcall target="prepareScript">
<param name="kscript" value="info"/>
<param name="kext" value="sh"/>
</antcall>
<!-- Copy and configure the KDBMS main config file-->
<copy file="${installDir}/scripts/dbms.config" todir="${installDir}/conf">
<filterset>
Expand Down
45 changes: 45 additions & 0 deletions scripts/info.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@echo off

rem
rem DBMS program to list installed banks ; for Windows
rem Copyright (c) - Patrick G. Durand, 2007-2017
rem -------------------------------------------------------------------
rem User manual:
rem https://pgdurand.gitbooks.io/beedeem/
rem -------------------------------------------------------------------
rem The program can be used to list installed banks.
rem
rem In addition, some parameters can be passed to the JVM for special
rem configuration purposes:
rem -DKL_DEBUG=true ; if true, if set, log will be in debug mode
rem -DKL_WORKING_DIR=an_absolute_path ; if not set, log and working
rem directories are set to java.io.tmp
rem -DKL_LOG_FILE=a_file_name ; if set, creates a log file with that
rem name within KL_WORKING_DIR

set CUR_DIR=%cd%

rem *** Application home
set KL_APP_HOME=@KL_INSTALL_DIR@

rem *** Working directory
set KL_WORKING_DIR=@KL_WORKING_DIR@

rem *** Java VM
set JAVA_HOME=@JAVA_ROOT_DIR@
set KL_JAVA_VM=%JAVA_HOME%\bin\java
set KL_JAVA_ARGS=-Xms128M -Xmx1024M -DKL_HOME="%KL_APP_HOME%" -DKL_WORKING_DIR="%KL_WORKING_DIR%"

rem *** Create classpath
SETLOCAL ENABLEDELAYEDEXPANSION
set FILES=
set BIN_HOME=%KL_APP_HOME%\\bin
cd %BIN_HOME%
for /F %%f in ('dir /b *.jar') do set FILES=!FILES!;%KL_APP_HOME%\\bin\\%%f

rem *** Start application
cd %CUR_DIR%
"%KL_JAVA_VM%" %KL_JAVA_ARGS% -classpath "%FILES%" bzh.plealog.dbmirror.main.DumpBankList

rem *** do not leave immediately (to check potential cmd line messages coming from the application)
pause
37 changes: 37 additions & 0 deletions scripts/info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh
#
#
# DBMS program to list installed banks ; for Unix
# Copyright (c) - Patrick G. Durand, 2007-2017
# -------------------------------------------------------------------
# User manual:
# https://pgdurand.gitbooks.io/beedeem/
# -------------------------------------------------------------------
# The program can be used to list installed banks.
#
# In addition, some parameters can be passed to the JVM for special
# configuration purposes:<br>
# -DKL_DEBUG=true ; if true, if set, log will be in debug mode<br>
# -DKL_WORKING_DIR=an_absolute_path ; if not set, log and working
# directories are set to java.io.tmp<br>
# -DKL_LOG_FILE=a_file_name ; if set, creates a log file with that
# name within KL_WORKING_DIR<br><br>

# *** Application home
KL_APP_HOME=@KL_INSTALL_DIR@

# *** Working directory
KL_WORKING_DIR=@KL_WORKING_DIR@

# *** Java VM
JAVA_HOME=@JAVA_ROOT_DIR@
KL_JAVA_VM=$JAVA_HOME/bin/java
KL_JAVA_ARGS="@JAVA_ARGS@ -DKL_HOME=$KL_APP_HOME -DKL_WORKING_DIR=$KL_WORKING_DIR"

# *** JARs section
KL_JAR_LIST_TMP=`\ls $KL_APP_HOME/bin/*.jar`
KL_JAR_LIST=`echo $KL_JAR_LIST_TMP | sed 's/ /:/g'`

# *** start application
KL_APP_MAIN_CLASS=bzh.plealog.dbmirror.main.DumpBankList
$KL_JAVA_VM $KL_JAVA_ARGS -classpath $KL_JAR_LIST $KL_APP_MAIN_CLASS
Loading

0 comments on commit 6dd483a

Please sign in to comment.