File: createRedirection.Rd

package info (click to toggle)
r-bioc-alabaster.base 1.6.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,652 kB
  • sloc: cpp: 11,377; sh: 29; makefile: 2
file content (55 lines) | stat: -rw-r--r-- 1,857 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/createRedirection.R
\name{createRedirection}
\alias{createRedirection}
\alias{.createRedirection}
\title{Create a redirection file}
\usage{
createRedirection(dir, src, dest)
}
\arguments{
\item{dir}{String containing the path to the staging directory.}

\item{src}{String containing the source path relative to \code{dir}.}

\item{dest}{String containing the destination path relative to \code{dir}.
This may be any path that can also be used in \code{\link{acquireMetadata}}.}
}
\value{
A list of metadata that can be processed by \code{\link{writeMetadata}}.
}
\description{
\emph{WARNING: this function is deprecated. 
Redirection is no longer supported in the latest \pkg{alabaster} framework.}
Create a redirection to another path in the same staging directory.
This is useful for creating short-hand aliases for resources that have inconveniently long paths.
}
\details{
\code{src} should not correspond to an existing file inside \code{dir}.
This avoids ambiguity when attempting to load \code{src} via \code{\link{acquireMetadata}}.
Otherwise, it would be unclear as to whether the user wants the file at \code{src} or the redirection target \code{dest}.

\code{src} may correspond to existing directories.
This is because directories cannot be used in \code{acquireMetadata}, so no such ambiguity exists.
}
\examples{
# Staging an example DataFrame:
library(S4Vectors)
df <- DataFrame(A=1:10, B=LETTERS[1:10])
tmp <- tempfile()
dir.create(tmp)
info <- stageObject(df, tmp, path="coldata")
writeMetadata(info, tmp)

# Creating a redirection:
redirect <- createRedirection(tmp, "foobar", "coldata/simple.csv.gz")
writeMetadata(redirect, tmp)

# We can then use this redirect to pull out metadata:
info2 <- acquireMetadata(tmp, "foobar")
str(info2)

}
\author{
Aaron Lun
}