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

griffithlab / pVACtools / 27031497878

05 Jun 2026 06:01PM UTC coverage: 82.563% (-0.04%) from 82.606%
27031497878

push

github

web-flow
Merge pull request #1406 from griffithlab/normalized_percentiles

More missing normalized percentile argument hookups

1 of 1 new or added line in 1 file covered. (100.0%)

5 existing lines in 5 files now uncovered.

9517 of 11527 relevant lines covered (82.56%)

0.83 hits per line

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

91.89
/pvactools/tools/valid_algorithms.py
1
import sys
1✔
2
import argparse
1✔
3

4
from pvactools.lib.prediction_class import *
1✔
5

6
def define_parser():
1✔
7
    parser = argparse.ArgumentParser(
1✔
8
        "pvactools valid_algorithms",
9
        description="Show a list of algorithms supported given the specified species and/or allele",
10
        formatter_class=argparse.ArgumentDefaultsHelpFormatter
11
    )
12
    parser.add_argument(
1✔
13
        "-a", "--allele",
14
        help="Show valid algorithms for the selected allele. "
15
             + "For a list of available alleles, use: `pvactools valid_alleles`.",
16
    )
17
    parser.add_argument(
1✔
18
        "-s", "--species",
19
        choices=sorted(set(list(PredictionClass.allele_to_species_map().values())), key=str.casefold),
20
        help="Show valid algorithms for the selected species only",
21
    )
22
    return parser
1✔
23

24
def main(args_input = sys.argv[1:]):
1✔
25
    parser = define_parser()
1✔
26
    args = parser.parse_args(args_input)
1✔
27

28
    if args.allele is None:
1✔
29
        valid_algorithms = []
1✔
30
        if args.species is None:
1✔
31
            valid_algorithms = PredictionClass.prediction_methods()
×
32
        else:
33
            prediction_algorithms = PredictionClass.prediction_methods()
1✔
34
            for algorithm in prediction_algorithms:
1✔
35
                cls = globals()[algorithm]
1✔
36
                alleles = cls().valid_allele_names()
1✔
37
                for allele in alleles:
1✔
38
                    if cls.species_for_allele(allele) == args.species:
1✔
39
                        valid_algorithms.append(algorithm)
1✔
40
                        break
1✔
41
    else:
42
        PredictionClass.check_alleles_valid([args.allele])
1✔
43
        if (args.species != None and PredictionClass.species_for_allele(args.allele) != args.species):
1✔
44
            raise Exception("Given species does not match given allele.")
1✔
UNCOV
45
            return
×
46
        valid_algorithms = []
1✔
47
        prediction_algorithms = PredictionClass.prediction_methods()
1✔
48
        for algorithm in prediction_algorithms:
1✔
49
            cls = globals()[algorithm]
1✔
50
            alleles = cls().valid_allele_names()
1✔
51
            if (args.allele in alleles) \
1✔
52
                  and (PredictionClass.species_for_allele(args.allele) == args.species \
53
                       or args.species == None):
54
                valid_algorithms.append(algorithm)
1✔
55
    print('\n'.join([a for a in valid_algorithms]))
1✔
56

57
if __name__ == "__main__":
1✔
58
    main()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc