ArraySplitter 1.2.2__tar.gz → 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arraysplitter-1.3.0/PKG-INFO +272 -0
- arraysplitter-1.3.0/README.md +239 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/setup.py +1 -3
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/__init__.py +1 -1
- arraysplitter-1.3.0/src/ArraySplitter/classify.py +519 -0
- arraysplitter-1.3.0/src/ArraySplitter/core_functions/tools/anchor_graph.py +726 -0
- arraysplitter-1.3.0/src/ArraySplitter/decompose.py +1784 -0
- arraysplitter-1.3.0/src/ArraySplitter/main.py +191 -0
- arraysplitter-1.3.0/src/ArraySplitter.egg-info/PKG-INFO +272 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter.egg-info/SOURCES.txt +15 -1
- arraysplitter-1.3.0/src/ArraySplitter.egg-info/entry_points.txt +2 -0
- arraysplitter-1.3.0/tests/test_ab_pattern.py +158 -0
- arraysplitter-1.3.0/tests/test_basic.py +109 -0
- arraysplitter-1.3.0/tests/test_bugfix_independent.py +137 -0
- arraysplitter-1.3.0/tests/test_decompose.py +223 -0
- arraysplitter-1.3.0/tests/test_fs_tree.py +213 -0
- arraysplitter-1.3.0/tests/test_fs_tree_simple.py +172 -0
- arraysplitter-1.3.0/tests/test_rotation.py +233 -0
- arraysplitter-1.3.0/tests/test_rotation_simple.py +107 -0
- arraysplitter-1.3.0/tests/test_sequences.py +167 -0
- arraysplitter-1.3.0/tests/test_sequences_simple.py +95 -0
- arraysplitter-1.3.0/tests/test_variable_repeats.py +175 -0
- ArraySplitter-1.2.2/PKG-INFO +0 -106
- ArraySplitter-1.2.2/README.md +0 -87
- ArraySplitter-1.2.2/src/ArraySplitter/decompose.py +0 -374
- ArraySplitter-1.2.2/src/ArraySplitter.egg-info/PKG-INFO +0 -106
- ArraySplitter-1.2.2/src/ArraySplitter.egg-info/entry_points.txt +0 -4
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/LICENSE +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/setup.cfg +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/__init__.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/io/__init__.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/io/block_file.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/io/fasta_reader.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/io/satellome_reader.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/io/tab_file.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/io/trf_reader.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/models/__init__.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/models/trf_model.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/tools/__init__.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/tools/fs_tree.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/tools/parsers.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/tools/rotation.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/core_functions/tools/sequences.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/extract.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter/rotate.py +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter.egg-info/dependency_links.txt +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter.egg-info/requires.txt +0 -0
- {ArraySplitter-1.2.2 → arraysplitter-1.3.0}/src/ArraySplitter.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ArraySplitter
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: De Novo Decomposition of Satellite DNA Arrays into Monomers within Telomere-to-Telomere Assemblies
|
|
5
|
+
Home-page: https://github.com/aglabx/ArraySplitter
|
|
6
|
+
Author: Aleksey Komissarov
|
|
7
|
+
Author-email: ad3002@gmail.com
|
|
8
|
+
License: BSD
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
16
|
+
Requires-Python: >=3.6
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: PyExp
|
|
20
|
+
Requires-Dist: editdistance
|
|
21
|
+
Requires-Dist: tqdm
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: home-page
|
|
28
|
+
Dynamic: license
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
Dynamic: requires-dist
|
|
31
|
+
Dynamic: requires-python
|
|
32
|
+
Dynamic: summary
|
|
33
|
+
|
|
34
|
+
# ArraySplitter: De Novo Decomposition of Satellite DNA Arrays
|
|
35
|
+
|
|
36
|
+
Decomposes satellite DNA arrays into monomers within telomere-to-telomere (T2T) assemblies. Ideal for analyzing centromeric and pericentromeric regions on monomeric level.
|
|
37
|
+
|
|
38
|
+
**Status:** Production ready. Successfully handles arrays from kilobase to megabase scale.
|
|
39
|
+
|
|
40
|
+
**Key Features:**
|
|
41
|
+
- De novo monomer identification without prior knowledge
|
|
42
|
+
- Automatic orientation to canonical form (A>T, C>G)
|
|
43
|
+
- Integrated monomer rotation for standardized comparison
|
|
44
|
+
- Classification of arrays into repeat families
|
|
45
|
+
- Structural importance scoring to identify centromeric and other functional regions
|
|
46
|
+
|
|
47
|
+
**Performance:** CHM13v2.0 assembly (13K arrays > 1Kb) processes in ~3 hours (single-threaded)
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
**Prerequisites**
|
|
52
|
+
|
|
53
|
+
* Python 3.6 or later
|
|
54
|
+
|
|
55
|
+
**Installation with pip:**
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install arraysplitter
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Tool Overview
|
|
62
|
+
|
|
63
|
+
ArraySplitter provides a unified command-line interface with multiple subcommands:
|
|
64
|
+
|
|
65
|
+
### Main Command: `arraysplitter`
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
arraysplitter <command> [options]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Available commands:
|
|
72
|
+
- `split` - Decompose arrays into monomers
|
|
73
|
+
- `classify` - Group arrays into families based on patterns
|
|
74
|
+
- `rotate` - Normalize monomer orientation
|
|
75
|
+
- `extract` - Extract and count unique monomers
|
|
76
|
+
|
|
77
|
+
### 1. `arraysplitter split` - Array Decomposition
|
|
78
|
+
|
|
79
|
+
Performs de novo decomposition of satellite DNA arrays into individual monomers.
|
|
80
|
+
|
|
81
|
+
**Usage:**
|
|
82
|
+
```bash
|
|
83
|
+
# Basic decomposition
|
|
84
|
+
arraysplitter split -i arrays.fa -o output_prefix
|
|
85
|
+
|
|
86
|
+
# With predefined cut sequences
|
|
87
|
+
arraysplitter split -i arrays.fa -o output_prefix -c ATG,CGCG
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Output files:**
|
|
91
|
+
- `.decomposed.fasta` - Monomers with orientation and rotation applied
|
|
92
|
+
- `.monomers.tsv` - Detailed table with monomer information
|
|
93
|
+
- `.lengths` - Fragment lengths for each array
|
|
94
|
+
|
|
95
|
+
**Features:**
|
|
96
|
+
- Automatic canonical orientation (A>T, C>G)
|
|
97
|
+
- Integrated rotation (monomers start with cut sequence)
|
|
98
|
+
- Flank detection and labeling
|
|
99
|
+
- Perfect reconstruction guarantee
|
|
100
|
+
|
|
101
|
+
### 2. `arraysplitter classify` - Family Classification
|
|
102
|
+
|
|
103
|
+
Groups arrays into families based on cut sequences and decomposition patterns. Identifies structurally important regions.
|
|
104
|
+
|
|
105
|
+
**Usage:**
|
|
106
|
+
```bash
|
|
107
|
+
# Classify using lengths file from split step
|
|
108
|
+
arraysplitter classify -i output_prefix.lengths -o classification
|
|
109
|
+
|
|
110
|
+
# With custom similarity threshold
|
|
111
|
+
arraysplitter classify -i output_prefix.lengths -o classification -s 0.9
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Output files:**
|
|
115
|
+
- `.families.tsv` - Array assignments with stability metrics
|
|
116
|
+
- `.family_stats.tsv` - Basic statistics per family
|
|
117
|
+
- `.family_summary.tsv` - Detailed family analysis with structural importance scores
|
|
118
|
+
- `.features.json` - Complete feature data
|
|
119
|
+
|
|
120
|
+
**Key metrics:**
|
|
121
|
+
- **Step stability**: Consistency of monomer length differences
|
|
122
|
+
- **Local variability**: Sliding window analysis (10kb windows)
|
|
123
|
+
- **Structural importance score**: Combined metric (0-1) identifying potential functional regions
|
|
124
|
+
|
|
125
|
+
### 3. `arraysplitter rotate` - Monomer Normalization
|
|
126
|
+
|
|
127
|
+
Rotates monomers to start with the same sequence pattern.
|
|
128
|
+
|
|
129
|
+
**Usage:**
|
|
130
|
+
```bash
|
|
131
|
+
# Auto-detect best rotation
|
|
132
|
+
arraysplitter rotate -i monomers.fa -o rotated.fa
|
|
133
|
+
|
|
134
|
+
# With specific starting sequence
|
|
135
|
+
arraysplitter rotate -i monomers.fa -o rotated.fa -s ATTCC
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 4. `arraysplitter extract` - Monomer Analysis
|
|
139
|
+
|
|
140
|
+
Extracts unique monomers and calculates frequencies.
|
|
141
|
+
|
|
142
|
+
**Usage:**
|
|
143
|
+
```bash
|
|
144
|
+
arraysplitter extract -i monomers.fa -o stats_prefix
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Output format:**
|
|
148
|
+
```
|
|
149
|
+
<length> <frequency> <sequence>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Complete Workflow Example
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Step 1: Decompose arrays into monomers
|
|
156
|
+
arraysplitter split -i centromere_arrays.fa -o centromere
|
|
157
|
+
|
|
158
|
+
# Step 2: Classify arrays into families and identify structural regions
|
|
159
|
+
arraysplitter classify -i centromere.lengths -o centromere_families
|
|
160
|
+
|
|
161
|
+
# Step 3: Extract and count unique monomers (optional)
|
|
162
|
+
arraysplitter extract -i centromere.decomposed.fasta -o centromere_monomers
|
|
163
|
+
|
|
164
|
+
# Step 4: Additional rotation if needed (optional)
|
|
165
|
+
arraysplitter rotate -i centromere.decomposed.fasta -o centromere.rotated.fa -s ATTCC
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Output Analysis
|
|
169
|
+
|
|
170
|
+
After classification, examine the `.family_summary.tsv` file to identify:
|
|
171
|
+
- Families with high structural importance scores (>0.8) - potential centromeric regions
|
|
172
|
+
- Families with low step variability - structurally conserved regions
|
|
173
|
+
- Most stable arrays within each family - best representatives for further study
|
|
174
|
+
|
|
175
|
+
## Algorithm Description
|
|
176
|
+
|
|
177
|
+
ArraySplitter employs a novel de novo algorithm for decomposing satellite DNA arrays into constituent monomers without prior knowledge of the monomer sequences. The algorithm is specifically designed to handle the challenges of centromeric and pericentromeric regions in telomere-to-telomere assemblies.
|
|
178
|
+
|
|
179
|
+
### Overview
|
|
180
|
+
|
|
181
|
+
The algorithm uses a frequency suffix tree (fs_tree) approach to identify optimal cut sequences that split tandem repeat arrays into individual monomer units. It handles variable-length monomers (polymorphic repeats) common in biological sequences and automatically orients sequences to canonical form for comparability.
|
|
182
|
+
|
|
183
|
+
### Detailed Algorithm Steps
|
|
184
|
+
|
|
185
|
+
#### 1. Canonical Orientation
|
|
186
|
+
Arrays are first oriented to canonical form using the rules:
|
|
187
|
+
- Primary: A > T (arrays with more A's than T's are kept as-is)
|
|
188
|
+
- Secondary: C > G (if A=T, arrays with more C's than G's are kept as-is)
|
|
189
|
+
- Arrays not in canonical form are reverse complemented
|
|
190
|
+
|
|
191
|
+
#### 2. All Nucleotide Analysis
|
|
192
|
+
The algorithm analyzes all nucleotides (A, C, T, G) to avoid bias from single nucleotide selection. Each nucleotide serves as an anchor point for building frequency suffix trees.
|
|
193
|
+
|
|
194
|
+
#### 3. Frequency Suffix Tree Construction
|
|
195
|
+
The core data structure is a frequency suffix tree that efficiently identifies repetitive patterns:
|
|
196
|
+
|
|
197
|
+
- **Starting positions**: All positions containing each nucleotide become root nodes
|
|
198
|
+
- **Iterative extension**: The tree grows by extending sequences one nucleotide at a time (A/C/G/T)
|
|
199
|
+
- **Frequency filtering**: Only branches exceeding a dynamic cutoff threshold are retained:
|
|
200
|
+
- Arrays > 1MB: cutoff = 1000
|
|
201
|
+
- Arrays > 100KB: cutoff = 250
|
|
202
|
+
- Arrays > 10KB: cutoff = 10
|
|
203
|
+
- Arrays ≤ 10KB: cutoff = 3
|
|
204
|
+
- **Heap-based optimization**: Uses a priority queue to efficiently process high-frequency patterns first
|
|
205
|
+
|
|
206
|
+
#### 4. Candidate Cut Sequence Generation
|
|
207
|
+
From the frequency suffix tree, the algorithm extracts potential cut sequences:
|
|
208
|
+
- For each sequence length (up to a configurable depth, default 100)
|
|
209
|
+
- Identifies the sequence with maximum coverage (highest frequency)
|
|
210
|
+
- Generates a ranked list of candidate cut sequences
|
|
211
|
+
|
|
212
|
+
#### 5. Optimal Cut Selection
|
|
213
|
+
The algorithm evaluates each candidate cut sequence by:
|
|
214
|
+
- Splitting the array at all occurrences of the cut sequence
|
|
215
|
+
- Calculating period distribution between cuts
|
|
216
|
+
- Handling perfect/near-perfect repeats (≥80% empty parts between cuts)
|
|
217
|
+
- Computing scores with tie-breaking rules:
|
|
218
|
+
1. Prefer cuts producing fewer segments
|
|
219
|
+
2. Prefer smaller fundamental periods (using GCD)
|
|
220
|
+
- The cut sequence becomes the START of each monomer (biologically relevant)
|
|
221
|
+
|
|
222
|
+
#### 6. Monomer Construction
|
|
223
|
+
- First fragment (before any cut) is treated as left flank
|
|
224
|
+
- Each monomer is built as: cut_sequence + following_part
|
|
225
|
+
- Last fragment <70% of average length is treated as right flank
|
|
226
|
+
- All monomers are automatically rotated to start with the cut sequence
|
|
227
|
+
- Ensures all output monomers are directly comparable
|
|
228
|
+
|
|
229
|
+
### Key Features
|
|
230
|
+
|
|
231
|
+
1. **De novo approach**: No prior knowledge of monomer sequences required
|
|
232
|
+
2. **Variable-length monomers**: Handles polymorphic repeats naturally
|
|
233
|
+
3. **Canonical orientation**: All arrays oriented consistently (A>T, C>G)
|
|
234
|
+
4. **Integrated rotation**: Monomers automatically aligned to cut sequence
|
|
235
|
+
5. **Family classification**: Groups arrays by cut patterns and variability
|
|
236
|
+
6. **Structural scoring**: Identifies centromeric and functional regions
|
|
237
|
+
|
|
238
|
+
### Performance Characteristics
|
|
239
|
+
|
|
240
|
+
- **Optimized for**: 100Kb scale arrays
|
|
241
|
+
- **Scalability**: Successfully handles megabase-scale arrays (largest ~5 minutes)
|
|
242
|
+
- **Benchmarking**: CHM13v20 assembly (13K arrays > 1Kb) processes in ~3 hours
|
|
243
|
+
- **Current limitation**: Single-threaded (parallelization planned)
|
|
244
|
+
|
|
245
|
+
### Classification Algorithm
|
|
246
|
+
|
|
247
|
+
ArraySplitter includes a classification system that groups arrays into families based on:
|
|
248
|
+
|
|
249
|
+
1. **Cut sequence identity**: Arrays with different cuts belong to different families
|
|
250
|
+
2. **Pattern similarity**: Within same cut, arrays are clustered by:
|
|
251
|
+
- Mean monomer length
|
|
252
|
+
- Length variability
|
|
253
|
+
- Step stability (consistency between consecutive monomers)
|
|
254
|
+
3. **Structural importance scoring**:
|
|
255
|
+
- High step stability (consistent monomer spacing)
|
|
256
|
+
- Low local variability (stable regions in 10kb windows)
|
|
257
|
+
- Consistency across arrays in family
|
|
258
|
+
- Score 0-1 (higher = more structurally important)
|
|
259
|
+
|
|
260
|
+
### Applications
|
|
261
|
+
|
|
262
|
+
The algorithm is particularly well-suited for:
|
|
263
|
+
- Analyzing centromeric and pericentromeric regions in T2T assemblies
|
|
264
|
+
- Identifying structurally important genomic regions
|
|
265
|
+
- Studying satellite DNA evolution and variation
|
|
266
|
+
- Discovering novel tandem repeat families
|
|
267
|
+
- Quantifying monomer composition and variability
|
|
268
|
+
- Finding stable regions for functional studies
|
|
269
|
+
|
|
270
|
+
## Contact
|
|
271
|
+
|
|
272
|
+
For questions or support: ad3002@gmail.com
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# ArraySplitter: De Novo Decomposition of Satellite DNA Arrays
|
|
2
|
+
|
|
3
|
+
Decomposes satellite DNA arrays into monomers within telomere-to-telomere (T2T) assemblies. Ideal for analyzing centromeric and pericentromeric regions on monomeric level.
|
|
4
|
+
|
|
5
|
+
**Status:** Production ready. Successfully handles arrays from kilobase to megabase scale.
|
|
6
|
+
|
|
7
|
+
**Key Features:**
|
|
8
|
+
- De novo monomer identification without prior knowledge
|
|
9
|
+
- Automatic orientation to canonical form (A>T, C>G)
|
|
10
|
+
- Integrated monomer rotation for standardized comparison
|
|
11
|
+
- Classification of arrays into repeat families
|
|
12
|
+
- Structural importance scoring to identify centromeric and other functional regions
|
|
13
|
+
|
|
14
|
+
**Performance:** CHM13v2.0 assembly (13K arrays > 1Kb) processes in ~3 hours (single-threaded)
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
**Prerequisites**
|
|
19
|
+
|
|
20
|
+
* Python 3.6 or later
|
|
21
|
+
|
|
22
|
+
**Installation with pip:**
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install arraysplitter
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Tool Overview
|
|
29
|
+
|
|
30
|
+
ArraySplitter provides a unified command-line interface with multiple subcommands:
|
|
31
|
+
|
|
32
|
+
### Main Command: `arraysplitter`
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
arraysplitter <command> [options]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Available commands:
|
|
39
|
+
- `split` - Decompose arrays into monomers
|
|
40
|
+
- `classify` - Group arrays into families based on patterns
|
|
41
|
+
- `rotate` - Normalize monomer orientation
|
|
42
|
+
- `extract` - Extract and count unique monomers
|
|
43
|
+
|
|
44
|
+
### 1. `arraysplitter split` - Array Decomposition
|
|
45
|
+
|
|
46
|
+
Performs de novo decomposition of satellite DNA arrays into individual monomers.
|
|
47
|
+
|
|
48
|
+
**Usage:**
|
|
49
|
+
```bash
|
|
50
|
+
# Basic decomposition
|
|
51
|
+
arraysplitter split -i arrays.fa -o output_prefix
|
|
52
|
+
|
|
53
|
+
# With predefined cut sequences
|
|
54
|
+
arraysplitter split -i arrays.fa -o output_prefix -c ATG,CGCG
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Output files:**
|
|
58
|
+
- `.decomposed.fasta` - Monomers with orientation and rotation applied
|
|
59
|
+
- `.monomers.tsv` - Detailed table with monomer information
|
|
60
|
+
- `.lengths` - Fragment lengths for each array
|
|
61
|
+
|
|
62
|
+
**Features:**
|
|
63
|
+
- Automatic canonical orientation (A>T, C>G)
|
|
64
|
+
- Integrated rotation (monomers start with cut sequence)
|
|
65
|
+
- Flank detection and labeling
|
|
66
|
+
- Perfect reconstruction guarantee
|
|
67
|
+
|
|
68
|
+
### 2. `arraysplitter classify` - Family Classification
|
|
69
|
+
|
|
70
|
+
Groups arrays into families based on cut sequences and decomposition patterns. Identifies structurally important regions.
|
|
71
|
+
|
|
72
|
+
**Usage:**
|
|
73
|
+
```bash
|
|
74
|
+
# Classify using lengths file from split step
|
|
75
|
+
arraysplitter classify -i output_prefix.lengths -o classification
|
|
76
|
+
|
|
77
|
+
# With custom similarity threshold
|
|
78
|
+
arraysplitter classify -i output_prefix.lengths -o classification -s 0.9
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Output files:**
|
|
82
|
+
- `.families.tsv` - Array assignments with stability metrics
|
|
83
|
+
- `.family_stats.tsv` - Basic statistics per family
|
|
84
|
+
- `.family_summary.tsv` - Detailed family analysis with structural importance scores
|
|
85
|
+
- `.features.json` - Complete feature data
|
|
86
|
+
|
|
87
|
+
**Key metrics:**
|
|
88
|
+
- **Step stability**: Consistency of monomer length differences
|
|
89
|
+
- **Local variability**: Sliding window analysis (10kb windows)
|
|
90
|
+
- **Structural importance score**: Combined metric (0-1) identifying potential functional regions
|
|
91
|
+
|
|
92
|
+
### 3. `arraysplitter rotate` - Monomer Normalization
|
|
93
|
+
|
|
94
|
+
Rotates monomers to start with the same sequence pattern.
|
|
95
|
+
|
|
96
|
+
**Usage:**
|
|
97
|
+
```bash
|
|
98
|
+
# Auto-detect best rotation
|
|
99
|
+
arraysplitter rotate -i monomers.fa -o rotated.fa
|
|
100
|
+
|
|
101
|
+
# With specific starting sequence
|
|
102
|
+
arraysplitter rotate -i monomers.fa -o rotated.fa -s ATTCC
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 4. `arraysplitter extract` - Monomer Analysis
|
|
106
|
+
|
|
107
|
+
Extracts unique monomers and calculates frequencies.
|
|
108
|
+
|
|
109
|
+
**Usage:**
|
|
110
|
+
```bash
|
|
111
|
+
arraysplitter extract -i monomers.fa -o stats_prefix
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Output format:**
|
|
115
|
+
```
|
|
116
|
+
<length> <frequency> <sequence>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Complete Workflow Example
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Step 1: Decompose arrays into monomers
|
|
123
|
+
arraysplitter split -i centromere_arrays.fa -o centromere
|
|
124
|
+
|
|
125
|
+
# Step 2: Classify arrays into families and identify structural regions
|
|
126
|
+
arraysplitter classify -i centromere.lengths -o centromere_families
|
|
127
|
+
|
|
128
|
+
# Step 3: Extract and count unique monomers (optional)
|
|
129
|
+
arraysplitter extract -i centromere.decomposed.fasta -o centromere_monomers
|
|
130
|
+
|
|
131
|
+
# Step 4: Additional rotation if needed (optional)
|
|
132
|
+
arraysplitter rotate -i centromere.decomposed.fasta -o centromere.rotated.fa -s ATTCC
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Output Analysis
|
|
136
|
+
|
|
137
|
+
After classification, examine the `.family_summary.tsv` file to identify:
|
|
138
|
+
- Families with high structural importance scores (>0.8) - potential centromeric regions
|
|
139
|
+
- Families with low step variability - structurally conserved regions
|
|
140
|
+
- Most stable arrays within each family - best representatives for further study
|
|
141
|
+
|
|
142
|
+
## Algorithm Description
|
|
143
|
+
|
|
144
|
+
ArraySplitter employs a novel de novo algorithm for decomposing satellite DNA arrays into constituent monomers without prior knowledge of the monomer sequences. The algorithm is specifically designed to handle the challenges of centromeric and pericentromeric regions in telomere-to-telomere assemblies.
|
|
145
|
+
|
|
146
|
+
### Overview
|
|
147
|
+
|
|
148
|
+
The algorithm uses a frequency suffix tree (fs_tree) approach to identify optimal cut sequences that split tandem repeat arrays into individual monomer units. It handles variable-length monomers (polymorphic repeats) common in biological sequences and automatically orients sequences to canonical form for comparability.
|
|
149
|
+
|
|
150
|
+
### Detailed Algorithm Steps
|
|
151
|
+
|
|
152
|
+
#### 1. Canonical Orientation
|
|
153
|
+
Arrays are first oriented to canonical form using the rules:
|
|
154
|
+
- Primary: A > T (arrays with more A's than T's are kept as-is)
|
|
155
|
+
- Secondary: C > G (if A=T, arrays with more C's than G's are kept as-is)
|
|
156
|
+
- Arrays not in canonical form are reverse complemented
|
|
157
|
+
|
|
158
|
+
#### 2. All Nucleotide Analysis
|
|
159
|
+
The algorithm analyzes all nucleotides (A, C, T, G) to avoid bias from single nucleotide selection. Each nucleotide serves as an anchor point for building frequency suffix trees.
|
|
160
|
+
|
|
161
|
+
#### 3. Frequency Suffix Tree Construction
|
|
162
|
+
The core data structure is a frequency suffix tree that efficiently identifies repetitive patterns:
|
|
163
|
+
|
|
164
|
+
- **Starting positions**: All positions containing each nucleotide become root nodes
|
|
165
|
+
- **Iterative extension**: The tree grows by extending sequences one nucleotide at a time (A/C/G/T)
|
|
166
|
+
- **Frequency filtering**: Only branches exceeding a dynamic cutoff threshold are retained:
|
|
167
|
+
- Arrays > 1MB: cutoff = 1000
|
|
168
|
+
- Arrays > 100KB: cutoff = 250
|
|
169
|
+
- Arrays > 10KB: cutoff = 10
|
|
170
|
+
- Arrays ≤ 10KB: cutoff = 3
|
|
171
|
+
- **Heap-based optimization**: Uses a priority queue to efficiently process high-frequency patterns first
|
|
172
|
+
|
|
173
|
+
#### 4. Candidate Cut Sequence Generation
|
|
174
|
+
From the frequency suffix tree, the algorithm extracts potential cut sequences:
|
|
175
|
+
- For each sequence length (up to a configurable depth, default 100)
|
|
176
|
+
- Identifies the sequence with maximum coverage (highest frequency)
|
|
177
|
+
- Generates a ranked list of candidate cut sequences
|
|
178
|
+
|
|
179
|
+
#### 5. Optimal Cut Selection
|
|
180
|
+
The algorithm evaluates each candidate cut sequence by:
|
|
181
|
+
- Splitting the array at all occurrences of the cut sequence
|
|
182
|
+
- Calculating period distribution between cuts
|
|
183
|
+
- Handling perfect/near-perfect repeats (≥80% empty parts between cuts)
|
|
184
|
+
- Computing scores with tie-breaking rules:
|
|
185
|
+
1. Prefer cuts producing fewer segments
|
|
186
|
+
2. Prefer smaller fundamental periods (using GCD)
|
|
187
|
+
- The cut sequence becomes the START of each monomer (biologically relevant)
|
|
188
|
+
|
|
189
|
+
#### 6. Monomer Construction
|
|
190
|
+
- First fragment (before any cut) is treated as left flank
|
|
191
|
+
- Each monomer is built as: cut_sequence + following_part
|
|
192
|
+
- Last fragment <70% of average length is treated as right flank
|
|
193
|
+
- All monomers are automatically rotated to start with the cut sequence
|
|
194
|
+
- Ensures all output monomers are directly comparable
|
|
195
|
+
|
|
196
|
+
### Key Features
|
|
197
|
+
|
|
198
|
+
1. **De novo approach**: No prior knowledge of monomer sequences required
|
|
199
|
+
2. **Variable-length monomers**: Handles polymorphic repeats naturally
|
|
200
|
+
3. **Canonical orientation**: All arrays oriented consistently (A>T, C>G)
|
|
201
|
+
4. **Integrated rotation**: Monomers automatically aligned to cut sequence
|
|
202
|
+
5. **Family classification**: Groups arrays by cut patterns and variability
|
|
203
|
+
6. **Structural scoring**: Identifies centromeric and functional regions
|
|
204
|
+
|
|
205
|
+
### Performance Characteristics
|
|
206
|
+
|
|
207
|
+
- **Optimized for**: 100Kb scale arrays
|
|
208
|
+
- **Scalability**: Successfully handles megabase-scale arrays (largest ~5 minutes)
|
|
209
|
+
- **Benchmarking**: CHM13v20 assembly (13K arrays > 1Kb) processes in ~3 hours
|
|
210
|
+
- **Current limitation**: Single-threaded (parallelization planned)
|
|
211
|
+
|
|
212
|
+
### Classification Algorithm
|
|
213
|
+
|
|
214
|
+
ArraySplitter includes a classification system that groups arrays into families based on:
|
|
215
|
+
|
|
216
|
+
1. **Cut sequence identity**: Arrays with different cuts belong to different families
|
|
217
|
+
2. **Pattern similarity**: Within same cut, arrays are clustered by:
|
|
218
|
+
- Mean monomer length
|
|
219
|
+
- Length variability
|
|
220
|
+
- Step stability (consistency between consecutive monomers)
|
|
221
|
+
3. **Structural importance scoring**:
|
|
222
|
+
- High step stability (consistent monomer spacing)
|
|
223
|
+
- Low local variability (stable regions in 10kb windows)
|
|
224
|
+
- Consistency across arrays in family
|
|
225
|
+
- Score 0-1 (higher = more structurally important)
|
|
226
|
+
|
|
227
|
+
### Applications
|
|
228
|
+
|
|
229
|
+
The algorithm is particularly well-suited for:
|
|
230
|
+
- Analyzing centromeric and pericentromeric regions in T2T assemblies
|
|
231
|
+
- Identifying structurally important genomic regions
|
|
232
|
+
- Studying satellite DNA evolution and variation
|
|
233
|
+
- Discovering novel tandem repeat families
|
|
234
|
+
- Quantifying monomer composition and variability
|
|
235
|
+
- Finding stable regions for functional studies
|
|
236
|
+
|
|
237
|
+
## Contact
|
|
238
|
+
|
|
239
|
+
For questions or support: ad3002@gmail.com
|
|
@@ -45,9 +45,7 @@ setup(
|
|
|
45
45
|
],
|
|
46
46
|
entry_points={
|
|
47
47
|
'console_scripts': [
|
|
48
|
-
'arraysplitter = ArraySplitter.
|
|
49
|
-
'arraysplitter_rotate = ArraySplitter.rotate:run_it',
|
|
50
|
-
'arraysplitter_extract = ArraySplitter.extract:run_it',
|
|
48
|
+
'arraysplitter = ArraySplitter.main:run_it',
|
|
51
49
|
],
|
|
52
50
|
},
|
|
53
51
|
)
|