Skip to content

Commit

Permalink
Merge pull request #131 from yana-safonova/testing
Browse files Browse the repository at this point in the history
Testing
  • Loading branch information
eodus authored Jul 5, 2017
2 parents 520b28c + d0f7b5d commit 65226cc
Show file tree
Hide file tree
Showing 1,169 changed files with 20,397 additions and 76,738 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ igrec_test
dsf_test
divan_test
barigrec_test
igquast_test*
.idea
src/.idea/
build/
Expand All @@ -15,8 +16,14 @@ cmake_install.cmake
install_manifest.txt
CTestTestfile.cmake

# Built packages
packages

# object files and libs
*.o
*.la
*.a
*.so

# Clion
cmake-build-*/
134 changes: 134 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
project(igrec)
cmake_minimum_required(VERSION 2.8)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithAsserts" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)

add_subdirectory(configs)
add_subdirectory(src)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "default install path" FORCE)
endif()

# Expand tildas and convert to absolute path
FILE(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)

set(INSTALL_DIR "share/igrec")

install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/VERSION"
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE"
"${CMAKE_CURRENT_SOURCE_DIR}/README"
"${CMAKE_CURRENT_SOURCE_DIR}/GPLv2.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/init.py"
DESTINATION "${INSTALL_DIR}"
COMPONENT runtime)

install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/manual.html"
"${CMAKE_CURRENT_SOURCE_DIR}/diversity_analyzer_manual.html"
"${CMAKE_CURRENT_SOURCE_DIR}/dsf_manual.html"
"${CMAKE_CURRENT_SOURCE_DIR}/barcodedIgReC_manual.html"
"${CMAKE_CURRENT_SOURCE_DIR}/igquast_manual.html"
DESTINATION "${INSTALL_DIR}"
COMPONENT manual)

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/docs"
DESTINATION "${INSTALL_DIR}"
COMPONENT manual
PATTERN "*.pdf" EXCLUDE)

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test_dataset"
"${CMAKE_CURRENT_SOURCE_DIR}/data"
"${CMAKE_CURRENT_SOURCE_DIR}/pipeline_makefiles"
"${CMAKE_CURRENT_SOURCE_DIR}/configs"
DESTINATION "${INSTALL_DIR}"
COMPONENT runtime
PATTERN "*.template" EXCLUDE
PATTERN "CMakeLists.txt" EXCLUDE
PATTERN ".gitignore" EXCLUDE)

install(DIRECTORY "${CMAKE_BINARY_DIR}/bin"
DESTINATION "${INSTALL_DIR}/build/release"
COMPONENT runtime
USE_SOURCE_PERMISSIONS
PATTERN "test_*" EXCLUDE)

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/py"
DESTINATION "${INSTALL_DIR}"
COMPONENT runtime
USE_SOURCE_PERMISSIONS
PATTERN "*.pyc" EXCLUDE
PATTERN ".gitignore" EXCLUDE)

set(tools "igrec.py;mass_spectra_analyzer.py;dense_subgraph_finder.py;igquast.py;barcoded_igrec.py;diversity_analyzer.py;ig_simulator.py")
foreach(tool ${tools})
install(PROGRAMS ${tool}
DESTINATION "${INSTALL_DIR}"
COMPONENT runtime)
endforeach()

foreach(tool ${tools})
# Conctruct fake symlinks
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink "../share/igrec/${tool}" "${CMAKE_BINARY_DIR}/${tool}")
# ...and add them into the installation
# I know, I know, I definitely know how much dirty it is
# Unfortunately, cpack cannot trace symlinks automatically and cmake-install does not support smth like install(SYMLINK)
install(FILES "${CMAKE_BINARY_DIR}/${tool}"
DESTINATION "bin"
COMPONENT runtime)
endforeach()

# Disabled. We have already created symlinks manually above
# foreach(tool ${tools})
# install(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink \"${CMAKE_INSTALL_PREFIX}/${INSTALL_DIR}/${tool}\" \"${CMAKE_INSTALL_PREFIX}/bin/${tool}\")")
# endforeach()

set(CPACK_PACKAGE_NAME "igrec")
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
set(CPACK_GENERATOR "TGZ;ZIP;DEB;RPM")
set(CPACK_SOURCE_GENERATOR "")
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/packages") # TODO add an arg
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README")

FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION)
STRING(STRIP "${VERSION}" VERSION)
set(CPACK_PACKAGE_VERSION ${VERSION})
# Are they really necessary?
# SET(CPACK_PACKAGE_VERSION_MAJOR "3")
# SET(CPACK_PACKAGE_VERSION_MINOR "0")
# SET(CPACK_PACKAGE_VERSION_PATCH "0")

set(CPACK_DEBIAN_PACKAGE_DEPENDS "python")
# TODO Add seaborn somehow
# set(CPACK_DEBIAN_PACKAGE_SUGGESTS "python-matplotlib, python-biopython, python-numpy, python-scipy, python-pandas")

set(CPACK_PACKAGE_CONTACT "Alexander Shlemov <shlemovalex@gmail.com>")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://yana-safonova.github.io/ig_repertoire_constructor/")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Y-tools: tools for construction of full-length adaptive immune repertoires and immunoinformatics analysis")
# TODO: Add full description
set(CPACK_PACKAGE_DESCRIPTION "Y-tools: tools for construction of full-length adaptive immune repertoires and immunoinformatics analysis")

set(CPACK_PACKAGE_VENDOR "Center for Algorithmic Biotechnology, Saint Petersburg University, Russia")

# trace debug information during CPackDeb run
set(CPACK_DEBIAN_PACKAGE_DEBUG TRUE)

# RPM
# trace debug information during CPackRPM run
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
set(CPACK_RPM_PACKAGE_DEBUG TRUE)
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
set(CPACK_RPM_PACKAGE_REQUIRES ${CPACK_DEBIAN_PACKAGE_DEPENDS}) # TODO check
# set(CPACK_RPM_PACKAGE_SUGGESTS ${CPACK_DEBIAN_PACKAGE_SUGGESTS})
set(CPACK_RPM_PACKAGE_URL ${CPACK_DEBIAN_PACKAGE_HOMEPAGE})


set(CPACK_STRIP_FILES TRUE)
set(CPACK_PACKAGE_EXECUTABLES $tools)

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_MONOLITHIC_INSTALL TRUE)

# Package parameters should be set BEFORE include(CPack)
include(CPack)
5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

IgRepertoireConstructor: an algorithm for construction of antibody repertoire from NGS data and immunoproteogenomics analysis
Copyright (c) 2015 Saint-Petersburg State University

SPAdes is free software; you can redistribute it and/or modify
IgRepertoireConstructor is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, Version 2,
dated June 1991, as published by the Free Software Foundation.

SPAdes is distributed in the hope that it will be useful, but
IgRepertoireConstructor is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Expand Down
74 changes: 56 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,67 @@
all:
# Default build type
build_type?="RelWithAsserts"

# Default install prefix
prefix?="/usr/local"

.PHONY: clean clean_tests cmake all pack

all: igrec

cpcfg:
mkdir -p build/tmp
cd build/tmp && cmake ../../configs -DCMAKE_OVERWRITE_CONFIGS=true
rm -r build/tmp

cmake:
mkdir -p build/release
cd build/release && cmake ../.. -DCMAKE_BUILD_TYPE="${build_type}" -DCMAKE_INSTALL_PREFIX=${prefix} -Wno-dev

igrec: cmake
$(MAKE) -C build/release all

rig:
$(MAKE) -C build/release/ig_repertoire_constructor ig_repertoire_constructor
rpm: igrec
cd build/release && cpack -G RPM

dig:
$(MAKE) -C build/debug/ig_repertoire_constructor ig_repertoire_constructor
deb: igrec
cd build/release && cpack -G DEB

dsf:
$(MAKE) -C build/release/dense_sgraph_finder dense_sgraph_finder
tgz: igrec
cd build/release && cpack -G TGZ

metis:
$(MAKE) -C build/release/ext_tools/metis-5.1.0/ metis
install: igrec
cd build/release && cmake -P cmake_install.cmake

check: all
dsf: cmake
$(MAKE) -C build/release dense_sgraph_finder

check: cmake
$(MAKE) -C build/release check

check_essential: all
$(MAKE) -C build/release check_essential
memcheck: cmake
$(MAKE) -C build/release memcheck

rnd: cmake
$(MAKE) -C build/release rnd

vjf: cmake
$(MAKE) -C build/release vj_finder

cdr: cmake
$(MAKE) -C build/release cdr_labeler

umi: cmake
$(MAKE) -C build/release umi_correction_stats umi_graph umi_naive umi_to_fastq

vjf:
$(MAKE) -C build/release/vj_finder
igs: cmake
$(MAKE) -C build/release ig_simulator

cdr:
$(MAKE) -C build/release/cdr_labeler
clean:
-rm -r build

umi:
$(MAKE) -C build/release/umi_experiments
clean_tests:
-rm *.pyc
-rm -r igrec_test
-rm -r ms_analyzer_test
-rm -r ig_simulator_test
-rm *~
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0
3.1.0
4 changes: 2 additions & 2 deletions barcodedIgReC_manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h3>2.1. Verifying your installation</h3>
<pre class="code">
<code>
Thank you for using BarcodedIgReC!
Log was written to barigrec_test/igrc.log
Log was written to barigrec_test/igrec.log
</code>
</pre>

Expand Down Expand Up @@ -277,7 +277,7 @@ <h3>3.4. Output files</h3>
</li>
</ul><br>

<li><b>igrc.log</b> &mdash; full log of BarcodedIgReC run.</li>
<li><b>igrec.log</b> &mdash; full log of BarcodedIgReC run.</li>
</ul>
<br>

Expand Down
14 changes: 8 additions & 6 deletions barcoded_igrec.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
import igrec

home_directory = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
spades_src = os.path.join(home_directory, "src/python_pipeline/")
pipeline_dir = os.path.join(home_directory, "py/pipeline/")
py_src = os.path.join(home_directory, "py")

sys.path.append(spades_src)
sys.path.append(py_src)
sys.path.append(pipeline_dir)
import support


Expand All @@ -36,7 +38,7 @@ def __init__(self, option_strings, dest, nargs=None, **kwargs):
super(ActionTest, self).__init__(option_strings, dest, nargs=0, **kwargs)

def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, "single_reads", "test_dataset/barcodedIgReC_test.fasta")
setattr(namespace, "single_reads", os.path.join(home_directory, "test_dataset/barcodedIgReC_test.fasta"))
setattr(namespace, "output", "barigrec_test")
setattr(namespace, "loci", "all")
setattr(namespace, "no_compilation", True)
Expand Down Expand Up @@ -303,7 +305,7 @@ def PrintOutputFiles(params, log):
def SupportInfo(log):
log.info("\nIn case you have troubles running BarcodedIgReC, "
"you can write to igtools_support@googlegroups.com.")
log.info("Please provide us with igrc.log file from the output directory.")
log.info("Please provide us with igrec.log file from the output directory.")


def main():
Expand All @@ -319,9 +321,9 @@ def main():
# We need freshly compiled version to get actual build info
if not params.no_compilation:
support.sys_call("make -C " + os.path.join(os.path.dirname(final_dir), "compilation"), log)
from src.build_info.build_info import BuildInfo
print "===================Build info==================="
BuildInfo().Log(log)
from py import build_info
build_info.Log(log)
print "================================================"
support.sys_call("make -C " + final_dir, log)
PrintOutputFiles(params, log)
Expand Down
4 changes: 0 additions & 4 deletions cleanup

This file was deleted.

24 changes: 24 additions & 0 deletions configs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
project(configs)
cmake_minimum_required(VERSION 2.8)

function(cpcfg overwrite)
if (${overwrite})
MESSAGE("Configs will be overwritten")
endif()
file(GLOB config_templates "*/*.template")
foreach(config_template ${config_templates})
# Remove extention
STRING(REGEX REPLACE "\\.template$" "" config ${config_template})
if(NOT EXISTS "${config}" OR ${overwrite})
configure_file("${config_template}"
"${config}"
@ONLY)
endif()
endforeach()
endfunction(cpcfg)

if (NOT CMAKE_OVERWRITE_CONFIGS)
SET(CMAKE_OVERWRITE_CONFIGS "FALSE")
endif()

cpcfg(${CMAKE_OVERWRITE_CONFIGS})
Loading

0 comments on commit 65226cc

Please sign in to comment.