@@ -41,14 +41,14 @@ def nn(expr: IntoExpr, base: int=33) -> pl.Expr:
41
41
#@pl.api.register_expr_namespace("fracture")
42
42
def assemble_sequences (
43
43
expr : IntoExpr ,
44
- k : int = 31 ,
45
- min_coverage : int = 1 ,
46
- method : str = 'compression' , # Changed from enum to str
47
- start_anchor : str | None = None , # New parameter
48
- end_anchor : str | None = None , # New parameter
44
+ k : int = 10 ,
45
+ min_coverage : int = 5 ,
46
+ method : str = 'shortest_path' ,
47
+ start_anchor : str | None = None ,
48
+ end_anchor : str | None = None ,
49
+ min_length : int | None = None ,
49
50
export_graphs : bool = False ,
50
51
only_largest : bool = False ,
51
- min_length : int | None = None ,
52
52
auto_k : bool = False ,
53
53
prefix : str | None = None
54
54
) -> pl .Expr :
@@ -83,9 +83,9 @@ def assemble_sequences(
83
83
"method" : method ,
84
84
"start_anchor" : start_anchor ,
85
85
"end_anchor" : end_anchor ,
86
+ "min_length" : min_length ,
86
87
"export_graphs" : export_graphs ,
87
88
"only_largest" : only_largest ,
88
- "min_length" : min_length ,
89
89
"auto_k" : auto_k ,
90
90
"prefix" : prefix
91
91
},
@@ -101,11 +101,13 @@ def sweep_assembly_params(
101
101
cov_start : int = 1 ,
102
102
cov_end : int = 150 ,
103
103
cov_step : int = 1 ,
104
- method : str = 'compression' , # Changed from enum to str
105
- start_anchor : str | None = None , # New parameter
106
- end_anchor : str | None = None , # New parameter
104
+ method : str = 'shortest_path' ,
105
+ start_anchor : str | None = None ,
106
+ end_anchor : str | None = None ,
107
+ min_length : int | None = None ,
107
108
export_graphs : bool = False ,
108
- prefix : str | None = None
109
+ prefix : str | None = None ,
110
+ auto_k : bool = False ,
109
111
) -> pl .Expr :
110
112
"""
111
113
Run sequence assembly across ranges of k-mer size and minimum coverage parameters.
@@ -135,32 +137,44 @@ def sweep_assembly_params(
135
137
"method" : method ,
136
138
"start_anchor" : start_anchor ,
137
139
"end_anchor" : end_anchor ,
140
+ "min_length" : min_length ,
138
141
"export_graphs" : export_graphs ,
139
- "prefix" : prefix
142
+ "prefix" : prefix ,
143
+ "auto_k" : auto_k
140
144
},
141
145
returns_scalar = True ,
142
146
is_elementwise = False ,
143
147
)
144
148
145
149
def optimize_assembly (
146
150
expr : IntoExpr ,
147
- start_k : int ,
148
- start_min_coverage : int ,
149
- start_anchor : str ,
150
- end_anchor : str ,
151
+ method : str = 'shortest_path' ,
152
+ start_anchor : str | None = None ,
153
+ end_anchor : str | None = None ,
154
+ start_k : int = 31 ,
155
+ start_min_coverage : int = 1 ,
156
+ min_length : int | None = None ,
157
+ export_graphs : bool = False ,
158
+ prefix : str | None = None ,
151
159
max_iterations : int | None = None ,
152
160
explore_k : bool | None = None ,
153
161
prioritize_length : bool | None = None ,
154
162
) -> pl .Expr :
163
+ if start_anchor is None or end_anchor is None :
164
+ raise ValueError ("Both start_anchor and e®d_anchor are required" )
155
165
return register_plugin_function (
156
166
plugin_path = Path (__file__ ).parent ,
157
167
function_name = "optimize_assembly_expr" ,
158
168
args = expr ,
159
169
kwargs = {
160
- "start_k" : start_k ,
161
- "start_min_coverage" : start_min_coverage ,
170
+ "method" : method ,
162
171
"start_anchor" : start_anchor ,
163
172
"end_anchor" : end_anchor ,
173
+ "start_k" : start_k ,
174
+ "start_min_coverage" : start_min_coverage ,
175
+ "min_length" : min_length ,
176
+ "export_graphs" : export_graphs ,
177
+ "prefix" : prefix ,
164
178
"max_iterations" : max_iterations ,
165
179
"explore_k" : explore_k ,
166
180
"prioritize_length" : prioritize_length
0 commit comments