Repository navigation
4.0
This release has been in development for 6 months (sorry for the delay!) and that's because it has so many changes and new features. The docs still need to be updated, but please review the changes in 4.0 if you're upgrading from previous versions.
New
new commands
diagnosenow has 2 subcommands:stall: same as previousdiagnosebehavior, where it runs snakemake with--dry-run --debug-dagrule: attempt to directly run the failing rule of a workflow as identified in the snakemake log, will attempt to run snakemake to generate missing inputs if necessary
phase bamadded for more fine-tuned and configurable alignment phasingreportadded to render new ipython reports as a MySTmd websiteharpy viewnow has the aliashv- when erroring, harpy will create hidden file
.harpyerrorwith the name of the directory associated with the last error - calling hv config/log/error/profile/snakefile without arguments is allowed and will default to the directory in
.harpyerror - this now streamlines troubleshooting to: harpy workflow terminates with error ->
hv logorhv config
- when erroring, harpy will create hidden file
- all user-accessible harpy utility scripts now live under
harpy-utils, which has its own CLI and is a consistent access point than remembering the names of specific utilities you may want to use- the new Go utilities are internal (for now) and not exposed by
harpy-utils
- the new Go utilities are internal (for now) and not exposed by
new options
-
resumehas new--directoption to call Snakemake directly without harpy intervention -
hidden common option
--cleanwith the optionsw,s, and/orl, to remove theworkflow/,.snakemake/, and/orlogs/directories in the output- this option is hidden because it's meant more for development
- options provided as sequential letters (e.g.
ws,sl,lw, etc.)
-
the
-T/--notempoption in snakemake is exposed in harpy commands as--no-tempto simplify using it -
all common workflow options have a capital letter short-name
short long -H--hpc-C--container-Q--quiet-S--snakemake-R--skip-reports-N--setup
miscellaneous new
- output log of checks and validations printed to console so Harpy is transparent about any observed delays before kicking off Snakemake
- disabled when
--quiet> 0
- disabled when
- progress bar has a new column to show a count of the active jobs!
- now featuring Go code!
- some utilities replaced with newly-written Go programs
- future versions will have bottlenecking utility scripts replaced with Go counterparts
- this will be a slow process as I learn more Go
- time elapsed column in progress bar pauses when there are no active jobs for that rule (better reflecting the actual time elapsed)
- added "workflow setup complete" text when using
--setup - added "all stuff is there" equivalent text when snakemake reports there is nothing to do
Deprecations
convert(replaced byDjinnsoftware)downsample(replaced byDjinnsoftware)simulate(replaced byMimickandVISOR-HACkssoftwares)
Renamed
config.yamlis nowprofile.yamlto minimize confusion and make it aligned with latest Snakemake versionview snakeparamshas been updated toview profileto match this
demultiplexis nowpreprocessto better reflect what the commands do--setup-onlyreplaced with the more succinct--setup- short-name for
--threadsis now-@(nod to htslib) --output-dirreplaced with--output- short-name for
--outputis now-O
- short-name for
Workflows
workflow configs
- the
workflow.yamlfiles now all have a standard/consistent format with three main sections whose names are capitalized (whereas all the rest are lowercase):Workflow: with common information (name, linkedread info, report skip/contigs, harpy-specific snakemake things)Parameters: the run configurations resulting from command-line arguments/optionsInputs: the input files- this means previous
workflow.yamlfiles are incompatible with this and future versions
- all
workflow.yamlkeys use hyphens instead of underscores to reduce keystrokes- e.g.
min_len=>min-len
- e.g.
- hpc.yaml profile parameters now merged into
profile.yamlso all the profile information exists in a single file (internal change) - workflow yaml files now include a
VERSIONvariable that syncs with the Harpy version used- populates the
containerversion tags within snakefile rules - this makes container versions reliable by default, but entirely hackable to manually dissociate harpy version and container version
- populates the
harpy align
- align workflows now use
mosdepthto calculate depth - alignment stats are generated from raw alignment records, better reflecting the raw alignment performance of data
- aggregate report correctly reports %linked reads rather than molecules
harpy diagnose
diagnoseis nowdiagnose stallto accomodate distinction from newdiagnose rule
harpy phase
phasehas been renamedphase snpto accommodate a disctinction from the newphase bamworkflow
harpy qc
--min-lengthand--max-lengthconsolidated into--length min,max- minimum mapping quality has been consistenlty named
min-map-qualityin allworkflow.yamlfiles
harpy sv
sv naibrno longer phases input alignment files, use the newphase bammodule for that- 4 SV reports consolidated into 1
Reports
Reports have been completely rewritten (for the third time), moving away from R/Quarto to Python/Jupyter. This change was necessary to achieve specific quality-of-life improvements that were not possible with the current setup:
- report generation is significantly faster because Quarto isn't trying to render each as a standalone HTML file
- IPython notebooks store the results within themselves, which can be accessed whenever via JupyterLab/VScode/etc
- all harpy-generated (non-MultiQC) reports can be bound and built into a singular report website using
harpy reportwith navigation between pages, searching, etc. - plots are now generated with Altair (Vega/Vegalite) plotting library, which is very fast, interactive, and reactive, with a more permissible license than Highcharts, which use a restrictive software license
Internal
- significant rewrite of the
Workflowclass and how it expects workflow, parameter, and input delcarations - printing functions consolidated into
HarpyPrintclass - workflow error reporting rewritten:
- now includes harpy version
- not relying on
whileloops of snakemake output (less likely for infinite hang after error) - visual overhaul to make it less overwhelming
- swapped order of validations/checks
- CLI input validations are for fast basic checks (e.g. naming conventions, presence/absence)
- harpy validations are for more involved checks (formatting, consistency, inter-parameter checks)
- Snakemake process monitoring saw a significant rewrite
- the new internals are easier to develop and should hopefully have more consistent exiting behavior
resumelogic reorganized updated to match new workflow configuration design- the
--workflow-profilepart of the snakemake command (when using hpc) has been moved toprofile.yamlto further reduce the length of the snakemake call - grouped and single-sample leviathan variant calling now use a single consolidated snakefile
- grouped and single-sample naibr variant calling now use a single consolidated snakefile
- workflow info printing handled differently to be more flexible
Fixes
- more accurate optical duplication detection by setting the distance parameter using
harpy-utils optical-dist, which has a more comprehensive lookup of instrument codes - removed redundant validations between CLI checks and harpy checks
- wording improvements for errors and doc text
- [hopefully] no more double-printing of Snakemake errors
VScode + xeus-python bug
Using the xeus-python kernel for the reports includes an odd edge case that can be easily avoided.
TL;DR
The root cause is essentially VS Code trying to upsell its Native REPL to users it thinks might benefit from it, without properly scoping that behavior away from already-running kernel sessions.
Fix
Change VScode python.terminal.shellIntegration.enabled setting to false:
"python.terminal.shellIntegration.enabled": falseTechnical Details
VS Code's Python extension has a feature called the Native REPL, which is an integrated interactive environment that it tries to promote when it detects certain kernel types. When you use xeus-python, VS Code identifies it as a non-standard kernel (since it's not the default IPython/ipykernel) and injects that "Ctrl+click to launch VS Code Native REPL" message as a kind of prompt/advertisement at the top of the notebook or interactive window output.
This injection happens at the extension level, not from xeus-python itself — the message is being inserted by the Pylance or Python VS Code extension into the output stream before your kernel's actual output. Chaos and sadness ensues.