Skip to content

Reclassification with popcycle 3.1.0 or higher

Chris Berthiaume edited this page Aug 18, 2020 · 2 revisions

To reclassify (population classification, size estimation, carbon content) use the command-line script executable_scripts/reclassify.R or the popcycle function popcycle::reclassify.

Command-line

A typical reclassification using the command-line script would look something like this:

executable_scripts/reclassify.R --cores 2 other-dbs/HOT301.db HOT301/

other-dbs/HOT301.db should contain information in the vct, gating, poly, metadata, and outlier tables from a previous analysis that you'd like to reapply to data in HOT301. In HOT301 there should be OPP data in HOT301/HOT301_opp and there should be a database file with the same name as the source database. In this example it would be HOT301/HOT301.db.

This process will copy data in gating, poly, metadata, and outlier tables from other-dbs/HOT301.db into HOT301/HOT301.db. Any existing information in those tables in HOT301/HOT301.db will be overwritten. The vct table in HOT301/HOT301.db will be erased and then recreated during reanalysis. The source database other-dbs/HOT301.db will remain unchanged. By default, before any modifications, a backup copy of the target database at HOT301/HOT301.db will be created as HOT301/HOT301.db.backup-YYYY-MM-DD, and if a VCT folder already exists at HOT301/HOT301_vct a similar backup folder will be created.

If using more than one core, keep in mind the amount of physical memory required for each core scales with the largest OPP file processed. A good starting assumption is 3GiB of RAM per core, and if the run doesn't finish due to memory exhaustion then rerun with fewer cores / more memory reserved per core.

If you simply wish to recreate VCT data in-place, you would specify the source database to be the same file as the database in the target directory. e.g. executable_scripts/reclassify.R --cores 2 HOT301/HOT301.db HOT301/.

Run executable_scripts/reclassify.R --help for a full description of usage.

Library function

Since the command-line script is simply a wrapper for popcycle::reclassify, the same documentation applies to both.