-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_EMLassemblyline.R
101 lines (77 loc) · 3.29 KB
/
run_EMLassemblyline.R
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This script executes an EMLassemblyline workflow.
# Initialize workspace --------------------------------------------------------
# Update EMLassemblyline and load
# remotes::install_github("EDIorg/EMLassemblyline")
library(EMLassemblyline)
# Define paths for your metadata templates, data, and EML
path_templates <- "~/Documents/Research/EDI/UMBS_Weather_Data/metadata/templates"
path_data <- "~/Documents/Research/EDI/UMBS_Weather_Data"
path_eml <- "~/Documents/Research/EDI/UMBS_Weather_Data/metadata/eml"
# Create metadata templates ---------------------------------------------------
# Below is a list of boiler plate function calls for creating metadata templates.
# They are meant to be a reminder and save you a little time. Remove the
# functions and arguments you don't need AND ... don't forget to read the docs!
# E.g. ?template_core_metadata
# Create core templates (required for all data packages)
EMLassemblyline::template_core_metadata(
path = path_templates,
license = "CCBY",
write.file = TRUE)
# Create table attributes template (required when data tables are present)
EMLassemblyline::template_table_attributes(
path = path_templates,
data.path = path_data,
data.table = c("weather.csv"))
# Create categorical variables template (required when attributes templates
# contains variables with a "categorical" class)
EMLassemblyline::template_categorical_variables(
path = path_templates,
data.path = path_data)
# Create geographic coverage (required when more than one geographic location
# is to be reported in the metadata).
EMLassemblyline::template_geographic_coverage(
path = path_templates,
data.path = path_data,
data.table = "",
lat.col = "",
lon.col = "",
site.col = "")
# Create taxonomic coverage template (Not-required. Use this to report
# taxonomic entities in the metadata)
remotes::install_github("EDIorg/taxonomyCleanr")
library(taxonomyCleanr)
taxonomyCleanr::view_taxa_authorities()
EMLassemblyline::template_taxonomic_coverage(
path = path_templates,
data.path = path_data,
taxa.table = "",
taxa.col = "",
taxa.name.type = "",
taxa.authority = 3)
# Make EML from metadata templates --------------------------------------------
# Once all your metadata templates are complete call this function to create
# the EML.
E <- "-84.669381"
N <- "45.561608"
S <- "45.558932"
W <- "-84.679608"
Pid <- "edi.549.4"
Sid <- "edi.65.1"
EMLassemblyline::make_eml(
path = path_templates,
data.path = path_data,
eml.path = path_eml,
dataset.title = "University of Michigan Biological Station Weather Observations 1980 to Present",
temporal.coverage = c("1980-01-01", "2020-04-30"),
geographic.description = "University of Michigan Biological Station, Douglas Lake, MI",
geographic.coordinates = c(N, E, S, W),
maintenance.description = "ongoing",
data.table = "weather.csv",
data.table.name = "UMBS Weather 1980 to Present",
data.table.description = "Daily temperature, precipitation, and cloud cover data",
other.entity = c("UMBS_Weather_Cleaning.Rmd", "src.zip"),
other.entity.name = c("R script for data formatting and cleaning", "Source data for R script"),
other.entity.description = c("R script for data formatting and cleaning", "Source data for R script"),
user.id = "umbiologicalstat",
user.domain = "EDI",
package.id = Pid)