Skip to content

Commit

Permalink
remove leidenalg link
Browse files Browse the repository at this point in the history
  • Loading branch information
theAeon committed Aug 30, 2023
1 parent 9992633 commit 4ae0d87
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 95 deletions.
15 changes: 1 addition & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,15 @@ list(TRANSFORM srclist PREPEND "${PROJECT_SOURCE_DIR}/src/")
add_library(rliger2 SHARED ${srclist})
set_target_properties(rliger2 PROPERTIES PREFIX "")
if(APPLE)
set_target_properties(rliger2 PROPERTIES SUFFIX "so")
set_target_properties(rliger2 PROPERTIES SUFFIX ".so")
endif()
target_include_directories(rliger2
PRIVATE "${PROJECT_SOURCE_DIR}/src/")

CPMAddPackage(NAME leidenAlg GITHUB_REPOSITORY kharchenkolab/leidenAlg GIT_TAG 1.1.0 DOWNLOAD_ONLY True)
target_include_directories(rliger2 PRIVATE "${CMAKE_SOURCE_DIR}/src/_deps/leidenalg-src/src/leidenalg/include")
target_include_directories(rliger2 PRIVATE "${CMAKE_SOURCE_DIR}/src/_deps/leidenalg-src/src/rigraph/include")
find_r_module(Rcpp)
find_r_module(RcppArmadillo)
find_r_module(RcppProgress)
find_r_module(RcppEigen)
find_r_module(leidenAlg)

if(R_INCLUDE_DIR)
target_include_directories(rliger2 PRIVATE "${R_INCLUDE_DIR}")
Expand Down Expand Up @@ -61,15 +57,6 @@ if(R_RCPPEIGEN)
else()
message(FATAL_ERROR "missing RcppEigen")
endif()
if(R_LEIDENALG)
find_library(LEIDENALG_LIB leidenAlg.so leidenAlg.dll PATHS "${R_LEIDENALG}" PATH_SUFFIXES "libs")
add_library(leidenAlg UNKNOWN IMPORTED)
set_property(TARGET leidenAlg PROPERTY IMPORTED_LOCATION ${LEIDENALG_LIB})
target_link_libraries(rliger2 PRIVATE leidenAlg)
else()
message(FATAL_ERROR "missing leidenAlg")
endif()


if(NOT(APPLE AND(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES arm64)))
if(OpenMP_CXX_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LazyData: true
RoxygenNote: 7.2.3
VignetteBuilder: knitr
Encoding: UTF-8
LinkingTo: Rcpp, RcppArmadillo, RcppEigen, RcppProgress, leidenAlg
LinkingTo: Rcpp, RcppArmadillo, RcppEigen, RcppProgress
Depends:
Matrix,
methods,
Expand Down
15 changes: 0 additions & 15 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,6 @@ makeFeatureMatrix <- function(bedmat, barcodes) {
.Call(`_rliger2_makeFeatureMatrix`, bedmat, barcodes)
}

#' Refer to the R function find_partition()
#' For notes of the graph object, refer to https://igraph.org/c/doc/igraph-Basic.html
#'
#' @param edgelist The graph edge list
#' @param edgelist_length integer The length of the graph edge list
#' @param num_vertices integer The number of vertices in the graph
#' @param direction boolean Whether the graph is directed or undirected
#' @param edge_weights Vector of edge weights. In weighted graphs, a real number is assigned to each (directed or undirected) edge. For an unweighted graph, this is set to 1. Refer to igraph, weighted graphs.
#' @param resolution Integer resoluiton parameter controlling communities detected (default=1.0) Higher resolutions lead to more communities, while lower resolutions lead to fewer communities.
#' @param niter Number of iterations that the algorithm should be run for (default=2)
#' @return A vector of membership values
find_partition_rcpp <- function(edgelist, edgelist_length, num_vertices, direction, edge_weights, resolution = 1.0, nIter = 2L) {
.Call(`_rliger2_find_partition_rcpp`, edgelist, edgelist_length, num_vertices, direction, edge_weights, resolution, nIter)
}

cluster_vote <- function(nn_ranked, clusts) {
.Call(`_rliger2_cluster_vote`, nn_ranked, clusts)
}
Expand Down
18 changes: 0 additions & 18 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,23 +305,6 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// find_partition_rcpp
std::vector<size_t> find_partition_rcpp(std::vector<int>& edgelist, int edgelist_length, int num_vertices, bool direction, std::vector<double>& edge_weights, double resolution, int nIter);
RcppExport SEXP _rliger2_find_partition_rcpp(SEXP edgelistSEXP, SEXP edgelist_lengthSEXP, SEXP num_verticesSEXP, SEXP directionSEXP, SEXP edge_weightsSEXP, SEXP resolutionSEXP, SEXP nIterSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< std::vector<int>& >::type edgelist(edgelistSEXP);
Rcpp::traits::input_parameter< int >::type edgelist_length(edgelist_lengthSEXP);
Rcpp::traits::input_parameter< int >::type num_vertices(num_verticesSEXP);
Rcpp::traits::input_parameter< bool >::type direction(directionSEXP);
Rcpp::traits::input_parameter< std::vector<double>& >::type edge_weights(edge_weightsSEXP);
Rcpp::traits::input_parameter< double >::type resolution(resolutionSEXP);
Rcpp::traits::input_parameter< int >::type nIter(nIterSEXP);
rcpp_result_gen = Rcpp::wrap(find_partition_rcpp(edgelist, edgelist_length, num_vertices, direction, edge_weights, resolution, nIter));
return rcpp_result_gen;
END_RCPP
}
// cluster_vote
IntegerVector cluster_vote(const Eigen::MatrixXd& nn_ranked, IntegerVector clusts);
RcppExport SEXP _rliger2_cluster_vote(SEXP nn_rankedSEXP, SEXP clustsSEXP) {
Expand Down Expand Up @@ -434,7 +417,6 @@ static const R_CallMethodDef CallEntries[] = {
{"_rliger2_cpp_rank_matrix_dense", (DL_FUNC) &_rliger2_cpp_rank_matrix_dense, 1},
{"_rliger2_cpp_nnzeroGroups_dgc_T", (DL_FUNC) &_rliger2_cpp_nnzeroGroups_dgc_T, 6},
{"_rliger2_makeFeatureMatrix", (DL_FUNC) &_rliger2_makeFeatureMatrix, 2},
{"_rliger2_find_partition_rcpp", (DL_FUNC) &_rliger2_find_partition_rcpp, 7},
{"_rliger2_cluster_vote", (DL_FUNC) &_rliger2_cluster_vote, 2},
{"_rliger2_scale_columns_fast", (DL_FUNC) &_rliger2_scale_columns_fast, 3},
{"_rliger2_max_factor", (DL_FUNC) &_rliger2_max_factor, 3},
Expand Down
3 changes: 0 additions & 3 deletions src/cpm-package-lock.cmake

This file was deleted.

44 changes: 0 additions & 44 deletions src/leiden.h

This file was deleted.

0 comments on commit 4ae0d87

Please sign in to comment.