-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
333 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
#! Install PHANOTATE (github) | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
source ~/.bash_profile | ||
else | ||
echo "" | ||
fi | ||
|
||
echo "Dependencies: r-base" | ||
if [ ! "$2" = "" ]; then | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
|
||
echo "Installing R and setting PATH for R libraries" | ||
brew install gcc@8 | ||
|
||
else | ||
echo "No dependencies" | ||
fi | ||
|
||
|
||
else | ||
echo "No sudo password, not installing dependencies" | ||
fi | ||
|
||
## set all variables | ||
PROG=PHANOTATE | ||
PROGNICE=PHANOTATE | ||
PROGDIR=$1 | ||
|
||
|
||
if [ -z "${PROGDIR}" ]; then | ||
PROGDIR=~/bioGUI/progs/ | ||
fi | ||
|
||
PROGDIRESC=$(echo $PROGDIR | sed 's/ /\\ /g') | ||
APPBINARYDIR="${PROGDIR}/${PROG}/" | ||
|
||
rm -rf "$PROGDIR/$PROG" | ||
|
||
## create progdir | ||
|
||
git clone --recursive git@github.com:deprekate/PHANOTATE.git $PROG | ||
|
||
cd "$PROGDIR/$PROG" | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
make CC=gcc-8 | ||
else | ||
make | ||
fi | ||
|
||
|
||
if [ $# -gt 2 ]; then | ||
|
||
if [ "$3" = "1" ]; then | ||
|
||
if ! grep -q "$PROGDIRESC/$PROG" ~/.bashrc; then | ||
echo "export PATH=\"$PROGDIRESC/$PROG:\$PATH\" " >> ~/.bashrc; | ||
fi | ||
fi | ||
|
||
fi | ||
|
||
PY3PATH=`which python3` | ||
|
||
APPBINARYESC="${PROGDIRESC}/${PROG}/" | ||
APPBINARY="${PROGDIRESC}/${PROG}/phanotate.py" | ||
if [ -z "$(ls -A ${APPBINARYESC})" ] || [ ! -f ${APPBINARY} ]; then | ||
(>&2 echo ${APPBINARYESC}) | ||
(>&2 ls ${APPBINARYESC}) | ||
|
||
(>&2 echo " \n \n \n") | ||
|
||
(>&2 echo ${PROGDIRESC}) | ||
(>&2 ls ${PROGDIRESC}) | ||
|
||
(>&2 echo " \n \n \n") | ||
|
||
(>&2 echo ${APPBINARY}) | ||
(>&2 ls ${APPBINARY}) | ||
|
||
(>&2 echo " \n \n \n") | ||
|
||
(>&2 echo "ERROR: The application directory is empty after installation.") | ||
(>&2 echo "ERROR: If you experience problems please re-install the software and create an issue on https://github.com/mjoppich/bioGUI.") | ||
(>&2 echo "ERROR: For creating the issue, please upload the log.txt file of your installation attempt.") | ||
|
||
(>&2 echo " \n \n \n") | ||
|
||
else | ||
|
||
echo "${PROG} has been installed into ${APPBINARYESC}" | ||
echo "Binary location ${APPBINARY}" | ||
|
||
fi | ||
|
||
if [ $# -eq 5 ]; then | ||
|
||
IP=$4 | ||
PORT=$5 | ||
|
||
NCCMD="" | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
NCCMD="nc -c $IP $PORT" | ||
else | ||
NCCMD="nc -q 0 $IP $PORT" | ||
fi | ||
|
||
|
||
$NCCMD <<EOF | ||
|
||
<template description="$PROGNICE" title="$PROGNICE"> | ||
<window title="$PROGNICE"> | ||
<vgroup> | ||
|
||
<checkbox id="WSLsel" value="true" selectonwindows="true">Run in WSL?</checkbox> | ||
|
||
<group title="Input Files Reference"> | ||
|
||
<filedialog id="phanotate_input" output="false" multiple="false">Input Fasta</filedialog> | ||
<filedialog id="phanotate_output" output="true" multiple="false">Output ORFs</filedialog> | ||
|
||
<label>Regular Expression for finding sample data</label> | ||
<input id="msempire_sample_regex">*SRR*</input> | ||
|
||
<action program="run_phanotate">Run $PROGNICE</action> | ||
|
||
</group> | ||
|
||
|
||
<streambox id="output1"> | ||
<stream id="outputstream1">COUT</stream> | ||
<stream id="outputstream2">CERR</stream> | ||
</streambox> | ||
|
||
</vgroup> | ||
</window> | ||
<execution> | ||
|
||
<relocate id="phanotate_infasta_rel" from="\${phanotate_input}" wsl="\${WSLsel}"/> | ||
|
||
|
||
<const id="bindir">${APPBINARYDIR}/</const> | ||
|
||
<execute program="run_phanotate" location="" exec="$PY3PATH" param="\${bindir}/phanotate.py \${phanotate_infasta_rel}" wsl="WSLsel"> | ||
<output type="FILE_STD" color="green" location="\${phanotate_output}" /> | ||
<output type="CERR" color="red" to="outputstream2" /> | ||
</execute> | ||
|
||
</execution> | ||
</template> | ||
|
||
|
||
EOF | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
#! Install Mount Drive (WSL only) | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
echo "This will not run on Mac OS" | ||
exit; | ||
else | ||
echo "" | ||
fi | ||
|
||
if [ ! "$2" = "" ]; then | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
echo "This will not run on Mac OS" | ||
exit; | ||
else | ||
|
||
echo "No Dependencies" | ||
|
||
fi | ||
else | ||
echo "No sudo password, not installing dependencies" | ||
fi | ||
|
||
## set all variables | ||
PROG=MNTDRV | ||
PROGDIR=$1 | ||
|
||
if [ -z "${PROGDIR}" ]; then | ||
PROGDIR=~/bioGUI/progs/ | ||
fi | ||
|
||
|
||
PROGDIRESC=$(echo $PROGDIR | sed 's/ /\\ /g') | ||
APPBINARYDIR=${PROGDIRESC}/${PROG}/ | ||
|
||
if [ -d "$PROGDIR/$PROG" ]; then | ||
echo "Removing Folder $PROGDIR/$PROG" | ||
rm -rf $PROGDIR/$PROG | ||
fi | ||
|
||
## create progdir | ||
mkdir -p "$PROGDIR/$PROG" | ||
|
||
APPBINARYDIR=${PROGDIRESC}/${PROG}/ | ||
|
||
UMOUNTBIN=`which umount` | ||
MOUNTBIN=`which mount` | ||
|
||
cat <<EOS > $APPBINARYDIR/mntdrv.sh | ||
#!/usr/bin/env sh | ||
|
||
DRVLTR=\$1 | ||
|
||
DRVLTR=\`echo "\$DRVLTR" | tr '[:upper:]' '[:lower:]'\` | ||
echo $2 | sudo -S mkdir -p /mnt/\$DRVLTR/ | ||
|
||
echo $2 | sudo -S $UMOUNTBIN /mnt/\$DRVLTR/ | ||
echo $2 | sudo -S $MOUNTBIN -t drvfs \$DRVLTR: /mnt/\$DRVLTR/ -o rw,noatime,uid=1000,gid=1000,case=off | ||
|
||
echo "Mounted windows drive \$DRVLTR:\\ to /mnt/\$DRVLTR" | ||
|
||
ls /mnt/\$DRVLTR/ | ||
|
||
EOS | ||
|
||
APPBINARYESC="${PROGDIRESC}/${PROG}/" | ||
APPBINARY="${PROGDIRESC}/${PROG}/mntdrv.sh" | ||
if [ -z "$(ls -A ${APPBINARYESC})" ] || [ ! -f ${APPBINARY} ]; then | ||
(>&2 echo ${APPBINARYESC}) | ||
(>&2 ls ${APPBINARYESC}) | ||
|
||
(>&2 echo " \n \n \n") | ||
|
||
(>&2 echo ${PROGDIRESC}) | ||
(>&2 ls ${PROGDIRESC}) | ||
|
||
(>&2 echo " \n \n \n") | ||
|
||
(>&2 echo ${APPBINARY}) | ||
(>&2 ls ${APPBINARY}) | ||
|
||
(>&2 echo " \n \n \n") | ||
|
||
(>&2 echo "ERROR: The application directory is empty after installation.") | ||
(>&2 echo "ERROR: If you experience problems please re-install the software and create an issue on https://github.com/mjoppich/bioGUI.") | ||
(>&2 echo "ERROR: For creating the issue, please upload the log.txt file of your installation attempt.") | ||
|
||
(>&2 echo " \n \n \n") | ||
|
||
else | ||
|
||
echo "${PROG} has been installed into ${APPBINARYESC}" | ||
echo "Binary location ${APPBINARY}" | ||
|
||
fi | ||
|
||
|
||
if [ $# -eq 5 ]; then | ||
|
||
IP=$4 | ||
PORT=$5 | ||
|
||
echo "Sending Template to $IP at $PORT" | ||
|
||
NCCMD="" | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
NCCMD="nc -c $IP $PORT" | ||
else | ||
NCCMD="nc -q 0 $IP $PORT" | ||
fi | ||
|
||
|
||
$NCCMD <<EOF | ||
|
||
<template description="Mount Drive (WSL)" title="Mount Drive"> | ||
|
||
<window width="500" height="1000" title="Mount Drive"> | ||
|
||
<vgroup> | ||
|
||
|
||
<group title="Mount Options"> | ||
|
||
|
||
<label>Which Window Drive do you want to make accessible (mount)?</label><input id="mntr_drv"></input> | ||
<label>WSL User/sudo Password</label><input id="mntr_pw" type="password"></input> | ||
|
||
<action program="assembly" hint="Click Here to mount the drive">Mount</action> | ||
</group> | ||
|
||
|
||
<group title="General Options"> | ||
<label>Run in WSL on Windows?</label><checkbox id="WSLsel" value="true" selectonwindows="true">Run in WSL?</checkbox> | ||
</group> | ||
|
||
<streambox linebreaks="TRUE" id="output1"> | ||
<stream id="outputstream1">OS1</stream> | ||
<stream id="outputstream2">OS2</stream> | ||
</streambox> | ||
|
||
|
||
</vgroup> | ||
|
||
</window> | ||
|
||
|
||
|
||
<execution> | ||
<const id="bindir">${APPBINARYDIR}/</const> | ||
|
||
|
||
<add id="args"> | ||
<const>${APPBINARYDIR}/mntdrv.sh</const> | ||
<value from="\${mntr_drv}"/> | ||
<value from="\${mntr_pw}"/> | ||
</add> | ||
|
||
<execute program="assembly" param="bash \${args}" location="/usr/bin/" exec="env" wsl="WSLsel"> | ||
<output type="COUT" color="green" to="outputstream1" /> | ||
<output type="CERR" color="red" to="outputstream2" /> | ||
</execute> | ||
|
||
|
||
</execution> | ||
</template> | ||
|
||
|
||
EOF | ||
|
||
fi |