itpseq.Sample.rename#

Sample.rename(name, rename_replicates=True)[source]#

Changes the name of the sample.

Parameters:
  • name (str) – name to use as the new name for the sample.

  • rename_replicates (bool) – If True (default), also rename the replicates based on the new sample name.

Examples

Rename the sample to “new_name”.
>>> print(sample)
Sample(sample:[1, 2, 3], ref: noa)
>>> sample.rename(name='new_name')
>>> print(sample)
Sample(new_name:[1, 2, 3], ref: noa)
>>> print(sample.replicates)
[Replicate(new_name.1), Replicate(new_name.2), Replicate(new_name.3)]