smfishHmrf.generate.centroid.save: Save the cluster centroids to file

Description Usage Arguments Examples

View source: R/smfishHmrf.hmrfem.R

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

1
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

1
2
3
4
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())

smfishHmrf documentation built on Jan. 13, 2021, 12:54 p.m.