Skip to content

Commit

Permalink
Merge pull request #37 from petrelharp/corners_docs
Browse files Browse the repository at this point in the history
better corners docs
  • Loading branch information
petrelharp authored Aug 13, 2024
2 parents abf0c31 + 6971d05 commit 93ad593
Show file tree
Hide file tree
Showing 30 changed files with 87 additions and 54 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:
- name: Install bcftools
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install bcftools build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
sudo apt-get update
sudo apt-get install bcftools build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev libharfbuzz-dev libfribidi-dev
- name: Install package
run: |
Expand Down
2 changes: 1 addition & 1 deletion lostruct/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LazyData: true
Imports:
RSpectra,
data.table
RoxygenNote: 5.0.1
RoxygenNote: 7.2.3
Suggests:
knitr,
testthat,
Expand Down
32 changes: 26 additions & 6 deletions lostruct/R/corners.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
#' Find Points in a 2D Cloud Closest to the "Corners"
#'
#' Finds the k "extreme points" that lie closest to the minimal enclosing circle,
#' and returns a matrix with k columns containing the portion of points
#' that lie closest to those extreme points.
#' Finds the 'k' "extreme points" (the "corners") that lie closest
#' to the minimal circle enclosing the input collection of points
#' in two dimensions, and returns for each of these corners
#' which of the input points are closest to that corner.
#' The return value is a matrix with 'k' columns,
#' whose 'i'-th column contains the indices of those points
#' that lie closest to the 'i'-th corner.
#'
#' If the output is 'out', then 'out[,i]' is a vector of
#' length 'nrow(xy) * prop' for which 'xy[ out[,i], ]' is
#' the coordinates of the closest points to the 'i'th corner.
#' The rows of 'out' are in no particular order.
#'
#' If k is larger than the number of points on the minimal enclosing circle,
#' adds the closest points to that circle that are not in previously added points' neighborhoods
#' until k is reached.
#' this adds the closest points to that circle that are not in previously
#' added points' neighborhoods until k is reached.
#' If k is less than 3, this will behave as if k=3.
#'
#' @param xy A two-column numeric matrix of coordinates.
#' @param prop The proportion of points to return for each corner.
#' @return A three column integer matrix giving the indices of the corresponding points.
#' @param k The number of corners (should be at least 3).
#' @return A k-column integer matrix whose i-th column gives the indices of the points closest to the i-th corner.
#'
#' @examples
#' xy <- runif(200) |> matrix(ncol=2)
#' out <- corners(xy, k=4, prop=0.05)
#' \dontrun{
#' plot(xy)
#' for (i in 1:4) points(xy[out[,i],], col=i, pch=20, cex=2)
#' }
#' @export
corners <- function (xy, prop, k=3) {
xy <- as.matrix(xy)
Expand Down
6 changes: 3 additions & 3 deletions lostruct/man/as.winfun.Rd

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

35 changes: 28 additions & 7 deletions lostruct/man/corners.Rd

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

9 changes: 6 additions & 3 deletions lostruct/man/cov_pca.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/dim.winfun.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/dist_sq_from_pcs.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/eigen_windows.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/eigen_windows_matrix.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/eigen_windows_winfn.Rd

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

4 changes: 2 additions & 2 deletions lostruct/man/enclosing_circle.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/getCircleFrom3.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/getMaxPairDist.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/getMaxRad.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/getMinCircle.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/isBiggerThan90.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/multi_vcf_query.Rd

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

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

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

5 changes: 2 additions & 3 deletions lostruct/man/pc_dist.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/read_tped.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/read_vcf.Rd

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

9 changes: 6 additions & 3 deletions lostruct/man/recode_numeric.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/region_string.Rd

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

5 changes: 3 additions & 2 deletions lostruct/man/running_cov.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/vcf_positions.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/vcf_query.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/vcf_samples.Rd

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

10 changes: 7 additions & 3 deletions lostruct/man/vcf_windower.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/winfun_matrix.Rd

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

0 comments on commit 93ad593

Please sign in to comment.