Fold Change¶
Raw fold-change comparison: b / a per aligned pair. No pseudocount,
no normalization, no statistics. Apply add_pseudocount() to your tracks
before calling interval_fold_change() if you need to avoid division-by-zero.
For publication-quality analysis, wrap edgeR, DESeq2, or similar in a function with the same signature.
fold_change
¶
Naive fold-change comparison for exploratory differential analysis.
Computes raw fold change (b / a) per aligned pair. No pseudocount, no normalization, no statistics.
Arithmetic edge cases
0 / 0producesNaNx / 0producesinf0 / xproduces0.0
interval_fold_change
¶
interval_fold_change(a: Track, b: Track, *, label_a: str = 'a', label_b: str = 'b', missing: float = float('nan'), mode: Literal['exact', 'overlap'] = 'exact', bin_size: int = 200, chrom_sizes: dict[str, int] | None = None) -> IntervalTrack
Compare two Tracks by naive fold change (b / a).
Aligns the two tracks, computes fold change per pair, and returns an IntervalTrack of Regions tagged with comparison metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
Track
|
First track (typically control/baseline). |
required |
b
|
Track
|
Second track (typically treatment/condition). |
required |
label_a
|
str
|
Label for the first track. |
'a'
|
label_b
|
str
|
Label for the second track. |
'b'
|
missing
|
float
|
Value for regions absent from one track.
Defaults to |
float('nan')
|
mode
|
Literal['exact', 'overlap']
|
IntervalTrack alignment mode. |
'exact'
|
bin_size
|
int
|
Window size for SignalTrack alignment.
Defaults to |
200
|
chrom_sizes
|
dict[str, int] | None
|
Chromosome sizes for SignalTrack alignment. |
None
|
Returns:
| Type | Description |
|---|---|
IntervalTrack
|
IntervalTrack of Regions with comparison tags: |
IntervalTrack
|
|
IntervalTrack
|
|
Examples:
Source code in src/seqchain/compare/fold_change.py
fold_change
¶
Compute b / a with edge-case handling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
Denominator value. |
required |
b
|
float
|
Numerator value. |
required |
Returns:
| Type | Description |
|---|---|
float
|
|
Examples:
Source code in src/seqchain/compare/fold_change.py
log2fc
¶
Compute log2 of a fold change value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fc
|
float
|
Fold change value. |
required |
Returns:
| Type | Description |
|---|---|
float
|
|
Examples: