Skip to content

Commit

Permalink
python virtual environment; remove natural product
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarreror committed Nov 23, 2020
1 parent fc6cad9 commit f5d6136
Show file tree
Hide file tree
Showing 65 changed files with 161 additions and 23 deletions.
26 changes: 24 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
# Python Interpreter #
# python environment #
######################
desktopApp/app/src/python/*
desktopApp/env/*

# electron #
######################
desktopApp/electron-*/*

# desktop application node_modules #
####################################
desktopApp/node_modules/*

# desktopApp jobs #
###################
desktopApp/app/jobs/*


# web application node_modules #
################################
webApp/node_modules/*


# webApp jobs #
###############
webApp/src/public/results/*

# releases #
############
releases/*

# __pycache__ #
###############
*/__pycache__/*
7 changes: 6 additions & 1 deletion desktopApp/TurboPutative.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ SET SRC_HOME=%~dp0
SET SRC_HOME=%SRC_HOME:"=%
SET SRC_HOME=%SRC_HOME:~0,-1%

:: CHECK PYTHON ENVIRONMENT
IF NOT EXIST "%SRC_HOME%\env" (
CMD /C " "%SRC_HOME%\install\install_win64.bat" "
)

:: ELECTRON DIRECTORY
SET SRC_ELECTRON=%SRC_HOME%\node_modules\electron\dist\electron.exe
SET SRC_ELECTRON=%SRC_HOME%\electron-v11.0.1-win32-x64\electron.exe

:: APP DIRECTORY
SET SRC_APP=%SRC_HOME%\app
Expand Down
8 changes: 4 additions & 4 deletions desktopApp/app/sections/execute/tagger.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ <h3 style="color:white; font-size: 1.5em; font-weight: 300; font-family: Arial;"
<input class="cbTag" type="checkbox" id="drug" name="drug" value="true">
<span class="checkmark"></span>
</label>

<!--
<label class="cbContainer">Natural Product
<input class="cbTag" type="checkbox" id="naturalProduct" name="naturalProduct" value="true">
<span class="checkmark"></span>
</label>
<!--
<label class="cbContainer">Microbial Compound
<input class="cbTag" type="checkbox" id="microbialCompound" name="microbialCompound" value="true">
<span class="checkmark"></span>
Expand Down Expand Up @@ -379,8 +379,8 @@ <h3 style="color:white; font-size: 1.5em; font-weight: 300; font-family: Arial;"
// iniContent += "###";
iniContent += "Halogenated = " + document.getElementById('halogenated').checked;
iniContent += "###";
iniContent += "NaturalProduct = " + document.getElementById('naturalProduct').checked;
iniContent += "###";
// iniContent += "NaturalProduct = " + document.getElementById('naturalProduct').checked;
// iniContent += "###";
iniContent += "Peptide = " + document.getElementById('peptide').checked;
iniContent += "###";

Expand Down
3 changes: 2 additions & 1 deletion desktopApp/app/src/integrator.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ SET SRC_HOME=%SRC_HOME:"=%
SET SRC_HOME=%SRC_HOME:~0, -1%

:: PYTHON EXE
SET PYTHON="%SRC_HOME%\python\python.3.6.7\tools\python.exe"
REM SET PYTHON="%SRC_HOME%\python\python.3.6.7\tools\python.exe"
SET PYTHON=%SRC_HOME%\..\..\env\Scripts\python.exe

:: INPUT VARIABLES
SET WORKFLOW=%~1
Expand Down
4 changes: 2 additions & 2 deletions desktopApp/app/src/pyModules/Tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ def main(args):
if re.search('(?i)true', config_param['TagSelection']['Drug']):
df = drugTagger(df, n_cores)

if re.search('(?i)true', config_param['TagSelection']['NaturalProduct']):
df = npTagger(df, n_cores)
# if re.search('(?i)true', config_param['TagSelection']['NaturalProduct']):
# df = npTagger(df, n_cores)

if re.search('(?i)true', config_param['TagSelection']['Halogenated']):
df = halogenatedTagger(df, n_cores)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
111 changes: 111 additions & 0 deletions desktopApp/install/install_win64.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
@ECHO OFF

ECHO **
ECHO ** CREATION OF PYTHON VIRTUAL ENVIRONMENT
ECHO **

:: SET WORKING DIRECTORY
SET SRC_HOME="%~dp0"
SET SRC_HOME=%SRC_HOME:"=%
SET SRC_HOME=%SRC_HOME:~0,-1%

:: SET env FOLDER
SET SRC_ENV=%SRC_HOME%\..\env

SETLOCAL EnableDelayedExpansion

:: CHECK IF env FOLDER EXISTS
:CHECK_ENV
IF EXIST "%SRC_ENV%" (

GOTO ENV_CREATED

) ELSE (

ECHO ** Check if Python is installed
SET PYTHON=py

WHERE !PYTHON! > NUL 2>&1

IF ERRORLEVEL 1 (
ECHO ** !PYTHON! was not found in PATH...
GOTO USER_PYTHON
) ELSE (
GOTO CREATE_ENV
)

)


:: USER PYTHON INTRODUCTION
:USER_PYTHON

SET /P PYTHON="** Enter path to python.exe or 'q' to exit installation: "
IF %PYTHON% == q GOTO END
GOTO ASSERT_PYTHON


:: CHECK IF PYTHON IS INSTALLED
:ASSERT_PYTHON

IF EXIST %PYTHON% (

GOTO CREATE_ENV

) ELSE (

ECHO ** Python could not be found: %PYTHON%
GOTO USER_PYTHON

)


:: CREATE VIRTUAL ENVIRONMENT
:CREATE_ENV
ECHO ** Check Python version

FOR /F "useback delims=. tokens=1,2" %%I IN (`%PYTHON% --version`) DO (

IF NOT "%%I" == "Python 3" (
ECHO ** ERROR: Using %%I instead of Python 3
GOTO USER_PYTHON
)

IF NOT %%J GEQ 6 (
ECHO ** ERROR: Using %%I.%%J instead of Python 3.6 or greater
GOTO USER_PYTHON
)

)

ECHO ** Creating virtual environment
CMD /C " "%PYTHON%" -m venv "%SRC_ENV%" "

IF ERRORLEVEL 1 GOTO END

SET SRC_SCRIPTS=%SRC_ENV%\Scripts

REM UPGRADE PIP
ECHO ** Upgrading pip
CMD /C " "%SRC_SCRIPTS%\python.exe" -m pip install --upgrade pip "

IF ERRORLEVEL 1 GOTO END

REM INSTALAR NUMPY y PANDAS
ECHO ** Installing modules
CMD /C " "%SRC_SCRIPTS%\pip.exe" install numpy pandas xlrd xlwt "

IF ERRORLEVEL 1 GOTO END

GOTO ENV_CREATED



:ENV_CREATED
ECHO ** Virtual environment created
GOTO END


:END
ECHO ** Installation process finished. Press ENTER to close...
PAUSE
4 changes: 2 additions & 2 deletions tools/Tagger/Tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ def main(args):
if re.search('(?i)true', config_param['TagSelection']['Drug']):
df = drugTagger(df, n_cores)

if re.search('(?i)true', config_param['TagSelection']['NaturalProduct']):
df = npTagger(df, n_cores)
# if re.search('(?i)true', config_param['TagSelection']['NaturalProduct']):
# df = npTagger(df, n_cores)

if re.search('(?i)true', config_param['TagSelection']['Halogenated']):
df = halogenatedTagger(df, n_cores)
Expand Down
4 changes: 0 additions & 4 deletions tools/Tagger/configTagger.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ Food = True

Drug = True

NaturalProduct = True

# MicrobialCompound = True

Halogenated = True

Peptide = True
Expand Down
8 changes: 5 additions & 3 deletions webApp/src/public/assets/js/iniStringMaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function iniTagger() {
TaggerJSON['Drug'] = "";
// TaggerJSON['MicrobialCompound'] = "";
TaggerJSON['Halogenated'] = "";
TaggerJSON['NaturalProduct'] = "";
// TaggerJSON['NaturalProduct'] = "";
TaggerJSON['Peptide'] = "";

if(document.getElementById("Food").checked == true) {
Expand All @@ -47,9 +47,11 @@ function iniTagger() {
TaggerJSON['Halogenated'] = "True";
}

/*
if(document.getElementById("NaturalProduct").checked == true) {
TaggerJSON['NaturalProduct'] = "True";
}
*/

