zhengxwen / SeqArray

Data management of large-scale whole-genome sequence variant calls (Development version only)
http://www.bioconductor.org/packages/SeqArray
44 stars 12 forks source link

change sample.id in SeqArray #31

Closed thierrygosselin closed 6 years ago

thierrygosselin commented 6 years ago

first, please tell me if it's the place to ask for question, or if there's a google group or if you prefer the Wiki section.

Question: Is there a way to change/rename the sample.id in SeqArray ?

Best Thierry

zhengxwen commented 6 years ago

https://support.bioconductor.org/t/seqarray/ Or https://github.com/zhengxwen/SeqArray/issues

You need to use the gdsfmt package to rename the sample id in SeqArray. E.g.,

library(SeqArray)

fn <- seqExampleFileName("gds")
file.copy(fn, "tmp.gds")

f <- openfn.gds("tmp.gds", readonly=FALSE)
new_samp_id <- paste("new", 1:90)
add.gdsn(f, "sample.id", new_samp_id, replace=TRUE, compress="LZMA_RA", closezip=TRUE)
closefn.gds(f)

gds <- seqOpen("tmp.gds")
seqGetData(gds, "sample.id")
seqClose(gds)