Skip to content

Commit ce63308

Browse files
authored
Merge pull request #269 from grunwaldlab/znk/format
run air format
2 parents 2a28ebd + 164823b commit ce63308

File tree

126 files changed

+12683
-8287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+12683
-8287
lines changed

R/Index_calculations.r

Lines changed: 519 additions & 382 deletions
Large diffs are not rendered by default.

R/aaaMLGclass.R

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,37 @@
44
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
55
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
66
#
7-
# This software was authored by Zhian N. Kamvar and Javier F. Tabima, graduate
7+
# This software was authored by Zhian N. Kamvar and Javier F. Tabima, graduate
88
# students at Oregon State University; Jonah C. Brooks, undergraduate student at
99
# Oregon State University; and Dr. Nik Grünwald, an employee of USDA-ARS.
1010
#
1111
# Permission to use, copy, modify, and distribute this software and its
12-
# documentation for educational, research and non-profit purposes, without fee,
12+
# documentation for educational, research and non-profit purposes, without fee,
1313
# and without a written agreement is hereby granted, provided that the statement
1414
# above is incorporated into the material, giving appropriate attribution to the
1515
# authors.
1616
#
1717
# Permission to incorporate this software into commercial products may be
18-
# obtained by contacting USDA ARS and OREGON STATE UNIVERSITY Office for
18+
# obtained by contacting USDA ARS and OREGON STATE UNIVERSITY Office for
1919
# Commercialization and Corporate Development.
2020
#
2121
# The software program and documentation are supplied "as is", without any
22-
# accompanying services from the USDA or the University. USDA ARS or the
23-
# University do not warrant that the operation of the program will be
24-
# uninterrupted or error-free. The end-user understands that the program was
25-
# developed for research purposes and is advised not to rely exclusively on the
22+
# accompanying services from the USDA or the University. USDA ARS or the
23+
# University do not warrant that the operation of the program will be
24+
# uninterrupted or error-free. The end-user understands that the program was
25+
# developed for research purposes and is advised not to rely exclusively on the
2626
# program for any reason.
2727
#
28-
# IN NO EVENT SHALL USDA ARS OR OREGON STATE UNIVERSITY BE LIABLE TO ANY PARTY
28+
# IN NO EVENT SHALL USDA ARS OR OREGON STATE UNIVERSITY BE LIABLE TO ANY PARTY
2929
# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
30-
# LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
31-
# EVEN IF THE OREGON STATE UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF
32-
# SUCH DAMAGE. USDA ARS OR OREGON STATE UNIVERSITY SPECIFICALLY DISCLAIMS ANY
33-
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
34-
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY STATUTORY
30+
# LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
31+
# EVEN IF THE OREGON STATE UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF
32+
# SUCH DAMAGE. USDA ARS OR OREGON STATE UNIVERSITY SPECIFICALLY DISCLAIMS ANY
33+
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
34+
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY STATUTORY
3535
# WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
3636
# BASIS, AND USDA ARS AND OREGON STATE UNIVERSITY HAVE NO OBLIGATIONS TO PROVIDE
37-
# MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
37+
# MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
3838
#
3939
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
4040
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
@@ -44,74 +44,79 @@
4444
setClassUnion("charORLang", c("character", "language"))
4545
#==============================================================================#
4646
#' MLG class
47-
#'
47+
#'
4848
#' A class to store multilocus genotypes in genclone objects. This is intended
4949
#' for internal use only.
50-
#'
50+
#'
5151
#' @name MLG-class
5252
#' @rdname MLG-class
5353
#' @aliases MLG
5454
#' @export
55-
#' @slot mlg a list containing four vectors, one for each type of MLG
55+
#' @slot mlg a list containing four vectors, one for each type of MLG
5656
#' manipulation.
57-
#' @slot visible a character specifying which MLG type is to be displayed and
57+
#' @slot visible a character specifying which MLG type is to be displayed and
5858
#' accessed.
59-
#' @slot distname the name of the distance function or matrix used to collapse
59+
#' @slot distname the name of the distance function or matrix used to collapse
6060
#' mlgs.
6161
#' @slot distenv the environment that contains the distance function or matrix
6262
#' @slot distargs the arguments provided to compute the distance function.
6363
#' @slot distalgo the algorithm used to contract multilocus genotypes.
64-
#' @slot cutoff Two numbers specifying the cutoff value for expanding and
64+
#' @slot cutoff Two numbers specifying the cutoff value for expanding and
6565
#' collapsing MLGs.
6666
#' @author Zhian N. Kamvar
6767
#' @seealso \code{\linkS4class{genclone}} \code{\linkS4class{snpclone}}
6868
#' \code{\link{mll}} For developers: \code{\link{visible}}
6969
#' @keywords internal
7070
#' @examples
71-
#'
71+
#'
7272
#' # These examples will simply show you what you can do with these
7373
#' set.seed(5000)
7474
#' (x <- sample(10, 20, replace = TRUE))
7575
#' (m <- new("MLG", x))
76-
#'
76+
#'
7777
#' visible(m) # original is always default
78-
#'
79-
#' m[] # adding braces after the object will always return a vector of
78+
#'
79+
#' m[] # adding braces after the object will always return a vector of
8080
#' # the same type as defined in "visible"
81-
#'
81+
#'
8282
#' m + 1 # You can do math on the numeric ones
83-
#'
83+
#'
8484
#' visible(m) <- "custom"
8585
#' m + 2 # This should throw a warning
8686
#' # The types are stored in a data frame. You can retrieve them easily:
8787
#' visible(m) <- "original"
8888
#' m
8989
#' m[, "custom"]
90-
#'
91-
#' # Important for subsetting, if you subset the object, normally, it will
90+
#'
91+
#' # Important for subsetting, if you subset the object, normally, it will
9292
#' # return a vector unless you specify all = TRUE
9393
#' m[1:10] # original vector
9494
#' m[1:10, all = TRUE] # still class MLG
95-
#'
95+
#'
9696
#==============================================================================#
97-
setClass("MLG",
98-
representation(visible = "character",
99-
cutoff = "numeric",
100-
distname = "charORLang",
101-
distenv = "environment",
102-
distargs = "list",
103-
distalgo = "character",
104-
mlg = "data.frame"),
105-
prototype(visible = character(0),
106-
cutoff = numeric(0),
107-
distname = character(0),
108-
distenv = as.environment(.GlobalEnv),
109-
distargs = list(),
110-
distalgo = "farthest_neighbor",
111-
mlg = data.frame(expanded = numeric(0),
112-
original = numeric(0),
113-
contracted = numeric(0),
114-
custom = factor(character(0))
115-
)
116-
)
117-
)
97+
setClass(
98+
"MLG",
99+
representation(
100+
visible = "character",
101+
cutoff = "numeric",
102+
distname = "charORLang",
103+
distenv = "environment",
104+
distargs = "list",
105+
distalgo = "character",
106+
mlg = "data.frame"
107+
),
108+
prototype(
109+
visible = character(0),
110+
cutoff = numeric(0),
111+
distname = character(0),
112+
distenv = as.environment(.GlobalEnv),
113+
distargs = list(),
114+
distalgo = "farthest_neighbor",
115+
mlg = data.frame(
116+
expanded = numeric(0),
117+
original = numeric(0),
118+
contracted = numeric(0),
119+
custom = factor(character(0))
120+
)
121+
)
122+
)

0 commit comments

Comments
 (0)