Naming conventions

This article lists the standard names biocohort uses for columns, R objects, functions, and files.

Column names

Subject-level metadata (subject_tbl)

Column Type Description
subject_id character A unique subject ID. Works the same for any species.
species character The subject’s species, for example “rat” or “mouse”. Free-form, not a fixed list, and stored lower case.
sex character Biological sex: “M”, “F”, or NA if unknown.
strain character Strain or breed, for example “Fischer 344” or “B6”.
genotype character Genetic background or modification, for example “WT”, “KO”, “HET”.
cohort character Treatment group or cohort membership, for example “Control”, “Treatment_A”.
timepoint character Study visit, age, or collection date, for example “Day_0”, “Week_12”, “8wks”.
notes character Free-form annotations.

Sample mapping columns (sample_map)

sample_map is the canonical, long-format sample table: one row per sample, covering any number of assays and roles. A new assay is a new row, never a new column or a new table.

Column Type Description
subject_id character Reference to a subject in subject_tbl.
assay character The assay, a free-form value, for example "wgs", "wes", "atac", "bulk_rna", "scrna".
sample_id character A unique sample ID.
role character The sample’s role within its assay, for example "tumor", "normal", or NA when it does not apply.

Other sample-level columns, such as fastq_1, fastq_2, bam, lane, or replicate, stay in sample_map when validate_manifest() already knows the name, or when it is passed in the sample_cols argument. A column that varies within a subject but is not recognized or declared trips the subject-level conflict check instead.

Completeness summary columns (completeness_tbl)

Column Type Description
subject_id character Reference to a subject in subject_tbl.
assay character The assay, matching values in sample_map.
n_samples integer Sample count for the subject within the assay.

Assay type values

assay is a free-form, lowercase value, not a fixed list. Pick a stable label per assay and reuse it. Common examples:

Assay Code Description
Whole genome sequencing "wgs" Whole genome DNA sequencing.
Whole exome sequencing "wes" Exome capture and sequencing.
ATAC-seq "atac" Chromatin accessibility.
Bulk RNA-seq "bulk_rna" Bulk transcriptomics.
Single-cell / single-nucleus RNA-seq "scrna" Single-cell or single-nucleus transcriptomics.

Sample ID formats

biocohort does not enforce a sample ID format. Pick one convention for a project and keep it. Putting the assay and role in the ID makes it easier to read:

Tumor and normal pairs are not stored in sample_map. Derive them on demand with sample_pairs(), which builds a pair_id of {tumor_sample_id}__{normal_sample_id}, for example "wes_T101__wes_N101".

Object names

R objects and variables

Example object creation

# Study
study <- study_new(
  study_id = "STUDY_001",
  title = "Example Genomics Study"
)

# Cohort
cohort <- cohort_new(
  subject_tbl = subject_data,
  sample_map = sample_data,
  study = study
)

# Read one subject as a Subject object
rat_101 <- subject(cohort, "RAT_101")

# Read a stored analysis result
result <- cohort@analyses[["my_analysis_name"]]

Function names

File names

Package code files

Data files

Example manifest file names

manifest_pilot_wes_rna_v1.csv
manifest_pilot_cohort.csv
cohort_complete_metadata.csv

Variable and parameter naming

Documentation and markdown

A quick check before adding something new


Further reading

See the Glossary article for what these terms mean.