• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openvax / topiary / 24208686578

09 Apr 2026 07:15PM UTC coverage: 86.262% (+0.2%) from 86.074%
24208686578

Pull #100

github

iskandr
DSL polish: direction docs, log2/log1p, filter_by, parser errors, argcomplete

Direction clarity:
- Fix norm() docstring (claimed 0.977, actual was 0.023)
- Document that norm() is "higher in → higher out" (use for scores)
- Document that logistic() is "lower in → higher out" (use for IC50)

New transforms:
- .log2() — base-2 logarithm
- .log1p() — log(1+x), accurate for small x

filter_by parameter:
- Rename filter → filter_by on TopiaryPredictor (filter kept as
  deprecated alias)
- Accept string expressions: filter_by="affinity <= 500 | el.rank <= 2"

Parser error quality:
- "Did you mean" suggestions for kind typos (afinity → affinity)
- "Did you mean" suggestions for field typos (rnk → rank)
- Clear "must be a number" error for non-numeric thresholds
- Better error for reversed expressions (500 <= affinity)

argcomplete:
- Move from optional to default dependency (zero deps, 43 kB)
- Remove conditional import, remove [completion] extra
- Tab completion works out of the box after activate-global-python-argcomplete

Remove pirlygenes install note from README (it's an optional dep that
auto-errors with install instructions when needed).

25 new tests, 343 total passing.
Pull Request #100: DSL polish: direction docs, log2/log1p, filter_by, parser errors

30 of 40 new or added lines in 3 files covered. (75.0%)

61 existing lines in 1 file now uncovered.

1394 of 1616 relevant lines covered (86.26%)

2.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/topiary/cli/script.py
1
# Licensed under the Apache License, Version 2.0 (the "License");
2
# you may not use this file except in compliance with the License.
3
# You may obtain a copy of the License at
4
#
5
#       http://www.apache.org/licenses/LICENSE-2.0
6
#
7
# Unless required by applicable law or agreed to in writing, software
8
# distributed under the License is distributed on an "AS IS" BASIS,
9
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
# See the License for the specific language governing permissions and
11
# limitations under the License.
12

13
"""
14
Script to generate epitope predictions from somatic cancer variants
15
and (optionally) tumor RNA-seq data.
16

17
Example usage:
18
    topiary \
19
        --mhc-predictor netmhcpan
20
        --mhc-alleles-file HLA.txt
21
        --vcf somatic.vcf
22
        --rna-gene-fpkm-file genes.fpkm_tracking
23
        --rna-transcript-fpkm-file isoforms.fpkm_tracking
24
        --filter-ic50 500
25
        --filter-percentile 2
26
        --output results.csv
27
"""
28

29
import sys
×
30

NEW
31
import argcomplete
×
32

33
from .args import arg_parser, predict_epitopes_from_args
×
34

35
from .outputs import write_outputs
×
36

37

38
def parse_args(args_list=None):
×
39
    if args_list is None:
×
40
        args_list = sys.argv[1:]
×
NEW
41
    argcomplete.autocomplete(arg_parser)
×
42
    return arg_parser.parse_args(args_list)
×
43

44

45
def main(args_list=None):
×
46
    """
47
    Script entry-point to predict neo-epitopes from genomic variants using
48
    Topiary.
49
    """
50
    args = parse_args(args_list)
×
51
    print("Topiary commandline arguments:")
×
52
    print(args)
×
53
    df = predict_epitopes_from_args(args)
×
54
    write_outputs(df, args)
×
55
    print("Total count: %d" % len(df))
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc