formatClones - Generate an ordered list of airrClone objects for lineage construction
formatClones takes a
tibble with AIRR or
Change-O style columns as input and masks gap positions, masks ragged ends,
removes duplicates sequences, and merges annotations associated with duplicate
sequences. If specified, it will un-merge duplicate sequences with different
values specified in the
traits option. It returns a list of
objects ordered by number of sequences which serve as input for lineage reconstruction.
formatClones( data, seq = "sequence_alignment", clone = "clone_id", subgroup = "clone_subgroup", id = "sequence_id", germ = "germline_alignment_d_mask", v_call = "v_call", j_call = "j_call", junc_len = "junction_length", mask_char = "N", max_mask = 0, pad_end = TRUE, text_fields = NULL, num_fields = NULL, seq_fields = NULL, add_count = TRUE, verbose = FALSE, collapse = TRUE, cell = "cell_id", locus = "locus", traits = NULL, mod3 = TRUE, randomize = TRUE, use_regions = TRUE, dup_singles = FALSE, nproc = 1, chain = "H", heavy = "IGH", filterStop = TRUE, minseq = 2, split_light = FALSE, majoronly = FALSE, columns = NULL )
- data.frame containing the AIRR or Change-O data for a clone. See makeAirrClone for required columns and their defaults
- name of the column containing observed DNA sequences. All sequences in this column must be multiple aligned.
- name of the column containing the identifier for the clone. All entries in this column should be identical.
- name of the column containing the identifier for the subgroup.
- name of the column containing sequence identifiers.
- name of the column containing germline DNA sequences. All entries
in this column should be identical for any given clone, and they
must be multiple aligned with the data in the
- name of the column containing V-segment allele assignments. All entries in this column should be identical to the gene level.
- name of the column containing J-segment allele assignments. All entries in this column should be identical to the gene level.
- name of the column containing the length of the junction as a numeric value. All entries in this column should be identical for any given clone.
- character to use for masking and padding.
- maximum number of characters to mask at the leading and trailing
sequence ends. If
NULLthen the upper masking bound will be automatically determined from the maximum number of observed leading or trailing Ns amongst all sequences. If set to
0(default) then masking will not be performed.
TRUEpad the end of each sequence with
mask_charto make every sequence the same length.
- text annotation columns to retain and merge during duplicate removal.
- numeric annotation columns to retain and sum during duplicate removal.
- sequence annotation columns to retain and collapse during duplicate
removal. Note, this is distinct from the
germarguments, which contain the primary sequence data for the clone and should not be repeated in this argument.
TRUEadd an additional annotation column called
COLLAPSE_COUNTduring duplicate removal that indicates the number of sequences that were collapsed.
- passed on to
TRUE, report the numbers of input, discarded and output sequences; otherwise, process sequences silently.
- collapse identical sequences?
- name of the column containing cell assignment information
- name of the column containing locus information
- column ids to keep distinct during sequence collapse
- pad sequences to length mutliple three?
- randomize sequence order? Important if using PHYLIP
- assign CDR/FWR regions?
- Duplicate sequences in singleton clones to include them as trees?
- number of cores to parallelize formating over.
- if HL, include light chain information if available.
- name of heavy chain locus (default = “IGH”)
- only use sequences that do not contain an in-frame stop codon
- minimum number of sequences per clone
- split or lump subgroups? See
- only return largest subgroup and sequences without light chains
- additional data columns to include in output
A tibble of airrClone objects containing modified clones.
This function is a wrapper for makeAirrClone. Also removes whitespace, ;, :, and = from ids
data(ExampleAirr) # Select two clones, for demonstration purpose sel <- c("3170", "3184") clones <- formatClones(ExampleAirr[ExampleAirr$clone_id %in% sel,],traits="sample_id")