smfishHmrf.generate.centroid.save {smfishHmrf}R Documentation

Save the cluster centroids to file

Description

This function is run after the kmeans step. It takes a kmeans object (containing the kmeans result) as input and save the cluster centroids to file.

Note that the location of saving and the file names are decided by the following rule:

  1. {output_dir}/k_{par_k}/f{name}.gene.ALL.centroid.txt

  2. {output_dir}/k_{par_k}/f{name}.gene.ALL.kmeans.txt

where {} refers to the value of parameters.

Usage

smfishHmrf.generate.centroid.save(kk, name = "test", output_dir = ".")

Arguments

kk

kmeans object

name

name of the run

output_dir

output directory; where to save the results

Examples

expr_file = system.file("extdata", "ftest.expression.txt", package="smfishHmrf")
y<-smfishHmrf.read.expression(expr_file)
kk = smfishHmrf.generate.centroid(y, par_k=9, par_seed=100, nstart=100)
smfishHmrf.generate.centroid.save(kk, name="test", output_dir=tempdir())

[Package smfishHmrf version 0.1 Index]