Skip to content

Commit

Permalink
Corrects CMakeLists.txt for location of pthreads library. Also update…
Browse files Browse the repository at this point in the history
…s __main__.py, to opt-out of FMindexing rather than opt-in using --not-ref.

Former-commit-id: 9519fa7
  • Loading branch information
samhorsfield96 committed Jan 26, 2021
1 parent b7c9179 commit cb8dca9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
28 changes: 18 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,34 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fconcepts -march=native")

set(CMAKE_VERBOSE_MAKEFILE ON)

find_package(OpenMP)
find_library(pthread REQUIRED)
find_library(z REQUIRED)
find_library(bifrost REQUIRED)
# find pthreads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# find pybind and create python module
find_package(pybind11 REQUIRED)
pybind11_add_module(ggCaller_cpp src/call_ORFs.cpp src/ggCaller_bindings.cpp src/indexing.cpp src/match_string.cpp src/traversal.cpp src/unitigDict.cpp)

# check for conda environment
IF( DEFINED ENV{CONDA_PREFIX} )
# set conda directory
SET(CONDA_DIR "$ENV{CONDA_PREFIX}")
# find Seqan3 packages
find_path(SEQAN3_CLONE_DIR name bin PATHS ${CONDA_DIR} NO_DEFAULT_PATH)
find_path(SEQAN3_INCLUDE_DIR name seqan PATHS "${SEQAN3_CLONE_DIR}/include" NO_DEFAULT_PATH)
find_path(SEQAN3_SUBMODULES_DIR name submodules PATHS "${SEQAN3_INCLUDE_DIR}/seqan3" NO_DEFAULT_PATH)
find_package(SeqAn3 REQUIRED HINT "${CONDA_PREFIX}/share/cmake/seqan3")
# link bifrost, zlib, seqan and pthreads
target_link_libraries(ggCaller_cpp PRIVATE seqan3::seqan3 ${CONDA_DIR}/lib/libbifrost.so ${CONDA_DIR}/lib/libz.so ${CONDA_DIR}/lib/libomp.so Threads::Threads)
ELSE()
# find packages if conda not used
find_package(SeqAn3 REQUIRED)
ENDIF()

target_link_libraries(ggCaller_cpp PRIVATE seqan3::seqan3 pthread z bifrost)

if(OpenMP_CXX_FOUND)
find_library(z REQUIRED)
find_library(bifrost REQUIRED)
find_package(OpenMP)
target_link_libraries(ggCaller_cpp PRIVATE seqan3::seqan3 bifrost z pthread)
# link OpenMP if found
if(OpenMP_CXX_FOUND)
target_link_libraries(ggCaller_cpp PRIVATE OpenMP::OpenMP_CXX)
endif()
endif()
ENDIF()
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ To run ggCaller using an existing Bifrost GFA file and Colours file, specify BOT
- ```--graph <graph.gfa>``` Input GFA
- ```--colours <colours.bfg_colors>``` Input colours file

To enable filtering of artificially generated sequences via FMindexing (if sequences used to generate the GFA and Colours files were exclusively assembled genomes), additionally specify:
- ```--is-ref```
To disable filtering of artificially generated sequences via FMindexing (if sequences used to generate the GFA and Colours files are not exclusively assembled genomes), additionally specify:
- ```--not-ref```

Note: Ensure the sequences used to build the graph are in the same directories as when the graph was built.

Expand Down Expand Up @@ -92,11 +92,11 @@ argument. Bifrost uses kmer coverage filtering for read files to remove read err

- Use existing graph which was built using assembled genomes only.

```ggcaller --graph graph.gfa --colours colours.bfg_colours --is-ref --out calls.fasta```
```ggcaller --graph graph.gfa --colours colours.bfg_colours --out calls.fasta```

- Use existing graph which was built using reads or assembled genomes and reads.

```ggcaller --graph graph.gfa --colours colours.bfg_colours --out calls.fasta```
```ggcaller --graph graph.gfa --colours colours.bfg_colours --not-ref --out calls.fasta```

Test data is available in the ```data``` directory.

Expand Down
2 changes: 1 addition & 1 deletion ggCaller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

'''ggCaller: a gene caller for Bifrost graphs'''

__version__ = '1.1.0'
__version__ = '1.1.1'
11 changes: 6 additions & 5 deletions ggCaller/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ def get_options():
IO.add_argument('--colours',
default=None,
help='Bifrost colours file generated by Bifrost build. ')
IO.add_argument('--is-ref',
action="store_true",
default=False,
help='If using existing graph, was graph built with references or reads. ')
IO.add_argument('--not-ref',
action="store_false",
default=True,
help='If using existing graph, was not graph built exclusively with assembled genomes. '
'[Default = False] ')
IO.add_argument('--refs',
default=None,
help='List of reference genomes (one file path per line). ')
Expand Down Expand Up @@ -73,7 +74,7 @@ def main():
# parse command line arguments
graph_file = options.graph
colours_file = options.colours
is_ref = bool(options.is_ref)
is_ref = bool(options.not_ref)
refs_file = options.refs
reads_file = options.reads
codons = options.codons
Expand Down

0 comments on commit cb8dca9

Please sign in to comment.