createfn.gds {gdsfmt} | R Documentation

## Create a GDS file

### Description

Create a new CoreArray Genomic Data Structure (GDS) file.

### Usage

    createfn.gds(filename, allow.duplicate=FALSE)

### Arguments

`filename` | the file name of a new GDS file to be created
`allow.duplicate` | if `TRUE`, it is allowed to open a GDS file with read-only mode when it has been opened in the same R session

### Details

Keep in mind that the new file may not actually be written to disk until `closefn.gds` or `sync.gds` is called.

### Value

Return an object of class `gds.class`:

`filename` | the file name to be created
`id` | internal file id
`root` | an object of class `gdsn.class`, the root of hierachical structure
`readonly` | whether it is read-only or not

### Author(s)

Xiuwen Zheng

### References

http://github.com/zhengxwen/gdsfmt

### See Also

`openfn.gds`, `closefn.gds`

### Examples

    # cteate a GDS file
    f <- createfn.gds("test.gds")

    # add a list to "test.gds"
    node <- add.gdsn(f, val=list(x=c(1,2), y=c("T", "B", "C"), z=TRUE))

    f

    # close the GDS file
    closefn.gds(f)

    # delete the temporary file
    unlink("test.gds", force=TRUE)

[Package gdsfmt version 1.14.1 Index]