Description Usage Arguments Details Value References See Also Examples
View source: R/link-ethoscope-metadata.R
These functions augment metadata so it can be subsequently loaded (with load_ethoscope).
1 2 3 4 | link_ethoscope_metadata_remote(x, remote_dir, result_dir,
index_file = "index.txt", overwrite_local = FALSE, verbose = TRUE)
link_ethoscope_metadata(x, result_dir = NULL, index_file = NULL)
|
x |
object such as a data.frame, or the name of a file (see detail) |
remote_dir |
the url of the result directory on the data server |
result_dir |
the directory where all data are saved |
index_file |
the name of an index_file, in |
overwrite_local |
whether to download all files.
The default, |
verbose |
whether to print progress (a logical) |
These function will augment metadata from two different types of inputs (x
):
A data.frame (recomended)
In this case, the function will try to match requested data with data available on result_dir
.
The provided data.table has typically one row per requested individual and the columns
(not necessarily in this order):
machine_name
– the name of the machine in which the individual was (e.g. "ETHOSCOPE_001"
)
date
– the start date of the experiment formatted as "YYYY-MM-DD"
region_id
– the ROI in which the animal was. When not provided, all regions are queried.
time
– the start time of the experiment formatted as "HH:MM:SS".
When not provided, and multiple experiment for the same machine exist, only the last one is loaded.
???
– any number of arbitrary columns* to associate conditions
/treatments
/genotypes
/... to the previous columns.
The name of a CSV file that contains a table as described in 1
.
A vector of .db
files to be read.
a data.table::data.table with the same rows as x, and extra columns for further data loading
metadata tutorial – how to work with metadata
load_ethoscope – to load the actual data
list_result_files – to list available file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Metadata with no region_id -> all regions will be loaded with the same metadata
dir <- paste0(scopr_example_dir(), "/ethoscope_results/")
data(no_region_id_metadata)
metadata <- link_ethoscope_metadata(no_region_id_metadata, dir)
print(metadata)
# Metadata with region_id -> only stated regions will be loaded with specific metadata
data(region_id_metadata)
metadata <- link_ethoscope_metadata(region_id_metadata, dir)
print(metadata)
## Not run:
# If your files are stored on a remote server,
# this will download to a local directory only the needed files
REMOTE <- "ftp://a/remote/server/"
LOCAL_DIR <- "/where/I/store/the/data/"
metadata <- link_ethoscope_metadata_remote(region_id_metadata,
REMOTE,
LOCAL_DIR)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.