cache | R Documentation |
Function to access and manage the cache. rxpCache()
returns the
central rpx
cache. pxCachedrojects()
prints the names of the
cached projects and invisibly returns the cache table.
rpxCache()
pxCachedProjects(cache = rpxCache(), rpxprefix = "^\\.rpx(2?)")
cache |
Object of class |
rpxprefix |
|
The cache is an object of class BiocFileCache
, and created with
BiocFileCache::BiocFileCache()
. It can be either the
package-wide cache as defined by rpxCache()
or an instaned
provided by the user.
When projects are cached, they are given a resource name (rname
)
composed of the .rpx
prefix followed by the ProteomeXchange
identifier. For example, project PXD000001
is named
.rpxPXD000001
(.rpx2PXD000001
for the PXDataset2
class) to
avoid any conflicts with other resources that user-created
resources.
The rpxCache()
function returns an instance of class
BiocFileCache
. pxCachedProjects()
invisbly returns a
tibble
of cached ProteomeXchange projects.
Laurent Gatto
## Default rpx cache
rpxCache()
## Not run:
## Set up your own cache by providing a file or a directory to
## BiocFileCache::BiocFileCache()
my_cache <- BiocFileCache::BiocFileCache(tempfile())
my_cache
px <- PXDataset("PXD000001", cache = my_cache)
pxget(px, "erwinia_carotovora.fasta", cache = my_cache)
## List of cached projects
pxCachedProjects() ## default rpx cache
pxCachedProjects(my_cache)
## To delete project a project from the default cache, first find
## its resource id (rid) in the cache
px1_cache_info <- pxCacheInfo(px)
(rid <- px1_cache_info["rid"])
## Then remove it with BiocFileCache:: bfcremove()
BiocFileCache:::bfcremove(my_cache, rid)
pxCachedProjects(my_cache)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.