You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+70-2Lines changed: 70 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,74 @@ gcnvplot plot \
46
46
--output plot.svg
47
47
```
48
48
49
-
## Example data
49
+
## Synthetic example
50
50
51
-
A tiny synthetic BRCA1 transcript example is available in [`examples/brca1_synthetic`](examples/brca1_synthetic). It demonstrates a highlighted multi-exon deletion, open dots for intervals outside exons, and an uncovered-exon marker.
51
+
A tiny synthetic BRCA1 transcript example is available in [`examples/brca1_synthetic`](examples/brca1_synthetic). It demonstrates a highlighted multi-exon deletion, filled and open sample dots, and an uncovered-exon marker.
- a depressed log2 signal across BRCA1 exons 13-15,
71
+
- an intronic interval inside the deletion rendered as an open but still depressed dot,
72
+
- an intronic interval outside the deletion rendered as an open near-baseline dot,
73
+
- an uncovered exon marked with a triangle in the transcript track.
74
+
75
+
## Details
76
+
77
+
`gcnvplot` uses a median-of-ratios normalization. For `create-background`, let `c_ij` be the raw count for interval `i` in background sample `j`.
78
+
79
+
1. Interval baseline:
80
+
81
+
`b_i = median_j(c_ij)` using only positive counts.
82
+
83
+
2. Background-sample size factor:
84
+
85
+
`s_j = median_i(c_ij / b_i)` over intervals with `c_ij > 0` and `b_i > 0`.
86
+
87
+
3. Normalized background count:
88
+
89
+
`n_ij = c_ij / s_j`
90
+
91
+
The background TSV then stores interval-wise summary statistics across the normalized values `n_ij`, including:
92
+
93
+
-`BG_NORM_MEAN`
94
+
-`BG_NORM_MEDIAN`
95
+
-`BG_NORM_SD`
96
+
-`BG_NORM_P5`
97
+
-`BG_NORM_P95`
98
+
99
+
For `plot`, let `c_i` be the raw count for the plotted sample at interval `i`.
100
+
101
+
1. The sample is normalized against the background baselines with the same rule:
102
+
103
+
`s = median_i(c_i / b_i)`
104
+
105
+
`n_i = c_i / s`
106
+
107
+
2. The plotted signal is the stabilized log2 ratio against the background median:
108
+
109
+
`signal_i = log2((n_i + 0.01) / (m_i + 0.01))`
110
+
111
+
where `m_i = BG_NORM_MEDIAN`.
112
+
113
+
3. The background ribbon is drawn by transforming the stored background percentiles in the same way:
114
+
115
+
`lower_i = log2((p5_i + 0.01) / (m_i + 0.01))`
116
+
117
+
`upper_i = log2((p95_i + 0.01) / (m_i + 0.01))`
118
+
119
+
This means the plotted curve shows relative dosage after library-size normalization, while the ribbon shows where the central background cohort typically lies for each interval.
0 commit comments