-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from AgentschapPlantentuinMeise/refactorreadme
Refactorreadme
- Loading branch information
Showing
7 changed files
with
113 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Code | ||
Different scripts can be found in the /src folder. | ||
|
||
### Two scripts to calculate MIDS levels based on a a given JSON schema | ||
`parse_json_schema.R` | ||
* 2 functions: | ||
* read_json_mids_criteria(file): uses the MIDS sections of the JSON schema and returns criteria per MIDS level | ||
* read_json_unknownOrMissing(file): uses the unknownOrMissing section of the JSON schema and returns a list of these values | ||
* no need to run this separately, is loaded in MIDS-calc.R | ||
|
||
`MIDS-calc.R` | ||
* given a JSON schema and a dataset, this script calculates for each record which criteria are met and the MIDS level | ||
|
||
### Package checker | ||
`packages.R` | ||
* required packages (excluding imported packages) for the app. These will be auto-installed when running the app if not present and are also used to build the installer. | ||
|
||
### Installer generator | ||
`rinno_installer.R` | ||
* this script is not used by the app. It is run separately to generate an installer using RInno setup. [More info](/help/rinno_installer.md). | ||
|
||
### Shiny app | ||
Code for the Shiny app can be found in the /src/Shiny_MIDS folder. | ||
|
||
`MIDScalcApp.R` | ||
* main code for the app | ||
|
||
/src/Shiny_MIDS/R folder contains 4 modules: | ||
* `CloseTabModule.R` | ||
* allows to close results tabs | ||
* `InteractiveSchemaModule.R` | ||
* allows to edit the MIDS implementation interactively | ||
* `ResultsModule.R` | ||
* calculates MIDS levels and which criteria are met | ||
* opens a tab showing the results for each analysis | ||
* allows to export results to csv | ||
* `ViewImplementationModule.R` | ||
* allows to visualize the MIDS implementation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Installation | ||
The latest self-contained windows installer (generated using Inno Setup) can be found here: https://drive.google.com/drive/folders/1ioRhHIvdYI88yoPTsYLG_k5-8n-05CiP Note that this installer will install (a more recent) version of R if it is not available on your system already. The app currently works with R 4.2.0. It may function with older versions of R, but this cannot be guaranteed. | ||
|
||
Alternatively, you can download (or clone) the contents of this repository and run the code yourself using your local R instance. Running the `app.R` file should launch the app in your browser. Required R packages should automatically be installed if not present already during the first launch of the app. | ||
|
||
Due to the large memory requirements this app may pose, calculating scores for millions of specimens, a web-hosted version of this app is currently not available. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Using the app | ||
|
||
### Submit data | ||
|
||
On the app's initial interface, a zipped GBIF annotated Darwin Core Archive or a comma or tab separated occurrence file can be uploaded (max 5GB). During local use of the app, this simply means the dataset will be loaded into your local memory. | ||
|
||
Also on the interface, the MIDS implementation to be used can be viewed, as specified by the JSON schema. The schema lists all MIDS elements and how they are mapped to properties in the uploaded dataset. You can either choose the default schema included in the app or upload a custom schema from file. It is also possible to choose to edit this schema interactively in the app. The interactive editing opens in a pop-up window, where in a first tab, MIDS elements can be added, removed, or moved to another MIDS level. In addition, mappings can be removed or added by clicking the "edit" icon of a MIDS element. In a second tab, the Unknown or Missing section of the schema can be edited, i.e. new properties and new values can be added. This interactively edited schema can be saved to file (JSON). The schema (be it default, custom or interactive) can be viewed by clicking the eye icon, which opens a human-friendly visualization of the MIDS schema, so that it is not necessary to read the JSON file to be able to understand the specifics of the MIDS schema used. Once a dataset and a MIDS implementation have been chosen, calculations can be started by clicking "Start MIDS score calculations". | ||
|
||
### Results | ||
|
||
The results of each analysis are visualized on a new page, where it is possible to explore summaries of the results of both MIDS levels and MIDS elements, either as plots or as tables. The MIDS element plot can be clicked to get more details on the results of the mappings of that element. It is also possible to explore the complete records table with the MIDS results for each record, and to download it as a csv file. In addition, the data can be filtered to see how MIDS results change when filtering on properties such as country code /taxonomic group/ collection date. The filename of the dataset is shown, as well as the used MIDS implementation, to make the provenance of the calculations clear.' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Structure of the JSON schema | ||
|
||
### Metadata: | ||
|
||
* `schemaName`: A label for the schema, no use outside of human readability. | ||
* `schemaVersion`: Simple version tracker for when a schema receives an update. | ||
* `date`: Date (and optionally time) for when this schema version was created. More reliable versioning property than schemaVersion. | ||
* `schemaType`: Should always be `MIDScalculator`. | ||
|
||
### unknownOrMissing | ||
|
||
This section lists values for properties that are to be understood as absence, rather than presence, of data. That is, these are known values that indicate absence of data. | ||
|
||
If no `property` is listed for a value, the value is applied to any property mapped to a MIDS element. If a property is listed, the value is only ignored for that property. | ||
|
||
A `midsAchieved` flag is always present and typically `false`, to indicate this value is to be understood as absence. The schema parser does support negation, that is, a MIDS level that requires a certain property to be absent of data. This is implemented by specifying the `operator` as `NOT`. To ignore certain values for such a mapping, the `midsAchieved` flag would be `true`. Note that negation is currently not part of the default schema and also not supported in the interactive schema editor in the app (only by manually editing the JSON). | ||
|
||
### MIDS levels | ||
|
||
The four levels have their own section each. Each level should have at least one element as a condition, but can otherwise have any number of elements. | ||
|
||
Within an element, the mappings for this element are listed. Mappings to multiple properties in the data source are possible, and requirements of `OR` or `AND` can be set to specify the logic of the mapping. The operator `NOT` is also supported, but currently not part of the schema (anymore) and it is not implemented in the interface that enables interactive schema editing. Example of a more complex mapping for a Location term (note that this particular mapping is a suggestion, not currently agreed in the latest official MIDS draft): | ||
|
||
``` | ||
"Location": [ | ||
{ | ||
"property": [ | ||
"decimalLatitude", | ||
"decimalLongitude" | ||
], | ||
"operator": "AND" | ||
}, | ||
{ | ||
"property": [ | ||
"locality", | ||
"county", | ||
"verbatimLocality" | ||
], | ||
"operator": "OR" | ||
} | ||
] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Installer creation using RInno | ||
* Follow instructions on https://github.com/ficonsulting/RInno to install the RInno package and the RInno Setup software. | ||
* If Windows version not supported (64bit), install with installr following instructions here https://github.com/ficonsulting/RInno/issues/118#issuecomment-460094226 | ||
* To create the installer, run [rinno_installer.R.](/src/rinno_installer.R) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
You have now succesfully installed the MIDSCalculator app. Running the executable file should launch the app in your Chrome browser. If you encounter any problems, you can find support at https://github.com/AgentschapPlantentuinMeise/MIDSCalculator/issues . | ||
You have now succesfully installed the MIDSCalculator app. Running the executable file should launch the app in your browser. If you encounter any problems, you can find support at https://github.com/AgentschapPlantentuinMeise/MIDSCalculator/issues . |