pav3 3.0.0.dev15__tar.gz → 3.0.0.dev17__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.
- {pav3-3.0.0.dev15/src/pav3.egg-info → pav3-3.0.0.dev17}/PKG-INFO +1 -1
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/__init__.py +1 -1
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/call/intra.py +13 -15
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/workflow/rules/call.smk +2 -2
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/schema.py +28 -1
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17/src/pav3.egg-info}/PKG-INFO +1 -1
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/LICENSE +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/README.md +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/pyproject.toml +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/setup.cfg +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/__main__.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/__init__.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/features.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/lcmodel/__init__.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/lcmodel/_lcmodel.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/lcmodel/_lcmodel_logistic.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/lcmodel/_lcmodel_null.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/lcmodel/_util.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/lift.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/op.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/records.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/score.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/tables.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/align/trim.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/anno.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/call/__init__.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/call/expr.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/call/integrate.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/call/util.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/cli/__init__.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/cli/_cli.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/cli/_common_opt.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/cli/_subcommand_batch.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/cli/_subcommand_call.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/cli/_subcommand_license.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/const.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/default/model.json +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/human_95_80/model.json +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/human_95_80/model_info.tar.gz +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/human_95_80/weights.npz +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/human_98_80/model.json +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/human_98_80/model_info.tar.gz +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/human_98_80/weights.npz +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/prim_90_50/model.json +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/prim_90_50/model_info.tar.gz +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/prim_90_50/weights.npz +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/primdiv_85_50/model.json +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/primdiv_85_50/model_info.tar.gz +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/lcmodel/primdiv_85_50/weights.npz +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/tracks/alignment_track_fields.tsv +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/tracks/variant_track_fields.tsv +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/workflow/Snakefile +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/workflow/profiles/pav_default/config.yaml +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/workflow/rules/align.smk +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/workflow/rules/data.smk +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/workflow/rules/pipeline.smk +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/workflow/rules/tracks.smk +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/dev/__init__.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/dev/imports.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/dev/inter.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/dev/path.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/dev/sm.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/dev/tables.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/fig/__init__.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/fig/const.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/fig/density.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/fig/tracks.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/fig/util.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/inv.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/io.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/kde.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/lgsv/__init__.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/lgsv/call.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/lgsv/chain.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/lgsv/interval.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/lgsv/io.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/lgsv/region_kde.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/lgsv/resources.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/lgsv/struct.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/lgsv/variant.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/params.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/pipeline.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/region.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/seq.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/util.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/vcf.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/workflow/__init__.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/workflow/__pycache__/__init__.cpython-312.pyc +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/workflow/__pycache__/call.cpython-312.pyc +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/workflow/__pycache__/resource.cpython-312.pyc +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/workflow/call.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/workflow/resource.py +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3.egg-info/SOURCES.txt +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3.egg-info/dependency_links.txt +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3.egg-info/entry_points.txt +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3.egg-info/requires.txt +0 -0
- {pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3.egg-info/top_level.txt +0 -0
|
@@ -21,6 +21,7 @@ __all__ = [
|
|
|
21
21
|
|
|
22
22
|
import agglovar
|
|
23
23
|
import os
|
|
24
|
+
from pathlib import Path
|
|
24
25
|
from typing import Optional
|
|
25
26
|
|
|
26
27
|
import Bio.Seq
|
|
@@ -363,8 +364,8 @@ def variant_tables_snv_insdel(
|
|
|
363
364
|
def variant_tables_inv(
|
|
364
365
|
df_align: pl.DataFrame | pl.LazyFrame,
|
|
365
366
|
df_flag: pl.DataFrame | pl.LazyFrame,
|
|
366
|
-
ref_fa_filename: str,
|
|
367
|
-
qry_fa_filename: str,
|
|
367
|
+
ref_fa_filename: str | Path,
|
|
368
|
+
qry_fa_filename: str | Path,
|
|
368
369
|
df_ref_fai: pl.DataFrame,
|
|
369
370
|
df_qry_fai: pl.DataFrame,
|
|
370
371
|
pav_params: Optional[PavParams] = None,
|
|
@@ -408,8 +409,12 @@ def variant_tables_inv(
|
|
|
408
409
|
)
|
|
409
410
|
|
|
410
411
|
# Create variant tables
|
|
412
|
+
inv_schema = {col: type_ for col, type_ in schema.VARIANT.items() if col in set(get_inv_row().keys())}
|
|
413
|
+
|
|
411
414
|
variant_table_list = []
|
|
412
415
|
|
|
416
|
+
log_file = None
|
|
417
|
+
|
|
413
418
|
for row in df_flag.iter_rows(named=True):
|
|
414
419
|
region_flag = Region(
|
|
415
420
|
chrom=row['chrom'], pos=row['pos'], end=row['end'],
|
|
@@ -427,23 +432,17 @@ def variant_tables_inv(
|
|
|
427
432
|
k_util=k_util,
|
|
428
433
|
kde_model=kde_model,
|
|
429
434
|
stop_on_lift_fail=True,
|
|
430
|
-
log_file=
|
|
435
|
+
log_file=log_file,
|
|
431
436
|
)
|
|
432
437
|
|
|
433
438
|
if inv_row is not None:
|
|
434
|
-
inv_row
|
|
435
|
-
|
|
436
|
-
variant_table_list.append(pl.DataFrame(inv_row))
|
|
437
|
-
|
|
438
|
-
col_set = set(get_inv_row().keys())
|
|
439
|
-
|
|
440
|
-
col_set.add('filter')
|
|
441
|
-
col_set.add('align_source')
|
|
442
|
-
|
|
443
|
-
table_schema = {col: type_ for col, type_ in schema.VARIANT.items() if col in col_set}
|
|
439
|
+
variant_table_list.append(inv_row)
|
|
444
440
|
|
|
445
441
|
df_inv = (
|
|
446
|
-
pl.from_dicts(
|
|
442
|
+
pl.from_dicts(
|
|
443
|
+
variant_table_list,
|
|
444
|
+
schema=inv_schema,
|
|
445
|
+
)
|
|
447
446
|
.with_columns(
|
|
448
447
|
expr.id_nonsnv().alias('id'),
|
|
449
448
|
pl.lit(CALL_SOURCE).alias('call_source')
|
|
@@ -454,7 +453,6 @@ def variant_tables_inv(
|
|
|
454
453
|
right_on='align_index',
|
|
455
454
|
how='left'
|
|
456
455
|
)
|
|
457
|
-
.select(list(table_schema.keys()))
|
|
458
456
|
)
|
|
459
457
|
|
|
460
458
|
return schema.cast(df_inv, schema.VARIANT)
|
|
@@ -862,8 +862,8 @@ rule call_intra_inv:
|
|
|
862
862
|
df_inv = pav3.call.intra.variant_tables_inv(
|
|
863
863
|
df_align=df_align,
|
|
864
864
|
df_flag=df_flag,
|
|
865
|
-
ref_fa_filename=
|
|
866
|
-
qry_fa_filename=
|
|
865
|
+
ref_fa_filename=ref_fa_filename,
|
|
866
|
+
qry_fa_filename=qry_fa_filename,
|
|
867
867
|
df_ref_fai=df_ref_fai,
|
|
868
868
|
df_qry_fai=df_qry_fai,
|
|
869
869
|
pav_params=pav_params,
|
|
@@ -168,6 +168,7 @@ Fields:
|
|
|
168
168
|
def cast(
|
|
169
169
|
df: pl.DataFrame,
|
|
170
170
|
schema: dict[str, pl.DataType],
|
|
171
|
+
do_sort: bool = True,
|
|
171
172
|
) -> pl.DataFrame:
|
|
172
173
|
...
|
|
173
174
|
|
|
@@ -175,22 +176,48 @@ def cast(
|
|
|
175
176
|
def cast(
|
|
176
177
|
df: pl.LazyFrame,
|
|
177
178
|
schema: dict[str, pl.DataType],
|
|
179
|
+
do_sort: bool = True,
|
|
178
180
|
) -> pl.LazyFrame:
|
|
179
181
|
...
|
|
180
182
|
|
|
181
183
|
def cast(
|
|
182
184
|
df: pl.DataFrame | pl.LazyFrame,
|
|
183
185
|
schema: dict[str, pl.DataType],
|
|
186
|
+
do_sort: bool = True,
|
|
184
187
|
) -> pl.DataFrame | pl.LazyFrame:
|
|
188
|
+
"""
|
|
189
|
+
Cast a DataFrame or LazyFrame to a schema.
|
|
190
|
+
|
|
191
|
+
:param df: DataFrame or LazyFrame to cast.
|
|
192
|
+
:param schema: Schema to cast to.
|
|
193
|
+
:param do_sort: Whether to sort the DataFrame or LazyFrame by the order defined in the schema.
|
|
194
|
+
If the table contains columns not defined by the schema, they are retained in order after
|
|
195
|
+
columns defined by the schema.
|
|
196
|
+
"""
|
|
185
197
|
|
|
186
198
|
if isinstance(df, pl.DataFrame):
|
|
187
199
|
existing_schema = df.schema
|
|
188
200
|
else:
|
|
189
201
|
existing_schema = df.collect_schema()
|
|
190
202
|
|
|
191
|
-
|
|
203
|
+
df = df.cast(
|
|
192
204
|
{
|
|
193
205
|
col: schema.get(col, type_)
|
|
194
206
|
for col, type_ in existing_schema.items()
|
|
195
207
|
}
|
|
196
208
|
)
|
|
209
|
+
|
|
210
|
+
if do_sort:
|
|
211
|
+
df = (
|
|
212
|
+
df
|
|
213
|
+
.select(
|
|
214
|
+
*[ # Known columns first
|
|
215
|
+
col for col in schema.keys() if col in existing_schema.keys()
|
|
216
|
+
],
|
|
217
|
+
*[ # Unknown columns last
|
|
218
|
+
col for col in existing_schema.keys() if col not in schema.keys()
|
|
219
|
+
]
|
|
220
|
+
)
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
return df
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/data/workflow/profiles/pav_default/config.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/workflow/__pycache__/__init__.cpython-312.pyc
RENAMED
|
File without changes
|
|
File without changes
|
{pav3-3.0.0.dev15 → pav3-3.0.0.dev17}/src/pav3/workflow/__pycache__/resource.cpython-312.pyc
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|