Title: | Multiple SIGnal SEGmentation |
---|---|
Description: | Traditional methods typically detect breakpoints from individual signals, which means that when applied separately to multiple signals, the breakpoints are not aligned. However, this package implements a common breakpoint detection approach for multiple piecewise constant signals, resulting in increased detection sensitivity and specificity. By employing various techniques, optimal performance is ensured, and computation is accelerated. We hope that this package will be beneficial for researchers in signal processing, bioinformatics, economy, and other related fields. The segmentation(), lambda_estimator() functions are the main functions of this package. |
Authors: | Xuanyu Liu [aut, cre], Junbo Duan [aut] |
Maintainer: | Xuanyu Liu <[email protected]> |
License: | GPL-3 |
Version: | 0.2.0 |
Built: | 2024-12-07 06:47:12 UTC |
Source: | CRAN |
This function returns the brkps slot of MSigSeg object.
## S4 method for signature 'MSigSeg' brkps(object)
## S4 method for signature 'MSigSeg' brkps(object)
object |
A 'MSigSeg' object. |
This function is a S4 method for MSigSeg object. It retrieves brkps slot, which contains the locations of break points.
The brkps slot of MSigSeg object.
x=new("MSigSeg") # Creating a new MSigSeg object. brkps(x)
x=new("MSigSeg") # Creating a new MSigSeg object. brkps(x)
Generate matrix based on specified breakpoints.
change(M, p = 0.01)
change(M, p = 0.01)
M |
A matrix users aimed to add breakpoints. |
p |
Probability of occurrence of breakpoints. |
Generate matrix with common breakpoints, based on specific probability of occurrence.
A list containing the matrix with specified change point and the location of breakpoints.
A simulated data set used for testing.
data_test
data_test
A matrix with 1000 rows and 20 columns.
data("data_test",package = "MSigSeg")
data("data_test",package = "MSigSeg")
This function returns the data.input slot of MSigSeg object.
## S4 method for signature 'MSigSeg' data.input(object)
## S4 method for signature 'MSigSeg' data.input(object)
object |
A MSigSeg object. |
This function is a S4 method for MSigSeg object. It retrieves data.input slot, which contains the data users input.
The data.input slot of MSigSeg object.
x=new("MSigSeg") # Creating a new MSigSeg object. data.input(x)
x=new("MSigSeg") # Creating a new MSigSeg object. data.input(x)
This function returns the data.output slot of MSigSeg object.
## S4 method for signature 'MSigSeg' data.output(object)
## S4 method for signature 'MSigSeg' data.output(object)
object |
A MSigSeg object. |
This function is a S4 method for MSigSeg object. It retrieves data.output slot, which contains the input data which has been smoothed..
The data.output slot of MSigSeg object.
x=new("MSigSeg") # Creating a new MSigSeg object. data.output(x)
x=new("MSigSeg") # Creating a new MSigSeg object. data.output(x)
This function returns the lambda slot of MSigSeg object.
## S4 method for signature 'MSigSeg' lambda(object)
## S4 method for signature 'MSigSeg' lambda(object)
object |
A MSigSeg object. |
This function is a S4 method for MSigSeg object. It retrieves lambda slot, which contains penalty coefficient to prevent over fitting.
The lambda slot of MSigSeg object.
x=new("MSigSeg") # Creating a new MSigSeg object. lambda(x)
x=new("MSigSeg") # Creating a new MSigSeg object. lambda(x)
Automatic estimation of penalty parameter lambda for user defined breakpoints number.
lambda_estimator(Y, K)
lambda_estimator(Y, K)
Y |
An data.frame/matrix containing the data to be segmented. Each column stores a signal. |
K |
Number of change points users want to detect. |
This function is based on the segmentation() function. Number of breakpoints are defined by users and lambda is calculated by algorithm automatically.
An object of S4 class "MSigSeg".
data(data_test) lambda_estimator(data_test,5)
data(data_test) lambda_estimator(data_test,5)
An S4 class to encapsulation the result of breakpoints analysis.
data.input
An data.frame/matrix containing the data to be segmented. Each column stores a signal.
data.output
A matrix containing the input data which has been smoothed.
lambda
A penalty term, small value leads to large number of breakpoints, and vice versa.
brkps
A vector containing the locations of common breakpoints.
fmin
A numeric containing the optimal numerical value calculated.
date
Character string containing date information.
Graph signals and breakpoints based on ggplot2 and ggarange packages.
multi_plot(m, ncol, nrow)
multi_plot(m, ncol, nrow)
m |
An object of S4 class "MSigSeg". |
ncol |
Column numbers of signals arrangement in the graph. |
nrow |
Row numbers of signals arrangement in the graph |
A list, first item in the list is a graphic objects with all signals drawn and second is a list with individual signals.
data(data_test) m <- segmentation(data_test,100) p <- multi_plot(m,4,5)
data(data_test) m <- segmentation(data_test,100) p <- multi_plot(m,4,5)
influenza data set from CDC used as an example.
NCHSData
NCHSData
A matrix with 52 rows and 10 columns.
data("NCHSData",package = "MSigSeg")
data("NCHSData",package = "MSigSeg")
Generate matrix based on signal-to-noise ratio.
noisegen(X, SNR)
noisegen(X, SNR)
X |
A matrix users aimed to add signal-to-noise ratio. |
SNR |
Signal-to-noise ratio. |
A matrix with specified signal-to-noise ratio.
This function print the basic information of MSigSeg object.
## S4 method for signature 'MSigSeg' print(object)
## S4 method for signature 'MSigSeg' print(object)
object |
A MSigSeg object. |
This function is a S4 method for MSigSeg object. It prints class, slots, created date and summary of MSigSeg object.
The the basic information of MSigSeg object.
x=new("MSigSeg") # Creating a new MSigSeg object. print(x)
x=new("MSigSeg") # Creating a new MSigSeg object. print(x)
This function returns the length of segmentation.
## S4 method for signature 'MSigSeg' seg.len(object)
## S4 method for signature 'MSigSeg' seg.len(object)
object |
A MSigSeg object. |
This function is a S4 method for MSigSeg object. It calculates the distance between each change points.
A vector contains length of segmentation.
x=new("MSigSeg") # Creating a new MSigSeg object. seg.len(x)
x=new("MSigSeg") # Creating a new MSigSeg object. seg.len(x)
Calculates the optimal positioning and number of common breakpoints for multiple signals.
segmentation(Y, lambda, flag = TRUE, return_smooth_signals = TRUE)
segmentation(Y, lambda, flag = TRUE, return_smooth_signals = TRUE)
Y |
An data.frame/matrix containing the data to be segmented. Each column stores a signal. |
lambda |
A penalty term, small value leads to large number of breakpoints, and vice versa. |
flag |
Logical. If True then use th PELT method. If False then use the OP method. |
return_smooth_signals |
Logical. If True then smoothed signals are returned. |
This function uses modified PELT method to find optimal common change points for multiple signals.
An object of S4 class "MSigSeg"
data(data_test) segmentation(data_test,100)
data(data_test) segmentation(data_test,100)
A stock data set used as an example.
stock
stock
A data.frame with 757 rows and 488 columns.
data("stock",package = "MSigSeg")
data("stock",package = "MSigSeg")
This function summarize the information of MSigSeg object.
## S4 method for signature 'MSigSeg' summary(object)
## S4 method for signature 'MSigSeg' summary(object)
object |
A MSigSeg object. |
This function is a S4 method for MSigSeg object. It summarizes the number of signals, length of signals, number of change points and fmin.
A summary of MSigSeg object.
x=new("MSigSeg") # Creating a new MSigSeg object. summary(x)
x=new("MSigSeg") # Creating a new MSigSeg object. summary(x)
A chromosome sequencing data set used as an example.
T16M
T16M
A data.frame with 2928 rows and 22 columns.
Navin N, Kendall J, Troge J, et al. Tumour evolution inferred by single-cell sequencing. Nature. 2011;472(7341):90-94. doi:10.1038/nature09807
data("T16M",package = "MSigSeg")
data("T16M",package = "MSigSeg")
A chromosome sequencing data set used as an example.
T16P
T16P
A data.frame with 2928 rows and 16 columns.
Navin N, Kendall J, Troge J, et al. Tumour evolution inferred by single-cell sequencing. Nature. 2011;472(7341):90-94. doi:10.1038/nature09807
data("T16P",package = "MSigSeg")
data("T16P",package = "MSigSeg")