export.groups: Export the IPCAPS2 result to a text file

View source: R/export.groups.R

export.groupsR Documentation

Export the IPCAPS2 result to a text file

Description

Export clustering result of ipcaps2 to text file called 'groups.txt'.

Usage

export.groups(result.dir, silence.mode = FALSE)

Arguments

result.dir

A result directory as the $output object returned from the ipcaps2 function.

silence.mode

To enable or disable silence mode. If silence mode is enabled, the fuction is processed without printing any message on the screen, and it is slightly faster. Default = TRUE.

Details

After running, this function exports the file called 'groups.txt' to the same result directory. If 'groups.txt' already exists in the result directory, the exported file is changed to 'groups1.txt', 'groups2.txt', 'groups3.txt', ..., accordingly.

Value

A data frame of exported data containing 4 columns; group, node, label, row.number, as described below for more details:

  • group represents group membership of IPCAPS2 result.

  • node represents node numbers of IPCAPS2 result.

  • label represents labels of rows in orginal input data.

  • row.number represents row numbers of orginal input data.

Examples


# Importantly, bed file, bim file, and fam file are required
# Use the example files embedded in the package

BED.file <- system.file("extdata","ipcaps_example.bed",package="IPCAPS2")
LABEL.file <- system.file("extdata","ipcaps_example_individuals.txt.gz",package="IPCAPS2")

my.cluster <- ipcaps2(bed=BED.file,
                      label.file=LABEL.file,
                      lab.col=2,
                      out=tempdir(),
                      silence=TRUE,
                      no.rep=1)

#Here, to export the IPCAPS2 result to a text file
exported.data <- export.groups(my.cluster$output.dir)
print(dim(exported.data))
head(exported.data)

kridsadakorn/ipcaps2 documentation built on June 11, 2022, 8:35 p.m.