The massi_cluster function predicts the sex of samples using k-medoids clustering.
Usage
massi_cluster(y_data)
Arguments
y_data
the y_data object is the data.frame returned from the massi_select function. This is a data.frame with sample names as column names and probe id's as row.names.
Details
This function clusters samples into two clusters using y chromosome probe values. K-medoids clustering is performed using the partitioning around medoids (pam) method implimented in the "fpc" package. The cluster with the highest probe values is determined to be the cluster of male samples and the cluster the lowest values as female samples.
Value
cluster data
Contains all of the results from the k-medoids clustering.
massi.results
Contains the results for each sample, including sample id, predicted sex, sample z-score and mean probe expression.
Author(s)
Sam Buckberry
References
Christian Hennig (2013). fpc: Flexible procedures for clustering. R package version 2.1-6.
http://CRAN.R-project.org/package=fpc
# load the test dataset
data(massi.test.dataset, massi.test.probes)
# select the y chromosome probes using massi_select
massi_select_out <-
massi_select(massi.test.dataset, massi.test.probes)
# cluster samples to predict sex using massi_cluster
massi_cluster_out <-
massi_cluster(massi_select_out)
# get the results in a data.frame format
data.frame(massi_cluster_out[[2]])
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(massiR)
Loading required package: cluster
Loading required package: gplots
Attaching package: 'gplots'
The following object is masked from 'package:stats':
lowess
Loading required package: diptest
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/massiR/massi_cluster.Rd_%03d_medium.png", width=480, height=480)
> ### Name: massi_cluster
> ### Title: massi_cluster
> ### Aliases: massi_cluster
>
> ### ** Examples
>
>
> # load the test dataset
> data(massi.test.dataset, massi.test.probes)
>
> # select the y chromosome probes using massi_select
> massi_select_out <-
+ massi_select(massi.test.dataset, massi.test.probes)
>
> # cluster samples to predict sex using massi_cluster
> massi_cluster_out <-
+ massi_cluster(massi_select_out)
>
> # get the results in a data.frame format
> data.frame(massi_cluster_out[[2]])
ID mean_y_probes_value y_probes_sd z_score sex
1 S1 5.680165 0.4090441 -0.85585504 female
2 S10 6.170169 0.8394536 0.44782165 male
3 S11 5.603765 0.3702051 -0.81252502 female
4 S12 6.173442 0.7756386 0.62083674 male
5 S13 5.698972 0.4973658 -0.45498169 female
6 S14 5.671378 0.4943536 -0.58020581 female
7 S15 5.698598 0.6092190 -0.52876863 female
8 S16 6.204787 0.9358266 0.46209119 male
9 S17 5.643580 0.3950373 -0.68303870 female
10 S18 6.158790 0.7745952 0.49253628 male
11 S19 5.683547 0.3772903 -0.49106943 female
12 S2 5.725198 0.4202718 -0.41740176 female
13 S20 6.197443 0.8684864 0.52636778 male
14 S21 6.235593 0.9103953 0.69597729 male
15 S22 6.186751 0.8736938 0.59480439 male
16 S23 6.300154 0.9410008 0.76469585 male
17 S24 5.629225 0.4451357 -0.78678273 female
18 S25 6.247860 0.9653944 0.62357532 male
19 S26 6.180581 0.8510991 0.37554456 male
20 S27 5.620330 0.3004966 -0.63975338 female
21 S28 5.708171 0.4438601 -0.32440462 female
22 S29 6.156075 0.9390711 0.25273543 male
23 S3 6.115781 0.7561232 0.29708553 male
24 S30 5.656060 0.3813885 -0.54925196 female
25 S31 6.169508 0.9305175 0.35708098 male
26 S32 6.155072 0.8373847 0.34490811 male
27 S33 5.649092 0.4124183 -0.73064375 female
28 S34 6.142749 0.8462364 0.23406710 male
29 S35 6.212895 0.9091188 0.60203617 male
30 S36 6.166242 0.9208438 0.33055196 male
31 S37 5.695139 0.4255875 -0.22808642 female
32 S38 6.146158 0.8042844 0.62779880 male
33 S39 5.736517 0.5181531 -0.09019286 female
34 S4 6.158195 0.7622165 0.50511011 male
35 S40 5.651175 0.4587101 -0.70773294 female
36 S41 5.691771 0.5619696 -0.37876345 female
37 S42 6.238056 0.9162148 0.70391723 male
38 S43 6.235513 0.7535050 1.07926344 male
39 S44 5.675913 0.3643422 -0.46755050 female
40 S45 6.218716 0.8796017 0.67120180 male
41 S46 5.674705 0.4246131 -0.61329772 female
42 S47 5.691977 0.5917014 -0.62546100 female
43 S48 5.605190 0.2344730 -0.81781208 female
44 S49 6.252667 0.9541327 0.73467290 male
45 S5 6.124133 0.8023630 0.17459905 male
46 S50 6.032971 0.6670877 0.30287712 male
47 S51 6.100700 0.7833503 0.18172381 male
48 S52 5.735546 0.3397371 -0.38477975 female
49 S53 6.090985 0.6926929 0.30649661 male
50 S54 6.148481 0.7163452 0.65216371 male
51 S55 5.716399 0.4455840 -0.53489323 female
52 S56 6.094476 0.7517557 0.18900576 male
53 S57 6.059073 0.6616431 0.13405343 male
54 S58 5.869729 0.5446749 0.33492939 female
55 S59 5.734061 0.4127407 -0.50774683 female
56 S6 5.611190 0.4744621 -0.85597382 female
57 S60 5.800338 0.4242135 -0.09467263 female
58 S7 5.701315 0.4420199 -0.27489193 female
59 S8 6.160184 0.9019628 0.33816949 male
60 S9 5.630080 0.3119106 -0.52216125 female
>
>
>
>
>
>
> dev.off()
null device
1
>