interactiveCall: Interactively recall a marker

Description Usage Arguments Details Value Examples

View source: R/interactiveCall.R

Description

Interactively recall a marker, using DBSCAN or model-based clustering.

Usage

1
2
interactiveCall(originalResult, startingPointFunction, n.iter, dbscanParameters,
  clusterModelParameters, runHeuristicsParameters, ...)

Arguments

originalResult

The previous attempt at calling this marker. Must be an object of class markerResult. If no attempt has previously been made, a suitable value is list(data = data, hasVariability = TRUE), with class set to markerResult; this specifies that in the previous calling result, this marker was determined to be monomorphic.

startingPointFunction

A function that generates a list of starting points for the model based clustering algorithm. Each starting point is a 2 x 2 matrix, containing two column vectors. These column vectors are the initial centers for the two homozygote clusters.

n.iter

The number of MCMC iterations to use for the model based clustering algorithm.

dbscanParameters

A list with named entries. Each entry is it self a list with two entries, named eps and minPts; these entries are arguments to the DBSCAN algorithm. Each name of the list dbscanParameters is used as a hotkey in the interactive calling. See below for details.

clusterModelParameters

A list of parameters to the model based clustering algorithm. See fitClusterModel for further details.

runHeuristicsParameters

A list of parameters to the runHeuristics function.

...

Undocumented arguments, used only for testing this function.

Details

This function allows the user to interactively recall a marker using (primarily) keyboard commands. The current marker calling result is displayed in a plot. Once a command is entered, hitting ENTER/RETURN runs the command. The commands are as follows:

"k"

Keep the current marker calling result and exit

"d"

Discard this maker, by returning a result indicating that this marker is momomorphic

"o"

Go back to the original result used as an input to this function

"c"

Generate a new set of marker calls using the model-based clustering algorithm, OR show the next model-based calling result. Once the last model-based calling result has been displayed, command "c" generates a new set of marker calls.

"p"

Apply the model-based clustering algorithm, but with the user selecting the initial centers of the two clusters by clicking on the plot.

other

If the input command is a name of an entry of dbscanParameters, then the corresponding entry of dbscanParameters is used as the parameters for the DBSCAN algorithm.

Value

An object of class markerResult, containing the details of the called marker.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
data("eightWayExampleData", package="magicCalling")
data <- eightWayExampleData[[1]]
#Original calling result marks the marker as monomorphic
originalResult <- list(hasVariability = FALSE, data = data)
class(originalResult) <- "markerResult"
#Specify the starting points for the model-based clustering algorithm. Four starting points, each specified twice. The y-coordinate is chosen as the mean of the y-coordinates of the input data. 
startingPointFunction <- function(data)
{
        meanY <- mean(data[,2])
        startingPoints <- list(
                rbind(c(0.5, meanY), c(0.5, meanY)),
                rbind(c(0.5, meanY), c(0.5, meanY)),
                rbind(c(0.25, meanY), c(0.5, meanY)),
                rbind(c(0.25, meanY), c(0.5, meanY)),
                rbind(c(0.75, meanY), c(0.5, meanY)),
                rbind(c(0.75, meanY), c(0.5, meanY)),
                rbind(c(0.8, meanY), c(0.2, meanY)),
                rbind(c(0.8, meanY), c(0.2, meanY))
        )
}
exampleDbscanParameters <- list("1" = list(eps = 0.04, minPts = 65), "2" = list(eps = 0.03, minPts = 105))
## Not run: 
#In this call, commands "1" and "2" run DBSCAN. Command "c" calls the model-based clustering algorithm, generating eight possible calls, and displays the first. The next seven commands "c" show the next model-based call. The eighth command "c" generates another eight possible calls and shows the first, etc. 
interactiveResult <- interactiveCall(originalResult, startingPointFunction = startingPointFunction, n.iter = 200, dbscanParameters = exampleDbscanParameters, clusterModelParameters = magicCalling:::exampleModelParameters, runHeuristicsParameters = list(minHomozygoteSize = 200))

## End(Not run)

rohan-shah/magicCalling documentation built on Jan. 3, 2020, 6:28 p.m.