Skip to content

Commit

Permalink
fix Windows, Canu, graphmap, zero length arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mjoppich committed Jul 16, 2018
1 parent f8ab25d commit 709f2e8
Show file tree
Hide file tree
Showing 15 changed files with 434 additions and 57 deletions.
63 changes: 45 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,22 @@ endif()
if (WIN32)

message(STATUS ">>> WIN32")
set(ENV{LUA_DIR} "D:/libraries/lua-5.3.3/;C:/lua53/")
message(STATUS "IN MINGW")
set(Qt5_DIR "C:/Qt/5.8/mingw53_32;C:/Qt/5.8/mingw53_32")
set(ENV{OPENSSL_ROOT_DIR} "C:/OpenSSL-Win32/lib/")
set(ENV{LUA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/extlib/lua")

if (MINGW)
message(STATUS "IN MINGW")
else()
set(MINGW 1)
endif()

if (MINGW)
message(STATUS "IN MINGW")
endif()

set(Qt5_DIR "C:/Qt/5.11.1/mingw53_32")
set(ENV{OPENSSL_ROOT_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/extlib/openssl/")
set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extlib/openssl/")
message(STATUS $ENV{OPENSSL_ROOT_DIR})

endif()

Expand All @@ -104,7 +116,7 @@ if (UNIX AND NOT APPLE)
set(Qt5_DIR "")
LIST(APPEND Qt5_DIR "~/Qt/5.8/gcc_64/" "~/Qt/5.7/gcc_64/" "/usr/local/qt/5.7/gcc_64/" "/home/mjoppich/qt/qt-everywhere-src-5.10.0/qtbase" "/opt/Qt5.10.0/5.10.0/gcc_64/")

set(ENV{OPENSSL_ROOT_DIR} "/home/users/joppich/libs/openssl/lib/")
set(ENV{OPENSSL_ROOT_DIR} "/home/users/joppich/libs/openssl/")
set(ENV{LUA_DIR} "/home/users/joppich/libs/lua/")

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
Expand Down Expand Up @@ -154,7 +166,8 @@ message(STATUS " *** Lua lib: ${LUA_LIBRARY}")
message(STATUS " *** Lua DLL dir: ${LUA_DLL_DIR}")

# Search OpenSSL
find_package(OpenSSL REQUIRED)
set(OPENSSL_USE_STATIC_LIBS True)
find_package(OpenSSL)

if( OPENSSL_FOUND )

Expand All @@ -165,8 +178,13 @@ if( OPENSSL_FOUND )
message(STATUS "SSL LIBRARY ${OPENSSL_SSL_LIBRARY}")
message(STATUS "CRYPTO LIBRARY ${OPENSSL_CRYPTO_LIBRARY}")

get_filename_component(OPENSSL_DIR ${OPENSSL_SSL_LIBRARY} DIRECTORY)

message(STATUS "OpenSSL DIR ${OPENSSL_DIR}")

else()
# Error; with REQUIRED, pkg_search_module() will throw an error by it's own
message( FATAL_ERROR "OPENSSL NOT FOUND" )
endif()

file(GLOB parsinglib_H
Expand Down Expand Up @@ -227,25 +245,33 @@ endif()

# source_group("UI Files" FILES ${UI_FILES})

set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")


add_executable(${PROJECT_NAME} ${OS_BUNDLE} # Expands to WIN32 or MACOS_BUNDLE depending on OS
${bioGUI_H} ${bioGUIapp_H} ${bioGUI_SRC} ${parsinglib_SRC} ${parsinglib_H} ${parsinglib_nodes_H} ${META_FILES_TO_INCLUDE} ${RESOURCE_FILES} ${DUKTAPE}
${bioGUI_H} ${bioGUIapp_H} ${bioGUI_SRC} ${parsinglib_SRC} ${parsinglib_H} ${parsinglib_nodes_H} ${META_FILES_TO_INCLUDE} ${RESOURCE_FILES}
${DUKTAPE}
)


ADD_LIBRARY(mylibeay STATIC IMPORTED)
SET_TARGET_PROPERTIES(mylibeay PROPERTIES IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}")

ADD_LIBRARY(myssleay STATIC IMPORTED)
SET_TARGET_PROPERTIES(myssleay PROPERTIES IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}")

#ADD_LIBRARY(lualib STATIC IMPORTED IMPORTED_LOCATION "${LUA_LIBRARY}")
#SET_TARGET_PROPERTIES(lualib PROPERTIES IMPORTED_LOCATION "${LUA_LIBRARY}")

ADD_LIBRARY(lualib STATIC IMPORTED)
SET_TARGET_PROPERTIES(lualib PROPERTIES IMPORTED_LOCATION "${LUA_LIBRARY}")
SET_TARGET_PROPERTIES(lualib PROPERTIES IMPORTED_LOCATION ${LUA_LIBRARY})

target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} mylibeay myssleay m ${CMAKE_DL_LIBS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} lualib)

TARGET_LINK_LIBRARIES(${PROJECT_NAME} mylibeay myssleay lualib ${CMAKE_DL_LIBS})

qt5_use_modules(${PROJECT_NAME} Core Gui Widgets Network Xml XmlPatterns)

install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX} )

message(STATUS "files to copy ${META_FILES_TO_INCLUDE}")
Expand All @@ -262,16 +288,17 @@ install(FILES ${biogui_files} DESTINATION ${CMAKE_INSTALL_PREFIX})

if (NOT APPLE)

file(GLOB biogui_ini_files
"config.ini"
)
file(GLOB biogui_ini_files
"config.ini"
)

install(FILES ${biogui_ini_files} DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${biogui_ini_files} DESTINATION ${CMAKE_INSTALL_PREFIX})

file(GLOB biogui_templates
"${CMAKE_CURRENT_SOURCE_DIR}/templates/WSL_install.gui"
)
install(FILES ${biogui_templates} DESTINATION ${CMAKE_INSTALL_PREFIX}/templates)
file(GLOB biogui_templates
"${CMAKE_CURRENT_SOURCE_DIR}/templates/WSL_install.gui"
)
install(FILES ${biogui_templates} DESTINATION ${CMAKE_INSTALL_PREFIX}/templates)
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/install_templates)

