itpseq.Sample.copy#
- Sample.copy(name=None, reference=<no_default>)[source]#
Creates a copy of the sample.
- Parameters:
name (str, optional) – New name for the sample.
reference (Sample or None, optional) – If a parameter is used, this will set it as the reference sample.
- Returns:
A new Sample object with the same data as the original sample and optionally an updated name and reference.
- Return type:
Sample
Examples
- Create a copy of “sample” and change its name to “new_name”.
>>> new_sample = sample.copy(name='new_name') >>> print(new_sample) Sample(new_name:[1, 2, 3], ref: ref_name)
- Create a copy of “sample” with “sample2” as reference.
>>> new_sample = sample.copy(reference=sample2) >>> print(new_sample) Sample(new_name:[1, 2, 3], ref: sample2)