evaluate_classes¶
The class-comparison evaluation. gb-qc evaluate-classes is a thin wrapper over
run, so anything the CLI can do
is callable directly.
evaluate_classes
¶
Compare sequence characteristics between the classes of one dataset.
Reads the input as a set of classes - one FASTA file per class, or one CSV/TSV label column - computes per-class statistics, and reports on every pair of classes: a feature that separates two classes tells a model which class a sequence belongs to without it having to learn anything about the biology.
run is the entry point; the CLI is a thin wrapper around it. The report layout
is defined in genomic_benchmarks_qc.utils.naming.
run
¶
run(
input,
format,
out_folder='.',
sequence_column=None,
label_column='label',
label_list=None,
regression=False,
report_types=None,
end_position=None,
min_coverage=DEFAULT_MIN_COVERAGE,
plot_type='boxen',
log_level='INFO',
log_file=None,
)
Compare every pair of classes in a dataset and write the reports.
Reports go to 'out_folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
list[str]
|
Paths to the input files. For FASTA, one file per class. For CSV/TSV, the
files are read together and the classes come from |
required |
format
|
str
|
Format of the input files (fasta, csv, csv.gz, tsv, tsv.gz). |
required |
out_folder
|
str
|
Path to the output folder; reports go into ' |
'.'
|
sequence_column
|
list[str] | None
|
Columns holding the sequences, for CSV/TSV input. Each is
compared separately, and all of them together in an extra 'merged' report.
Default: |
None
|
label_column
|
str
|
Column holding the class of each row, for CSV/TSV input.
Default: |
'label'
|
label_list
|
list[str] | None
|
Classes to compare, for CSV/TSV input, or "infer" to take them from
|
None
|
regression
|
bool | None
|
Treat |
False
|
report_types
|
list[str] | None
|
Types of reports to generate, from
REPORT_TYPES.
Default: |
None
|
end_position
|
int | None
|
Last position the per-position checks report on, 1-based and
inclusive. Defaults to the last position at least
MIN_SEQUENCES_PER_REPORTED_POSITION
sequences of each class reach, whichever class runs out first. It cannot
widen what gets flagged, so an explicit value only ever trims.
Default: |
None
|
min_coverage
|
float
|
Fraction of each class that must reach a position before it may be
flagged, on top of the
MIN_SEQUENCES_PER_CLASS
sequences every compared position needs. This is also the window the
per-position figures draw; positions past it are reported as Unknown.
Default: |
DEFAULT_MIN_COVERAGE
|
plot_type
|
str | None
|
Distribution plot for the length and content figures, 'boxen' or
'violin'. 'boxen' reads better on large classes. Default: |
'boxen'
|
log_level
|
str | None
|
Logging level. Default: |
'INFO'
|
log_file
|
str | None
|
Path to a log file. Logs go to the console either way. |
None
|
Source code in src/genomic_benchmarks_qc/evaluate_classes.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | |
run_analysis
¶
run_analysis(
input_statistics, report_dir, report_types, plot_type
)
Analyse each class, then every pair of classes, writing reports under report_dir.
Layout produced, one directory per comparison so that every report type has a fixed, predictable name inside it:
<report_dir>/
per-class/<class>.json
<classA>_vs_<classB>/
gb-qc-report.csv
gb-qc-report.html
gb-qc-duplicates.txt
plots/
Classes are compared in the order they arrive, which run has already
sorted by path name.
Source code in src/genomic_benchmarks_qc/evaluate_classes.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |