countClones - Tabulates clones sizes
Description¶
countClones determines the number of sequences and total copy number of
clonal groups.
Usage¶
countClones(
data,
groups = NULL,
copy = NULL,
clone = "clone_id",
remove_na = TRUE
)
Arguments¶
- data
- data.frame with columns containing clonal assignments.
- groups
- character vector defining
datacolumns containing grouping variables. Ifgroups=NULL, then do not group data. - copy
- name of the
datacolumn containing copy numbers for each sequence. If this value is specified, then total copy abundance is determined by the sum of copy numbers within each clonal group. - clone
- name of the
datacolumn containing clone identifiers. - remove_na
- removes rows with
NAvalues in the clone column ifTRUEand issues a warning. Otherwise, keeps those rows and considersNAas a clone in the final counts and relative abundances.
Value¶
A data.frame summarizing clone counts and frequencies with columns:
clone_id: clone identifier. This is the default column name, specified withclone='clone_id'. If the function call uses Change-O formatted data andclone='CLONE', this column will have nameCLONE.seq_count: total number of sequences for the clone.seq_freq: frequency of the clone as a fraction of the total number of sequences within each group.copy_count: sum of the copy counts in thecopycolumn. Only present if thecopyargument is specified.copy_freq: frequency of the clone as a fraction of the total copy number within each group. Only present if thecopyargument is specified.
Also includes additional columns specified in the groups argument.
Examples¶
# Without copy numbers
clones <- countClones(ExampleDb, groups="sample_id")
# With copy numbers and multiple groups
clones <- countClones(ExampleDb, groups=c("sample_id", "c_call"), copy="duplicate_count")