Skip to content

Commit

Permalink
Merge pull request #376 from bioinfo-chru-strasbourg/improve_perf
Browse files Browse the repository at this point in the history
fix strict param, add interactive mode #362, add docs #4
  • Loading branch information
antonylebechec authored Jan 23, 2025
2 parents b5476d3 + 49c5a2f commit 2112a4f
Show file tree
Hide file tree
Showing 21 changed files with 18,327 additions and 18,386 deletions.
Binary file modified README.pdf
Binary file not shown.
Binary file modified RELEASE_NOTES.pdf
Binary file not shown.
Binary file modified docs/docs.pdf
Binary file not shown.
Binary file modified docs/help.configuration.calculation.pdf
Binary file not shown.
Binary file modified docs/help.configuration.pdf
Binary file not shown.
Binary file modified docs/help.configuration.prioritization.pdf
Binary file not shown.
8 changes: 8 additions & 0 deletions docs/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,14 @@ <h2 data-number="2.3" id="query"><span
Either None (native), &#39;markdown&#39;, &#39;tabulate&#39; or disabled.</code></pre>
</blockquote>
<p></small></p>
<p><small></p>
<blockquote>
<pre><code> --interactive_mode=&lt;interactive mode&gt; [&#39;table&#39;, &#39;view&#39;] (default: table)

Iteractive mode for variants view.
Either &#39;table&#39; for loading data and speed up queries, or &#39;view&#39; for dynamic queries (slower).</code></pre>
</blockquote>
<p></small></p>
<h2 data-number="2.4" id="export"><span
class="header-section-number">2.4</span> Export</h2>
<p><small></p>
Expand Down
9 changes: 9 additions & 0 deletions docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ Usage examples:
</small>

<small>

> --interactive_mode=<interactive mode> ['table', 'view'] (default: table)
>
> Iteractive mode for variants view.
> Either 'table' for loading data and speed up queries, or 'view' for dynamic queries (slower).
</small>

## Export

<small>
Expand Down
Binary file modified docs/help.parameters.databases.pdf
Binary file not shown.
Binary file modified docs/help.parameters.pdf
Binary file not shown.
Binary file modified docs/help.pdf
Binary file not shown.
33,406 changes: 16,638 additions & 16,768 deletions docs/pdoc/howard/objects/variants.html

Large diffs are not rendered by default.

2,102 changes: 1,066 additions & 1,036 deletions docs/pdoc/howard/tools/interactive.html

Large diffs are not rendered by default.

970 changes: 495 additions & 475 deletions docs/pdoc/howard/tools/tools.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/pdoc/search.js

Large diffs are not rendered by default.

Binary file modified docs/tips.pdf
Binary file not shown.
Binary file modified docs/user_guide.pdf
Binary file not shown.
169 changes: 69 additions & 100 deletions howard/objects/variants.py

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions howard/tools/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def launch_interactive_terminal(
conn = variants.get_connexion()

# Query limit
query_limit = 1000
if "query_limit" in args and args.query_limit is not None:
query_limit = args.query_limit
else:
query_limit = 1000

try:
# Execute query to test connexion
Expand All @@ -58,9 +61,19 @@ def launch_interactive_terminal(
log.debug("View 'header' can not be loaded")

# Variants table param
if "interactive_mode" in args and args.interactive_mode is not None:
interactive_mode = args.interactive_mode
else:
interactive_mode = "table"
log.debug(f"Interactive mode set to '{interactive_mode}'")

view_name = "variants_view"
view_type = "table"
view_mode = "full"
if interactive_mode == "view":
view_type = "view"
view_mode = "explore"
elif interactive_mode == "table":
view_type = "table"
view_mode = "full"

# Create variants table
log.debug(f"Loading table '{view_name}' as '{view_type}' (mode '{view_mode}')")
Expand All @@ -77,8 +90,10 @@ def launch_interactive_terminal(
detect_type_list=True,
drop_view=True,
)
except:
except Exception as e:
log.warning(f"View '{view_name}' can not be created")
log.warning(f"Error: {e}")
log.warning("Please check variants annotations formats")

# Print welcome message
log.info("Interactive DuckDB SQL terminal")
Expand Down Expand Up @@ -506,7 +521,7 @@ def print_prompt(line: int = 0) -> str:
rows_plus = result.fetchmany(1)

if rows_plus or (query_limited_check and len(rows) == query_limit):
msg_query_limit = f"Only {query_limit} lines shown (use 'limit' command to change)"
msg_query_limit = f"Only {query_limit} first lines shown (use 'limit' command to change)"
else:
msg_query_limit = None
# Get column names
Expand Down
22 changes: 21 additions & 1 deletion howard/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,22 @@ def __call__(self, string):
"action": "store_true",
"default": False,
},
"interactive_mode": {
"metavar": "interactive mode",
"help": """Iteractive mode for variants view.\n"""
"""Either 'table' for loading data and speed up queries"""
""", or 'view' for dynamic queries (slower).\n""",
"default": "table",
"type": str,
"choices": ["table", "view"],
"gooey": {"widget": "Dropdown", "options": {}},
"extra": {
"examples": {
"Table mode": '"interactive_mode": "table"',
"View mode": '"interactive_mode": "view"',
}
},
},
# Verbosity
"quiet": {"help": argparse.SUPPRESS, "action": "store_true", "default": False},
"verbose": {"help": argparse.SUPPRESS, "action": "store_true", "default": False},
Expand Down Expand Up @@ -1832,7 +1848,11 @@ def __call__(self, string):
"explode_infos_prefix": False,
"explode_infos_fields": False,
},
"Query": {"query_limit": False, "query_print_mode": False},
"Query": {
"query_limit": False,
"query_print_mode": False,
"interactive_mode": False,
},
"Export": {"include_header": False, "parquet_partitions": False},
},
},
Expand Down
Binary file modified plugins/README.pdf
Binary file not shown.

0 comments on commit 2112a4f

Please # to comment.