if(document.getElementById("Peptide").checked == true) {
TaggerJSON['Peptide'] = "True";
Expand All @@ -66,8 +68,8 @@ function iniTagger() {
// iniContent += "###";
iniContent += "Halogenated = " + TaggerJSON['Halogenated'];
iniContent += "###";
iniContent += "NaturalProduct = " + TaggerJSON['NaturalProduct'];
iniContent += "###";
// iniContent += "NaturalProduct = " + TaggerJSON['NaturalProduct'];
// iniContent += "###";
iniContent += "Peptide = " + TaggerJSON['Peptide'];
iniContent += "###";

Expand Down
5 changes: 3 additions & 2 deletions webApp/src/public/turboputative.html
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,12 @@ <h3>Tagger settings</h3>
<input type="checkbox" id="Drug" name="Drug" value="True">
<label for="Drug"> Drug</label>
</div>
<!--
<div class="check">
<input type="checkbox" id="NaturalProduct" name="NaturalProduct" value="True">
<label for="NaturalProduct"> Natural Product</label>
</div>
<!--
<div class="check">
<input type="checkbox" id="MicrobialCompound" name="MicrobialCompound" value="True">
<label for="MicrobialCompound"> Microbial Compound</label><br>
Expand Down Expand Up @@ -641,7 +642,7 @@ <h3>TableMerger settings</h3>
if (document.getElementById("workflow").value.search('1') != -1 &&
!document.getElementById('Food').checked &&
!document.getElementById('Drug').checked &&
!document.getElementById('NaturalProduct').checked &&
/*!document.getElementById('NaturalProduct').checked &&*/
!document.getElementById('Halogenated').checked &&
!document.getElementById('Peptide').checked /*&&
!document.getElementById('MicrobialCompound').checked*/) {
Expand Down
4 changes: 2 additions & 2 deletions webApp/src/tools/pyModules/Tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ def main(args):
if re.search('(?i)true', config_param['TagSelection']['Drug']):
df = drugTagger(df, n_cores)

if re.search('(?i)true', config_param['TagSelection']['NaturalProduct']):
df = npTagger(df, n_cores)
# if re.search('(?i)true', config_param['TagSelection']['NaturalProduct']):
# df = npTagger(df, n_cores)

if re.search('(?i)true', config_param['TagSelection']['Halogenated']):
df = halogenatedTagger(df, n_cores)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit f5d6136

Please sign in to comment.