Skip to contents

Package

Package overview and entry point

biocohort biocohort-package
biocohort: Subject and Sample Rosters for Omics Studies

Core Classes

S7 classes for study data structures

Study()
S7 Study class
Subject()
S7 Subject class
Cohort()
S7 Cohort class
AnalysisSpec()
S7 AnalysisSpec class
example_cohort
Example Cohort Dataset

Constructors

Create and validate objects

study_new()
Create a Study object
subject_new()
Create a Subject object
cohort_new()
Create a Cohort object
analysis_spec_new()
Create an AnalysisSpec object

Accessors

Read parts of a cohort

subject()
Build one Subject from a cohort
subjects()
Read the subject table of a cohort
samples()
Read the sample map of a cohort
completeness()
Per-assay sample counts for a cohort
cohort_filter()
Keep a subset of a cohort's subjects or assays

Quality control

Flag or drop subjects or samples, with an audit trail

cohort_qc()
Flag or drop subjects or samples for quality control
qc_log()
Read a cohort's QC log

Groups and contrasts

Group subjects and enumerate pairwise comparisons

cohort_groups()
Group a cohort's subjects by one or more columns
cohort_contrasts()
Every pairwise contrast between a cohort's groups

Derived columns

Bin a numeric column at named cutoffs, with provenance

cohort_derive()
Derive a column from cutoffs on an existing numeric column
derive_log()
Read a cohort's derived-column log

IO Functions

Read and write data

read_manifest()
Read and validate a long-format manifest file
read_manifest_csv()
Read and validate a long-format manifest CSV file
manifest_from_wide()
Reshape a wide sample table into a long-format manifest
write_manifest()
Write a manifest or a cohort's tables to a delimited file
cohort_save()
Save a cohort to an RDS file
cohort_read()
Read a cohort saved with cohort_save()

Analysis Registry

Register and list analyses

analysis_register()
Register an analysis specification in a cohort
analysis_list()
List registered analysis specifications
analysis_spec()
Retrieve an analysis specification from registry

Validation

Data validation functions

validate_manifest()
Validate and structure a long-format sample manifest
validate_cohort()
Validate a Cohort object

Samples

Work with the sample map

sample_pairs()
Derive sample pairs from a sample map

Pipeline sample sheets

Write the sample sheet a pipeline expects, and check its file paths

sample_sheet()
Write a pipeline sample sheet from a cohort
sample_sheet_templates()
List the built-in sample sheet templates
check_paths()
Check that a cohort's file paths exist on disk

Analysis loading

Read analysis feature tables from disk (experimental)

load_analysis()
Load an analysis's feature table from disk
load_analyses()
Load registered analyses into a cohort from disk
analysis_files()
Retrieve analysis file manifests from a cohort

Bridges

Carry cohort metadata into other analysis objects

as_coldata()
Build sample metadata for a count matrix
join_metadata()
Add cohort metadata to an analysis object

Cross-species translation

Translate features across assemblies and species (experimental)

translate()
Translate features (or a whole cohort) across species or assemblies
orthologize()
Deprecated alias for translate()
liftover_intervals()
Liftover a set of genomic intervals across assemblies or species
liftover_vcf()
Liftover a VCF of variants with CrossMap (allele-aware)
liftover_rtracklayer()
Liftover backend backed by rtracklayer
liftover_crossmap()
Liftover backend backed by CrossMap
register_liftover_backend()
Register a liftover backend
liftover_backends()
List registered liftover backends
ortholog_genes()
Map gene-level features to orthologs in another species
ortholog_babelgene()
Ortholog backend backed by babelgene
register_ortholog_backend()
Register a gene-ortholog backend
ortholog_backends()
List registered ortholog backends
translation_report()
Retrieve per-analysis translation results from a cohort
TranslationResult()
Result of a cross-species or cross-assembly translation
translation_stats()
Summary statistics for a translation

Project paths

Find the project root, build paths under it, and read a dotenv file

project_root()
Find the project root folder
project_path()
Build a path under the project root
ensure_dir()
Create a folder when it is absent
read_dotenv()
Read a dotenv file into the environment

Corrections

Apply documented overrides to a manifest and keep an audit trail

apply_corrections()
Apply documented corrections to a manifest
corrections_log()
Return the audit table of a corrected manifest
read_corrections()
Read a corrections table from a file

Study configuration

Declare a study, its manifest, and its analyses in one YAML file

read_study_yaml()
Build a cohort from a study YAML file
write_study_yaml()
Write a cohort as a study YAML file