add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR})
add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/templates)
Expand Down
5 changes: 4 additions & 1 deletion config.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[server]
location=https://services.bio.ifi.lmu.de:1047/biogui/
location=https://services.bio.ifi.lmu.de:1047/biogui/

[bash]
location=C:\\WINDOWS\\Sysnative\\wsl.exe
8 changes: 5 additions & 3 deletions install_templates/install_albacore.igui
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ if [ "$4" != "0" ]; then

IP=$4
PORT=$5

echo "Sending Template to $IP at $PORT"

nc $IP $PORT << EOF
nc -q 0 $IP $PORT <<EOF

<template description="albacore basecaller aligner" title="albacore (python)">
<window title="albacore basecaller">
Expand Down Expand Up @@ -123,10 +125,10 @@ nc $IP $PORT << EOF
<const>-f</const>
<value from="\${albacore_flowcell}"/>
<const>-k</const>
<value from="\${albacore_flowcell}"/>
<value from="\${albacore_kit}"/>
<else>
<const>-f</const>
<value from="\${albacore_kit}"/>
<value from="\${albacore_flowcell_man}"/>
<const>-k</const>
<value from="\${albacore_kit_man}"/>
</else>
Expand Down
175 changes: 175 additions & 0 deletions install_templates/install_canu.igui
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#! Install canu (github)

echo "This tool will not compile in folders where the absolute path contains spaces!"
echo "Dependencies: None"

if [ ! "$2" = "" ]; then
echo "Installing dependencies"
#echo $2 | sudo -S apt-get update
#echo $2 | sudo -S apt-get -y install csh

else
echo "No sudo password, not installing dependencies"
fi



## set all variables
PROG=canu
PROGDIR=$1



if [ -z "${PROGDIR}" ]; then
PROGDIR=~/bioGUI/progs/
fi


PROGDIRESC=$(echo $PROGDIR | sed 's/ /\\ /g')
APPBINARYDIR=${PROGDIRESC}/${PROG}/Linux-amd64/bin/

if [ -d "$PROGDIR/$PROG" ]; then
echo "Removing Folder $PROGDIR/$PROG"
#rm -rf $PROGDIR/$PROG
fi

## create progdir
mkdir -p "$PROGDIR/$PROG"

echo "Fetching $PROG - this may take a while."

#download and unzip
#git clone https://github.com/marbl/canu.git $PROGDIR/$PROG

cd "$PROGDIR/$PROG/src"

make -j 2


if [ $# -gt 2 ]; then
if [ "$3" = "1" ]; then

if ! grep -q "$APPBINARYDIR" ~/.bashrc; then
echo "export PATH=\"$APPBINARYDIR:\$PATH\" " >> ~/.bashrc;
fi
fi
fi



if [ $# -eq 5 ]; then

IP=$4
PORT=$5

echo "Sending Template to $IP at $PORT"

nc -q 0 $IP $PORT <<EOF

<!--<?xml version="1.0" encoding="UTF-8")>-->

<template description="canu ($PROG)" title="canu">



<window width="500" height="1000" title="canu">

<vgroup>


<group title="Assembly Options">



<label>Input Reads (PacBio)</label> <filedialog id="canu_pacbio" output="false">Select Input Reads (PacBio)</filedialog>
<label>Input Reads (Oxford)</label> <filedialog id="canu_oxford" output="false">Select Input Reads (Oxford)</filedialog>

<label>Assembly Output</label> <filedialog id="canu_tmp_folder" output="true" foler="true">Select Assembly Folder</filedialog>
<label>Assembly Prefix</label><input id="canu_assembly_prefix"></input>

<label>Expected Genome Size</label><input id="canu_genome_size" type="float"></input>
<label>Read Error Rate</label><input id="canu_error_rate" min="0.0" max="1.0" type="float"></input>

<label>Additional Options</label><input id="canu_options"></input>


<action program="canu" hint="click here to run program">Run canu</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 id="output1">
<stream id="outputstream1">OS1</stream>
<stream id="outputstream2">OS2</stream>
</streambox>


</vgroup>

</window>



<execution>

<const id="bindir">${APPBINARYDIR}/</const>


<relocate id="canu_pacbio_rel" from="\${canu_pacbio}" wsl="\${WSLsel}"/>
<relocate id="canu_oxford_rel" from="\${canu_oxford}" wsl="\${WSLsel}"/>
<relocate id="canu_tmp_folder_rel" from="\${canu_tmp_folder}" wsl="\${WSLsel}"/>

<add id="args">

<value from="\${canu_options}"/>

<if comp="IS_SET" value1="\${canu_assembly_prefix}">
<const>-p</const>
<value from="\${canu_assembly_prefix}"/>
</if>

<if comp="IS_SET" value1="\${canu_tmp_folder_rel}">
<const>-d</const>
<value from="\${canu_tmp_folder_rel}"/>
</if>

<if comp="IS_SET" value1="\${canu_error_rate}">
<const>errorRate=</const>
<value from="\${canu_error_rate}"/>
</if>

<if comp="IS_SET" value1="\${canu_genome_size}">
<const>genomeSize=</const>
<value from="\${canu_genome_size}"/>
<const>m</const>
</if>

<if comp="IS_SET" value1="\${canu_pacbio_rel}">
<const>-pacbio-raw</const>
<value from="\${canu_pacbio_rel}"/>
</if>

<if comp="IS_SET" value1="\${canu_oxford}">
<const>-oxford-raw</const>
<value from="\${canu_oxford}"/>
</if>

</add>

<execute program="canu" param="\${args}" location="\${bindir}" exec="canu" wsl="WSLsel">
<output type="COUT" color="green" to="outputstream1" />
<output type="CERR" color="red" to="outputstream2" />
</execute>



</execution>
</template>


EOF

fi

0 comments on commit 709f2e8

Please sign in to comment.