Dna.set_ids_from_cols
Dna.set_ids_from_cols#
- Dna.set_ids_from_cols(col_names: List[str]) None #
Rename the ids based on columns
- Parameters
- col_names:
List of column names used to rename the ids
- Raises
- ValueError:
When one of the col_names was not found in the column attributes or the column is not one dimensional
Notes
This method modifies the id column attribute and stores the original values in the original_id column attribute. In case of duplicate values a number is appended to make each id unique.
Examples
>>> import missionbio.mosaic.io as mio >>> sample = mio.load_example_dataset("3 cell mix") >>> sample.cnv.set_ids_from_cols(["CHROM", "start_pos", "gene_name"]) >>> sample.cnv.ids()[0] ... "1:115256488:NRAS"