varfish-org / varfish-cli

VarFish REST API client (CLI + Python package)
MIT License
2 stars 3 forks source link

Genome build check method crashes for empty results #12

Closed eudesbarbosa closed 1 year ago

eudesbarbosa commented 2 years ago

Issue Error while trying to validate empty CNV files:

[I 220517 15:24:52] ... checking genomebuild consistency ...
Traceback (most recent call last):
  File "MINICONDA/bin/cubi-tk", line 33, in <module>
    sys.exit(load_entry_point('cubi-tk', 'console_scripts', 'cubi-tk')())
  File "PATH/cubi-tk/cubi_tk/__main__.py", line 123, in main
    res = cmds[args.cmd](args, parser, subparsers.choices[args.cmd] if args.cmd else None)
  File "PATH/cubi-tk/cubi_tk/snappy/__init__.py", line 97, in run
    return args.snappy_cmd(args, parser, subparser)
  File "PATH/cubi-tk/cubi_tk/snappy/varfish_upload.py", line 263, in run
    return SnappyVarFishUploadCommand(args).execute()
  File "PATH/cubi-tk/cubi_tk/snappy/varfish_upload.py", line 180, in execute
    self._process_dataset(dataset)
  File "PATH/cubi-tk/cubi_tk/snappy/varfish_upload.py", line 254, in _process_dataset
    varfish_cli_main(args[1:])
  File "MINICONDA/lib/python3.8/site-packages/varfish_cli/__main__.py", line 109, in main
    res = cmds[args.cmd](
  File "MINICONDA/lib/python3.8/site-packages/varfish_cli/case/__init__.py", line 31, in run
    return args.case_cmd(config, toml_config, args, parser, subparser)
  File "MINICONDA/lib/python3.8/site-packages/varfish_cli/case/create_case_import.py", line 861, in run
    return CaseImporter(config).run()
  File "MINICONDA/lib/python3.8/site-packages/varfish_cli/case/create_case_import.py", line 281, in run
    self._check_genomebuild_consistency()
  File "MINICONDA/lib/python3.8/site-packages/varfish_cli/case/create_case_import.py", line 433, in _check_genomebuild_consistency
    line = inputf.readline().splitlines(keepends=False)[0].split("\t")

To Reproduce Steps to reproduce the behavior:

  1. Go to 'NAMSE' directory
  2. Run cubi-tk snappy varfish-upload --min-batch 210 --yes <UUID> Batch contains empty file for XHMM: .gts.tsv.gz
    release<tab>chromosome<tab>chromosome_no<tab>start<tab>end<tab>bin<tab>start_ci_left<tab>start_ci_right<tab>end_ci_left<tab>end_ci_right<tab>case_id<tab>set_id<tab>sv_uuid<tab>caller<tab>sv_type<tab>sv_sub_type<tab>info<tab>genotype

    .feature-effects.tsv.gz

    case_id<tab>set_id<tab>sv_uuid<tab>refseq_gene_id<tab>refseq_transcript_id<tab>refseq_transcript_coding<tab>refseq_effect<tab>ensembl_gene_id<tab>ensembl_transcript_id<tab>ensembl_transcript_coding<tab>ensembl_effect

Expected behavior Expected to validate header as to check the pipeline ran correctly. Ignore line if file is contains no entries.

eudesbarbosa commented 2 years ago

From cubi-tk usage https://github.com/bihealth/cubi-tk/issues/88