R/zzz.R

Defines functions .onLoad

###
###

.pkgname <- "BSgenome.Mtruncatula.JCVI.Medtrv4"

.seqnames <- c(paste("chr", 1:8, sep=""), paste("scaffold", setdiff(sprintf("%04d", 1:2179), c("0033", "0255", "0307", "0344", "0399", "0424", "0463", "0469", "0487", "0539", "0541", "0569", "0579", "0587", "0588", "0593", "0612", "0614", "0641", "0646", "0659", "0660", "0668", "0678", "0680", "0694", "0698", "0704", "0731", "0749", "0762", "0784", "0788", "0800", "0801", "0814", "0822", "0823", "0824", "0826", "0828", "0834", "0844", "0845", "0846", "0851", "0852", "0858", "0872", "0880", "0887", "0904", "0905", "0918", "0930", "0935", "0944", "0946", "0948", "0950", "0966", "0967", "0972", "0973", "0979", "0982", "0995", "1000", "1003", "1010", "1011", "1013", "1015", "1020", "1021", "1022", "1023", "1038", "1039", "1044", "1053", "1057", "1059", "1069", "1070", "1071", "1073", "1076", "1080", "1081", "1083", "1087", "1090", "1093", "1097", "1103", "1105", "1106", "1109", "1110", "1111", "1115", "1117", "1125", "1129", "1131", "1133", "1141", "1143", "1145", "1146", "1151", "1153", "1159", "1161", "1162", "1166", "1167", "1170", "1177", "1180", "1182", "1187", "1188", "1203", "1214", "1217", "1219", "1226", "1227", "1238", "1241", "1244", "1247", "1255", "1261", "1264", "1282", "1285", "1287", "1292", "1306", "1310", "1316", "1332", "1356", "1358", "1363", "1369", "1387", "1392", "1398", "1410", "1417", "1421", "1435", "1442", "1443", "1446", "1448", "1464", "1466", "1479", "1491", "1512", "1513", "1537", "1538", "1561", "1565", "1566", "1593", "1596", "1604", "1607", "1616", "1617", "1642", "1647", "1651", "1659", "1670", "1672", "1673", "1677", "1682", "1698", "1703", "1730", "1739", "1746", "1762", "1772", "1780", "1791", "1798", "1802", "1828", "1839", "1883", "1893", "1897", "1919", "1926", "1930", "1945", "1947", "1960", "1963", "1965", "1972", "1980", "1981", "2001", "2008", "2012", "2019", "2021", "2022", "2026", "2029", "2033", "2039", "2052", "2069", "2093", "2099", "2100", "2101", "2118", "2123", "2130",  "2131", "2145", "2153", "2163", "2172", "2174")), sep=""))

.circ_seqs <- NULL

.mseqnames <- NULL

.onLoad <- function(libname, pkgname)
{
    if (pkgname != .pkgname)
        stop("package name (", pkgname, ") is not ",
             "the expected name (", .pkgname, ")")
    extdata_dirpath <- system.file("extdata", package=pkgname,
                                   lib.loc=libname, mustWork=TRUE)

    ## Make and export BSgenome object.
    bsgenome <- BSgenome(
        organism="Medicago truncatula",
        common_name="Barrel Medic",
        provider="JCVI",
        provider_version="Mt4.0v1",
        release_date="Apr. 2014",
        release_name="Medicago truncatula Genome Project Mt4.0v1",
        source_url="http://jcvi.org/medicago/display.php?pageName=General&section=Download",
        seqnames=.seqnames,
        circ_seqs=.circ_seqs,
        mseqnames=.mseqnames,
        seqs_pkgname=pkgname,
        seqs_dirpath=extdata_dirpath
    )

    ns <- asNamespace(pkgname)

    objname <- pkgname
    assign(objname, bsgenome, envir=ns)
    namespaceExport(ns, objname)

    old_objname <- "Medtrv4"
    assign(old_objname, bsgenome, envir=ns)
    namespaceExport(ns, old_objname)
}
G-Thomson/BSgenome.Mtruncatula documentation built on May 6, 2019, 5:08 p.m.