itpseq.Replicate

class itpseq.Replicate(*, replicate: str | None = None, filename: Path | None = None, sample: Sample | None = None, labels: dict | None = None, **kwargs)

Replicate instances represent a specific biological or experimental replicate of a Sample.

The purpose of the class is to handle, process, and analyze data corresponding to a replicate. Replicate objects provide methods to load associated data, compute statistical measures, and generate graphical representations such as sequence logos.

filename

Path to the file associated with the replicate. This file is expected to contain raw data relevant to the replicate.

Type:

Optional[Path]

sample

The sample object this replicate belongs to.

Type:

Optional[Sample]

replicate

Identifier or label for the replicate (e.g., “1”).

Type:

Optional[str]

labels

Dictionary of labels or metadata associated with the replicate.

Type:

Optional[dict]

name

Name of the sample, derived from sample.name if provided.

Type:

str

dataset

The DataSet the Sample belongs to, derived from sample.dataset if provided.

Type:

Any

kwargs

Additional keyword arguments and metadata stored as “meta” during initialization.

Type:

dict

Attributes:
dataset
sample_name

Methods

get_counts([pos])

Counts the number of reads for each motif or combination of amino-acid/position.

load_data([min_peptide, max_peptide, how, ...])

Reads the aminoacid inverse-toeprint file as a pandas Series, filters entries based on peptide length and stop codons.

logo([logo_kwargs, ax, fMet, type])

Generates a sequence logo based on the aligned inverse-toeprints, using the logomaker library.

rename([name])

Sets the name of the replicate from a parameter or automatically.

__init__(*, replicate: str | None = None, filename: Path | None = None, sample: Sample | None = None, labels: dict | None = None, **kwargs)

Methods

__init__(*[, replicate, filename, sample, ...])

get_counts([pos])

Counts the number of reads for each motif or combination of amino-acid/position.

load_data([min_peptide, max_peptide, how, ...])

Reads the aminoacid inverse-toeprint file as a pandas Series, filters entries based on peptide length and stop codons.

logo([logo_kwargs, ax, fMet, type])

Generates a sequence logo based on the aligned inverse-toeprints, using the logomaker library.

rename([name])

Sets the name of the replicate from a parameter or automatically.

Attributes

dataset

sample_name