clintval/sample-sheet

Review and update `add_sample` docstring

Closed this issue · 0 comments

Clearly describe the add_sample() method along with all validation checks performed.

def add_sample(self, sample):
"""Validate and add a ``Sample`` to this ``SampleSheet``.
All samples are checked against the first sample added to ensure they
all have the sample ``read_structure`` attribute, if supplied. The
``SampleSheet`` will inherit the same ``read_structure`` attribute.
Samples cannot be added if the following criteria is met:
- ``Sample_ID`` and ``Sample_Library`` combination exists
- ``index`` and/or ``index2`` combination exists
- Samplesheet.reads and Sample.Read_Structure are incompatible
- Sample does not have ``index`` defined but others do
- Sample does not have ``index2`` defined but others do
- If defined, sample ``read_structure`` is different than others
Parameters
----------
sample : Sample
Sample to add to this sample sheet.
"""