Я написал небольшой и простой интерфейс с Click, я получаю эту ошибку «Ошибка: получены неожиданные дополнительные аргументы», и я просто не могу понять, почему это происходит?
Вот мой setup.py :
from setuptools import setup, find_packages
setup(
name = "transcov",
description = "A software for mapping coverage around transcription start sites",
packages=find_packages("src"),
package_dir={"": "src"},
#test_suite="test",
install_requires=['pysam>=0.15.4', 'numpy>=1.18.1', 'attrs>=19.3.0', 'click>=7.1.1'],
entry_points={
'console_scripts': ['transcov = transcov.cli:cli'],
},
include_package_data=True,
)
Вот мой файл cli.py:
import click
from .generator import generate_coverage_matrix
from .preprocessor import preprocess
from .collapser import collapse
@click.group()
def cli():
pass
@cli.command()
@click.argument('annotation_file')
@click.option('-o', '--output-file', default='transcription_start_sites.tsv')
def preprocess(annotation_file, output_file):
preprocess(annotation_file, output_file)
@cli.command()
@click.argument('bam_file')
@click.argument('tss_file')
@click.option('-k', '--region-size', default=10000)
@click.option('-o', '--output-file', default='coverage_matrix.npy')
def generate(bam_file, tss_file, region_size, output_file):
generate_coverage_matrix(bam_file, tss_file, region_size, output_file)
@cli.command()
@click.argument('matrices', nargs=-1)
@click.option('-o', '--output-file', default='collapsed_matrix.npy')
@click.option('--uint32', is_flag=True)
def collapse(matrices, output_file, uint32):
if len(matrices) > 0:
collapse(matrices, output_file, uint32)
А вот ошибка, которую я получаю при вызове моей программы:
$ transcov preprocess -o gencodes/gencode.v19.annotation.tss.tsv gencodes/gencode.v19.annotation.gff3
Usage: gencodes/gencode.v19.annotation.tss.tsv [OPTIONS] ANNOTATION_FILE
Try 'gencodes/gencode.v19.annotation.tss.tsv --help' for help.
Error: Got unexpected extra arguments (e n c o d e s / g e n c o d e . v 1 9 . a n n o t a t i o n . g f f 3)
Кто-нибудь есть идеи, почему это происходит? Я что-то пропустил?