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_filenameFile name for the amino-acid inverse toeprints for the replicate
datasetLinked DataSet name (if any)
filenameFile name for the nucleotide inverse toeprints for the replicate
json_filenameFile name for the JSON metadata for the replicate
sample_nameLinked Sample name (if any)
Methods
copy([sample, replicate, name])Creates a copy of the replicate.
format_sequences([codons, aa, ...])Formats a nucleotide inverse toeprint file in a custom human-readable format
get_counts([pos, how])Counts the number of reads for each motif or combination of amino-acid/position.
infos()Returns the Replicate metadata from the JSON file
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.
Methods#
|
Reads the nucleotide/aminoacid inverse-toeprint file as a pandas Series, filters entries based on peptide length and stop codons. |
|
Sets the name of the replicate from a parameter or automatically. |
|
Counts the number of reads for each motif or combination of amino-acid/position. |
|
Generates a sequence logo based on the aligned inverse-toeprints, using the logomaker library. |