Came across a small bug on L453 of cravat_convert.py.
When running with multiple VCF files that have empty sample ids, L453 throws a KeyError: 'sample_id', before the else statement can execute.
Simple fix to change L453 to the following:
if "sample_id" in wdict:
This will eliminate the KeyError, by correctly checking if the key is present in the dictionary and allow the if-statement block to execute the else-statement correctly.
@meyerkm Thanks for catching this. I put in the fix as suggested, hopefully it will make the next release. Also, we'll plan on adding some unit tests for cravat_convert in the near future.
Came across a small bug on L453 of cravat_convert.py. When running with multiple VCF files that have empty sample ids, L453 throws a
KeyError: 'sample_id'
, before the else statement can execute.[https://github.com/KarchinLab/open-cravat/blob/6c0c7ce283eb568afeb9f9360ef20cf89fdbc518/cravat/cravat_convert.py#L453]
if wdict["sample_id"]:
Simple fix to change L453 to the following:
if "sample_id" in wdict:
This will eliminate the KeyError, by correctly checking if the key is present in the dictionary and allow the if-statement block to execute the else-statement correctly.