Collect the typed result of a finished NLME job
collectJob.RdPolls a backgrounded NlmeJob via NlmeJobStatus until
the engine reports "Finished", then materialises the typed result.
Remote-results download (when applicable) and CSV/log parsing are handled
by the class-specific method body. collectJob() is the single
canonical entry point for any runInBackground = TRUE run.
Usage
collectJob(job, timeout = Inf, pollInterval = 5, ...)
# S4 method for class 'BootNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)
# S4 method for class 'FitNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)
# S4 method for class 'StepwiseNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)
# S4 method for class 'ShotgunNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)
# S4 method for class 'ProfileNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)
# S4 method for class 'SortByNlmeJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)
# S4 method for class 'NlmeSimulationJob'
collectJob(job, timeout = Inf, pollInterval = 5, ...)Arguments
- job
An NLME job object returned by a wrapper invoked with
runInBackground = TRUE(bootstrap,fitmodel,stepwiseSearch,shotgunSearch,profilePertubate,sortfit,vpcmodel,simmodel).- timeout
Maximum time to wait, in seconds.
Inf(the default) waits indefinitely.- pollInterval
Seconds between status checks. Defaults to 5.
- ...
Reserved for class-specific arguments; currently unused.
Value
A class-specific result object. For BootNlmeJob, an
rsnlme_boot. For FitNlmeJob and SortByNlmeJob,
the same result list fitmodel / sortfit
produces. For StepwiseNlmeJob and ShotgunNlmeJob, an
scmSearchResult (zero-row when Overall.csv is missing).
For ProfileNlmeJob, a profileResult data frame (zero-row
when Profile.csv is missing). For NlmeSimulationJob, the
same named list of data.tables that vpcmodel /
simmodel produces, with additive
runMode/runTime/RsNLMEVersion list elements.
Details
Background jobs are only started on Linux hosts (local hostType
"linux" or remote "linux" / "RHEL" / "UBUNTU").
Wrappers on Windows do not support runInBackground = TRUE; see
?fitmodel for the platform rule shared by all job executors.
Dispatches on BootNlmeJob, FitNlmeJob,
StepwiseNlmeJob, ShotgunNlmeJob,
ProfileNlmeJob, SortByNlmeJob, and
NlmeSimulationJob (the shared class behind both
vpcmodel and simmodel, discriminated by its
validated runMode slot).
Functions
collectJob(BootNlmeJob): Wait for a backgroundedBootNlmeJobto finish and return itsrsnlme_boot. Downloads remote artefacts idempotently whenfile.path(localDir, "BootOverall.csv")is absent, then reads the bootstrap CSVs fromjob@localDirinto the typedrsnlme_boot(forwardingjob@bootfor replicate counts / confidence level andjob@argsList$enginefor the engine attribute) and – ifjob@saveResultisTRUE– writes the result to<localDir>/bootstrap_<sanitizedModelName>_<YYYYMMDD_HHMMSS>.rds, wheresanitizedModelNameisjob@model@modelInfo@modelNamewith every character outside[A-Za-z0-9._-]replaced by_(falling back tomodelwhen empty) and the timestamp isjob@runStartformatted asYYYYMMDD_HHMMSSin local time.collectJob(FitNlmeJob): Wait for a backgroundedFitNlmeJobto finish and return the same result list thatfitmodel's foreground branch produces. Downloads remote artefacts idempotently whenfile.path(localDir, "nlme7engine.log")is absent, then reads engine outputs via.get_resultList()and – ifjob@saveResultisTRUE– writes the result to<localDir>/fitmodel_<sanitizedModelName>_<YYYYMMDD_HHMMSS>.rds, wheresanitizedModelNameisjob@model@modelInfo@modelNamewith every character outside[A-Za-z0-9._-]replaced by_(falling back tomodelwhen empty) and the timestamp isjob@runStartformatted asYYYYMMDD_HHMMSSin local time.collectJob(StepwiseNlmeJob): Wait for a backgroundedStepwiseNlmeJobto finish and return the samescmSearchResultthatstepwiseSearch's foreground branch produces. Downloads remote artefacts idempotently whenfile.path(localDir, "Overall.csv")is absent, then reads the search results via.read_covsearch_results()(which archives the run folder whenjob@archiveResultsisTRUE) and applies the stepwise-onlyBestScenarioflag fromStepwise.txt. Returns an emptyscmSearchResult(zero-row,searchTypeattribute set) whenOverall.csvis missing.collectJob(ShotgunNlmeJob): Wait for a backgroundedShotgunNlmeJobto finish and return the samescmSearchResultthatshotgunSearch's foreground branch produces. Downloads remote artefacts idempotently whenfile.path(localDir, "Overall.csv")is absent, then reads the search results via.read_covsearch_results()(which archives the run folder whenjob@archiveResultsisTRUE). Returns an emptyscmSearchResult(zero-row,searchTypeattribute set) whenOverall.csvis missing.collectJob(ProfileNlmeJob): Wait for a backgroundedProfileNlmeJobto finish and return the sameprofileResultthatprofilePertubate's foreground branch produces. Downloads remote artefacts idempotently whenfile.path(localDir, "Profile.csv")is absent, then reads the profile table via.read_profile_results()and – ifjob@saveResultisTRUE– writes a self-describingprofile_<sanitizedModelName>_<YYYYMMDD_HHMMSS>.rdsalongside the result, wheresanitizedModelNameisjob@model@modelInfo@modelNamewith every character outside[A-Za-z0-9._-]replaced by_(falling back tomodelwhen empty) and the timestamp isjob@runStartformatted asYYYYMMDD_HHMMSSin local time. Returns an emptyprofileResult(zero-row,runMode = "profile"attribute set) whenProfile.csvis missing.collectJob(SortByNlmeJob): Wait for a backgroundedSortByNlmeJobto finish and return the same result list thatsortfit's foreground branch produces. Downloads remote artefacts idempotently whenfile.path(localDir, "nlme7engine.log")is absent, then reads engine outputs via.get_resultList()(the shared fitmodel/sortfit reader) withrunMode = "sortfit"and – ifjob@saveResultisTRUE– writes the result to<localDir>/sortfit_<sanitizedModelName>_<YYYYMMDD_HHMMSS>.rds, wheresanitizedModelNameisjob@model@modelInfo@modelNamewith every character outside[A-Za-z0-9._-]replaced by_(falling back tomodelwhen empty) and the timestamp isjob@runStartformatted asYYYYMMDD_HHMMSSin local time.collectJob(NlmeSimulationJob): Wait for a backgroundedNlmeSimulationJob(constructed by eithervpcmodelorsimmodel) to finish and return the same named list ofdata.tables the foreground branch produces. Sentinel is mode-specific:predout.csvwhenjob@params@isPopulationisTRUE(population runs), otherwisesimout.csv(individual runs). Reads the engine output via.read_vpcsim_results()and attaches the canonicalrunMode/runTime/RsNLMEVersionlist elements.