Description Usage Arguments Value Examples
arrange import to mongo using mongoimport, setting up type and fields appropriately
1 2 | importBedToMongo(path, collectionName, bedType = "narrowPeak",
dbname = "db", importCmd = "mongoimport", host = "127.0.0.1")
|
path |
path to bed file (not compressed) |
collectionName |
name to use in mongodb |
bedType |
one of 'narrowPeak', 'broadPeak', 'chromHMM': contact developers for other types if desired |
dbname |
mongodb database name, used directly with system2('mongoimort ...') |
importCmd |
how to invoke 'mongoimport', default is to assume it can be found in PATH |
host |
host identifier for mongoimport, defaults to 127.0.0.1 |
if error encountered, return the try-error content, otherwise TRUE
1 2 3 4 5 6 7 8 9 10 | f1 = dir(system.file('bedfiles', package='TxRegInfra'), full=TRUE, patt='ENCFF971VCD')
f2 = dir(system.file('bedfiles', package='TxRegInfra'), full=TRUE, patt='E096_imp12')
if (verifyHasMongoCmd('mongoimport')) {
chk1 = importBedToMongo(f1, 'vjc1', db='txregnet')
stopifnot(chk1)
chk2 = importBedToMongo(f2, 'vjc2', db='txregnet', bedType='chromHMM')
stopifnot(chk2)
system2("mongo", args=c("txregnet", "--eval", "'db.vjc1.remove({})'"))
system2("mongo", args=c("txregnet", "--eval", "'db.vjc2.remove({})'"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.