Replicate#

Constructor#

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

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[source]

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[source]

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:
aa_filename
dataset
filename
json_filename
sample_name

Methods

copy([sample, replicate, name])

Creates a copy of the replicate.

get_counts([pos])

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

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

Reads the nucleotide/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.

infos

Methods#

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

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

Replicate.rename([name])

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

Replicate.get_counts([pos])

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

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

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