Subcommands

Subcommands#

preprocess#

Preprocessing ensures that the provided dataset is suitable for processing by the analyse command by, for example, sanitizing strings, warning about missing values, and checking whether the species column remains consistent with name, morph, and phase, provided they are present.

Default checks suitable for minimal dataset (columns coord_x, coord_y, species) are performed automatically with several others available when the input has specific columns to be checked.

While preprocess writes modified encounters dataset as output there is only a limited subset of fixes that can be applied automatically. Namely discarding rows with null values and cleaning strings with unusual whitespaces.

Users need to read the console output, evaluate whether preprocess observations are warranted for their use-case and modify their data themselves.

Example:

seal preprocess --dataset ./datasets/raw.csv --output ./datasets/clean.csv
analyse#

The command that does the heavy lifting and analyses given data according to configuration set in taskfile.

seal analyse --taskfile ./tasks/example-task.toml
plot#

This subcommand ingests a taskfile used for previous analyses to detect results of previous analyses and present them as plots.

Generated plots will be saved to the same directory as analysis results.

Warning

Plotting is not the main focus of seal, the primary output is the data resulting from the analyses. While we try our best, it is not feasible to ensure every possible combination of grid size and species renders correctly and without overlaps. Users are encouraged to simply load the CSV output from the analyse subcommand into their favorite tool to create their own visualizations or to modify the code of plotting to fit their needs.

Example:

seal plot --taskfile ./tasks/example-task.toml
misc#

misc subcommand is a collection of helpers and opinionated convenience tools originating from our own needs. These may or may not be useful to others.

seal misc --help
sar-quantify#

Quantify spp. difference between levels based on results from species–area relationship analysis.

seal misc sar-quantify ./results/sar-aux-data.csv ./results/sar-quant.csv
ct#

Pass to to indicate that sar-aux-data was generated using contiguous transects strategy.

adjust-grid#

adjust-grid will crop grid edges as necessary to be suitable for chosen strategy and levels. It will not, however, adjust the grid to fit every analysis (notably spatial, we strongly recommend adjusting the grid manually before running this analysis).

Note

Adjustments that minimize loss of encounters, species and area will be preferred in this order.

seal misc adjust-grid --taskfile ./tasks/example-task.toml --output ./adjusted/
check-quadrat-list#

Check quadrat list for duplicates, malformed coordinates, missing values, and unrecognized columns.

seal misc check-quadrat-list ./tests/datasets/qlists/invalid.csv
convert-aopk#

Convert an AOPK dataset (from https://portal.nature.cz/nd/) for preprocessing and analysis.

Columns expected in the input: DRUH, DATI_INSERT, SITMAP, POCET

seal misc convert-aopk ./datasets/aopk-raw.csv ./expected/aopk-conv.csv

Output columns: coord_x,coord_y,species,date,individuals

convert-biolib#

Convert a BioLib dataset (from https://www.biolib.cz/cz/speciesmappings) for preprocessing and analysis.

Columns expected in the input: CREATED, DAY, LATIN, MONTH, SUBSQ, SQUARE, QUANTITY, YEAR

seal misc convert-biolib ./datasets/biolib-raw.csv ./tests/expected/biolib-conv.csv

Output columns: species,individuals,date,coord_x,coord_y

Note

Quadrat list with KFME coordinates for Czechia is available in our repository.