Skip to content

Commit

Permalink
Require the arguments to the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-Lee committed Oct 1, 2018
1 parent 7bf8d7d commit 94a450a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CAI/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
from .CAI import CAI

@click.command()
@click.option("-s", "--sequence", type=click.Path(exists=True, dir_okay=False), help="The sequence to calculate the CAI for.")
@click.option("-r", "--reference", type=click.Path(exists=True, dir_okay=False), help="The reference sequences to calculate CAI against.")
@click.option("-s", "--sequence", type=click.Path(exists=True, dir_okay=False), help="The sequence to calculate the CAI for.", required=True)
@click.option("-r", "--reference", type=click.Path(exists=True, dir_okay=False), help="The reference sequences to calculate CAI against.", required=True)
@click.option("-g", "--genetic-code", type=int, default=11, help="The genetic code to use. Defaults to 11.")
def cli(reference, sequence, genetic_code):
sequence = SeqIO.read(sequence, "fasta").seq
reference = [str(x.seq) for x in SeqIO.parse(reference, "fasta")]
print(CAI(sequence, reference=reference, genetic_code=genetic_code))


if __name__ == '__main__':
cli()
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
setup(
name='CAI',
packages=["CAI"],
version='1.0.1',
version='1.0.2',
description='Python implementation of codon adaptation index',
long_description=long_description,
author='Benjamin Lee',
Expand All @@ -18,7 +18,7 @@
classifiers=["Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Programming Language :: Python"],
install_requires=['scipy', 'biopython', 'click'],
install_requires=['scipy', 'biopython', 'click>=7'],
tests_require=["pytest"],
setup_requires=['pytest-runner'],
license="MIT",
Expand Down

0 comments on commit 94a450a

Please sign in to comment.