Skip to contents

Insert an a hypothetical inferred sample into the sample tree and set it as the parent of specified samples.

Usage

add_inferred_sample(
  tables,
  name,
  rank = NULL,
  samples = character(),
  parent_sample = NULL,
  display_name = "Inferred"
)

Arguments

tables

A list of tables (samples, phylogeny, compositions, ranks)

name

The name of the inferred sample to add

rank

The rank of the inferred sample

samples

A character vector of samples to set the inferred sample as their parent

parent_sample

The parent sample of the inferred sample. If NULL, the inferred root is used.

display_name

The display name of the inferred sample (default: "Inferred")

Value

A list of tables with a newly added inferred sample and updated parent relationships

Examples

jellyfisher_example_tables |>
  select_patients("EOC153") |>
  add_inferred_sample("EOC153_Inf",
                      2,
                      c("EOC153_iPer1_DNA4",
                        "EOC153_iOme1_DNA4",
                        "EOC153_iOvaR1_DNA1")) |>
  jellyfisher()