After completing a stock assessment report, authors submit key assessment data to the Stock Information System (SIS) for inclusion in StockSmart.
This process has traditionally entailed entering data through a GUI
interface. The stockplotr::extract_sis_data() function
makes this process more efficient and reproducible by automating the
extraction of data from model results files and populating templates for
SIS submission. Afterwards, the asar::export_to_sis()
function sends the data to SIS. Below, we explain how this process
works.
This process fits within the following workflow:
SIS automatically assigns metadata and identifiers to the assessment.
Obtain two CSV files containing placeholders for all of the data
required by SIS: sis_assmt_template.csv (assessment summary
data) and sis_ts_template.csv (time series data) through
one of three ways:
Run stockplotr::extract_sis_data() to generate,
populate, and export the templates with data originating from a
converted model results file. At least one of the following
.rda files must be present in the figures/
and/or tables/ folders:
biomass_figure.rdaspawning_biomass_figure.rdaabundance_at_age_figure.rdafishing_mortality_figure.rdaindex_figure.rdatotal_catch_table.rdakey_quantities.csv file will also be present
(in the key_quantities_dir).Generate blank template files by running
asar::create_blank_sis().
Locate blank template files in the report/ folder
generated by running asar::create_template().
Open the templates and manually fill in any remaining required fields (including the metadata/IDs from Step 1).
Run asar::export_to_sis() to format and upload this
data to a specific Google Drive folder. In the future, this process may
occur via an API instead.
The SIS administrator will obtain the files and finalize the records.
extract_sis_data()This file contains metadata and identifiers for the assessment, as well as summary data for the stock. The columns are as follows:
This file is formatted to contain time series data for the stock. The columns are as follows:
extract_sis_data(); please see
the Provide additional
time series data section below for more information..rda
fileAs the main purpose of this function is to automate the extraction of
data into a SIS template, the function requires some data to be present
in the figures/ and/or tables/ folders. The
function will extract data from the .rda files created by
setting make_rda = TRUE in the following plotting
functions:
stockplotr::plot_biomass()stockplotr::plot_spawning_biomass()stockplotr::plot_abundance_at_age()stockplotr::plot_fishing_mortality()stockplotr::plot_index()stockplotr::table_total_catch()key_quantities.csv fileIf you’ve exported at least one stockplotr figure or
table, you should have a “key_quantities.csv” file. Data in this file
will also be extracted as follows:
These values are extracted and inserted into the key_quantities.csv
by running plot_fishing_mortality() and
plot_biomass():
| key_quantity | Assessment template “Value” |
|---|---|
| F.end.year | AS_LAST_DATA_YEAR |
| F.MSY.terminal | AS_FMSY |
| B.msy | AS_BMSY |
| B.msy.min | AS_BMSY_MIN |
| B.msy.max | AS_BMSY_MAX |
| B.terminal.year | AS_B_YEAR |
| F.terminal.year | AS_F_YEAR |
| F.target | AS_FTARGET |
| F.limit | AS_FLIMIT |
| B.terminal.est | AS_B_BEST |
| F.terminal.est | AS_F_BEST |
| B.terminal.min | AS_B_MIN |
| B.terminal.max | AS_B_MAX |
| F.terminal.min | AS_F_MIN |
| F.terminal.max | AS_F_MAX |
| F.MSY.terminal.max | AS_FMSY_MAX |
| F.MSY.terminal.min | AS_FMSY_MIN |
extract_sis_data() to populate additional fieldsYou will probably need to add information to the
sis_assmt_template.csv to ensure all required information
is added. You can do this before or after running
extract_sis_data().
A benefit of doing this before running
extract_sis_data() is that the function will use the
information provided to populate additional fields in the
sis_ts_template.csv file. For example, if you provide the
following information in the assessment template:
The extract_sis_data() workflow extracts at most one
time series for each category. However, you may have multiple time
series for a given category. You can add additional time series to the
sis_ts_template.csv file as per these rules: