dandelion.utilities.update_metadata

dandelion.utilities.update_metadata(self, retrieve=None, locus=None, clone_key=None, split=True, collapse=True, combine=True, split_locus=False, collapse_alleles=True, reinitialize=False, verbose=False)[source]

A Dandelion initialisation function to update and populate the .metadata slot.

Parameters
  • self (Dandelion) – Dandelion object.

  • retrieve (str, sequence, optional) – Column name in .data slot to retrieve and update the metadata.

  • locus (str, optional) – Mode for creating metadata. None defaults to ‘ig’. Currently only accepts ‘ig’.

  • clone_key (str, optional) – Column name of clone id. None defaults to ‘clone_id’.

  • split (bool) – Only applies if retrieve option is not None. Returns the retrieval splitted into two columns, e.g. one for heavy and one for light chains in BCR data, if True. Interacts with collapse, combine and split_locus options.

  • collapse (bool) – Only applies if retrieve option is not None. Returns the retrieval as a collapsed entry if multiple entries are found (e.g. v genes from multiple contigs) where each entry will be separated by a ‘|’ if True. Interacts with split, combine and split_locus options.

  • combine (bool) – Only applies if retrieve option is not None. Returns the retrieval as a collapsed entry with only unique entries (separated by a ‘|’ if multiple are found). Interacts with split, collapse, and split_locus options.

  • split_locus (bool) – Only applies if retrieve option is not None. Similar to split except it returns the retrieval splitted into multiple columns corresponding to each unique element in the ‘locus’ column (e.g. IGH, IGK, IGL). Interacts with split, collapse, and combine options.

  • collapse_alleles (bool) – Returns the V-D-J genes with allelic calls if False.

  • reinitialize (bool) – Whether or not to reinitialize the current metadata. Useful when updating older versions of dandelion to newer version.

  • verbose (bool) – Whether or not to print warning messages when constructing object.

Returns

Return type

Dandelion object with .metadata slot initialized.