Description Usage Arguments Details Value References See Also Examples

View source: R/binarizeTimeSeries.R

Binarizes a set of real-valued time series using k-means clustering, edge detection, or scan statistics.

1 2 3 4 5 6 7 8 9 | ```
binarizeTimeSeries(measurements,
method = c("kmeans","edgeDetector","scanStatistic"),
nstart = 100,
iter.max = 1000,
edge = c("firstEdge","maxEdge"),
scaling = 1,
windowSize = 0.25,
sign.level = 0.1,
dropInsignificant = FALSE)
``` |

`measurements` |
A list of matrices, each corresponding to one time series. Each row of these matrices contains real-valued measurements for one gene on a time line, i. e. column |

`method` |
The employed binarization technique. "kmeans" uses k-means clustering for binarization. "edgeDetector" searches for a large gradient in the sorted measurements. "scanStatistic" searches for accumulations in the measurements. See Details for descriptions of the techniques. |

`nstart` |
If |

`iter.max` |
If |

`edge` |
If If set to "maxEdge", the binarization threshold is the position of the edge with the overall highest gradient. |

`scaling` |
If |

`windowSize` |
If |

`sign.level` |
If |

`dropInsignificant` |
If this is set to true, genes whose binarizations are insignificant in the scan statistic (see Details) are removed from the binarized time series. Otherwise, a warning is printed if such genes exist. |

This method supports three binarization techniques:

- k-means clustering
For each gene, k-means clusterings are performed to determine a good separation of groups. The values belonging to the cluster with the smaller centroid are set to 0, and the values belonging to the greater centroid are set to 1.

- Edge detector
This approach first sorts the measurements for each gene. In the sorted measurements, the algorithm searches for differences of two successive values that satisfy a predefined condition: If the "firstEdge" method was chosen, the pair of values whose difference exceeds the scaled average gradient of all values is chosen and used as maximum and minimum value of the two groups. If the "maxEdge" method was chosen, the largest difference between two successive values is taken. For details, see Shmulevich et al.

- Scan statistic
The scan statistic assumes that the measurements for each gene are uniformly and independently distributed independently over a certain range. The scan statistic shifts a scanning window across the data and decides for each window position whether there is an unusual accumulation of data points based on an approximated test statistic (see Glaz et al.). The window with the smallest p-value is remembered. The boundaries of this window form two thresholds, from which the value that results in more balanced groups is taken for binarization. Depending on the supplied significance level, gene binarizations are rated according to the p-value of the chosen window.

Returns a list with the following elements:

`binarizedMeasurements` |
A list of matrices with the same structure as |

`reject` |
If |

`thresholds` |
The thresholds used for binarization |

I. Shmulevich and W. Zhang (2002), Binary analysis and optimization-based normalization of gene expression data. Bioinformatics 18(4):555–565.

J. Glaz, J. Naus, S. Wallenstein (2001), Scan Statistics. New York: Springer.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
# load test data
data(yeastTimeSeries)
# perform binarization with k-means
bin <- binarizeTimeSeries(yeastTimeSeries)
print(bin)
# perform binarization with scan statistic
# - will find and remove 2 insignificant genes!
bin <- binarizeTimeSeries(yeastTimeSeries, method="scanStatistic",
dropInsignificant=TRUE, sign.level=0.2)
print(bin)
# perform binarization with edge detector
bin <- binarizeTimeSeries(yeastTimeSeries, method="edgeDetector")
print(bin)
# reconstruct a network from the data
reconstructed <- reconstructNetwork(bin$binarizedMeasurements,
method="bestfit", maxK=4)
print(reconstructed)
``` |

```
$binarizedMeasurements
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
Fkh2 0 0 0 0 0 1 1 1 1 1 1 1 1 1
Swi5 0 0 1 0 0 0 1 1 1 1 1 1 1 1
Sic1 1 0 0 0 0 0 0 0 0 0 1 1 1 1
Clb1 0 0 0 0 0 1 1 1 1 1 1 1 1 1
$thresholds
Fkh2 Swi5 Sic1 Clb1
-0.1174444 -0.2058889 0.1454444 -0.3332222
$binarizedMeasurements
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
Swi5 0 0 1 0 0 0 0 1 1 1 1 1 1 1
Sic1 1 0 0 0 0 0 0 0 0 0 1 1 1 1
$thresholds
Swi5 Sic1
0.110 0.105
$reject
Swi5 Sic1
FALSE FALSE
$binarizedMeasurements
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
Fkh2 0 0 1 1 1 1 1 1 1 1 1 1 1 1
Swi5 0 1 1 1 1 1 1 1 1 1 1 1 1 1
Sic1 1 0 1 1 1 1 1 1 1 1 1 1 1 1
Clb1 0 0 0 0 1 1 1 1 1 1 1 1 1 1
$thresholds
Fkh2 Swi5 Sic1 Clb1
-0.435 -1.130 -0.590 -1.165
Probabilistic Boolean network with 4 genes
Involved genes:
Fkh2 Swi5 Sic1 Clb1
Transition functions:
Alternative transition functions for gene Fkh2:
Fkh2 = <f(Swi5){01}> (probability: 1, error: 0)
Alternative transition functions for gene Swi5:
Swi5 = 1 (probability: 1, error: 0)
Alternative transition functions for gene Sic1:
Sic1 = <f(Swi5){01}> (probability: 1, error: 0)
Alternative transition functions for gene Clb1:
Clb1 = <f(Clb1){01}> (probability: 0.5, error: 1)
Clb1 = <f(Fkh2){01}> (probability: 0.5, error: 1)
Knocked-out and over-expressed genes:
Swi5 = 1
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.