Skip to content

Commit

Permalink
added a couple of exports
Browse files Browse the repository at this point in the history
  • Loading branch information
pfgherardini committed Feb 2, 2021
1 parent 3180392 commit 2dada43
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 31 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: vite
Type: Package
Title: Analyzing single-cell data using graphs
Version: 0.4.7
Version: 0.4.8
Authors@R: "Pier Federico Gherardini <pfgherardini@parkerici.org> [aut, cre]"
Description: This is a package for visualization and analysis of high-dimensional
single-cell data using graphs
Expand All @@ -13,4 +13,4 @@ LinkingTo: Rcpp
License: GPL v3
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.0
RoxygenNote: 7.1.1
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

export(build_graph)
export(complete_forceatlas2)
export(cosine_similarity_from_matrix)
export(cosine_similarity_matrix)
export(filter_matrix_by_rank)
export(get_scaffold_map)
export(get_unsupervised_graph)
Expand Down
3 changes: 3 additions & 0 deletions R/unsupervised.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' @return Returns a vector of length \code{N} containing the cosine similarity between
#' the vector \code{x} and all the rows of \code{m}
#'
#' @export
cosine_similarity_from_matrix <- function(x, m) {
x <- x / as.vector(sqrt(crossprod(x)))
return(as.vector((m %*% x) / sqrt(rowSums(m^2))))
Expand All @@ -21,6 +22,8 @@ cosine_similarity_from_matrix <- function(x, m) {
#'
#' @return Returns an \code{N x N} matrix with the cosine similarity between the corresponding rows in \code{m}
#'
#'
#' @export
cosine_similarity_matrix <- function(m){
ret <- m %*% t(m) / (sqrt(rowSums(m^2) %*% t(rowSums(m^2))))
return(ret)
Expand Down
9 changes: 7 additions & 2 deletions man/add_vertices_to_landmarks_graph.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions man/complete_forceatlas2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/get_distances_from_landmarks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions man/get_scaffold_map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions man/get_unsupervised_graph_from_files.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions man/layout_forceatlas2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/load_landmarks_from_dir.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions man/run_scaffold_analysis.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions man/write_clusters_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions man/write_scaffold_output.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2dada43

Please sign in to comment.