Skip to contents

biocohort keeps the subjects, samples, and analysis outputs of a study in one validated object, called a Cohort. Species and assays are values in the data, not columns or classes, so the same functions work for a rat exome study, a mouse single-cell study, a proteomics study, or any other organism and assay.

From a manifest to a cohort

  • read_manifest() reads a manifest from CSV, TSV, or Excel and returns subject_tbl and sample_map. manifest_from_wide() reshapes a wide, one-row-per-subject table into the long form first.

  • validate_manifest() does the actual checking: it coerces every column to character, fills in role and species where they are missing, and splits subject-level columns from sample-level ones.

  • cohort_new() builds a Cohort from validated tables. study_new() attaches optional project metadata (title, aims, genome builds).

Reading a cohort

Quality control, groups, and derived columns

  • cohort_qc() flags or drops subjects or samples, with a required reason. qc_log() reads the audit trail every call appends to the cohort, which survives later cohort_filter() calls.

  • cohort_groups() groups a cohort's subjects by one or more columns. cohort_contrasts() enumerates every pairwise contrast between those groups, ready to filter one side against the other.

  • cohort_derive() bins an existing numeric column at named cutoffs and writes the result as a new column, so a cutoff is a value passed in, not code. derive_log() reads its provenance.

Writing files for other tools

Analysis outputs

Cross-species translation

Configuration

Data tables

  • subject_tbl: one row per subject. Always has subject_id and species, plus any other subject-level metadata (sex, genotype, strain, ...).

  • sample_map: one row per sample, in long format. Always has subject_id, assay, sample_id, and role. A new assay is a new row, never a new column.

  • completeness_tbl: one row per subject_id and assay pair, with the sample count.

Further reading

Three articles ship with the package. vignette("biocohort", package = "biocohort") walks through a manifest, a cohort, and a sample sheet end to end. vignette("glossary", package = "biocohort") defines the terms used across the package. vignette("naming-conventions", package = "biocohort") lists the standard names for columns, objects, and files.

Author

Maintainer: Samuel Bharti samuelbharti.io@gmail.com (ORCID) [copyright holder]

Authors:

Other contributors: