Read or return path to FlyWire annotations manuscript supplementary file
Source:R/release-data.R
flywire_sirepo_file.Rd
flywire_sirepo_file_memo()
is a memoised version with a 5
minute timeout
Arguments
- p
Relative path to file within flywire_annotations repository
- mustWork
Whether the path must exists (default
NA
=>TRUE
when reading the file)- read
Whether to read the file. Either a logical value or a function. When
TRUE
andp
is a tsv or csv file a default read function is used (see details).- version
An integer CAVE materialisation version (see
flywire_connectome_data_version
)- ...
Additional arguments passed to the function determined by the
read
argument (typicallydata.table::fread
).
Value
A path or (when read=TRUE
or a function) the result of reading
the file (a data.table
for csv/tsv files).
Details
When TRUE
and p
is a tsv or csv file them the
data.table::fread
function is used in order to ensure that 64
bit integers are correctly parsed. The default behaviour is to read ids as
character vectors but this can be overridden (see examples).
Examples
if (FALSE) {
annpath=flywire_sirepo_file('supplemental_files/Supplemental_file1_annotations.tsv',
read=FALSE)
# read in annotation file
anns=flywire_sirepo_file('supplemental_files/Supplemental_file1_annotations.tsv',
read = TRUE)
# read in annotation file with ids as 64 bit integers rather than strings
anns=flywire_sirepo_file('supplemental_files/Supplemental_file1_annotations.tsv',
read = TRUE, integer64="integer64")
# same but memoised to avoid checking github / re-reading file
anns=flywire_sirepo_file_memo('supplemental_files/Supplemental_file1_annotations.tsv',
read = TRUE, integer64="integer64")
}