-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Hello- It seems that CAVA throws an exception if the input VCF file has no records. This is what I get:
cava.py -i in.vcf -c cava.config
-----------------------------------------------------------------------
CAVA (Clinical Annotation of VAriants) v1.2.2 is now running.
Started: 2017-08-14 09:25:16.991644
Configuration file: cava.config
Input file (VCF): in.vcf
Output file (VCF): output.vcf
Log file: output.log
Input file contains 0 records to annotate.
Traceback (most recent call last):
File "/home/db291g/applications/cava/CAVA/cava.py", line 420, in <module>
breaks = findFileBreaks(copts.input, copts.threads)
File "/home/db291g/applications/cava/CAVA/cava.py", line 134, in findFileBreaks
delta = int((counter - first + 1) / threads)
UnboundLocalError: local variable 'first' referenced before assignment
I think a vcf with no records is a legitimate input so I fixed this on my local copy by adding this check just after https://github.com/RahmanTeam/CAVA/blob/master/cava.py#L416 :
if numOfRecords == 0:
sys.stderr.write('Done. Nothing to be annotated.\n')
sys.exit(0)
In this way cava writes out the VCF header and exits clean.
Maybe it should be fixed in the master as well?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels