Skip to content

Commit

Permalink
handle empty vcfs
Browse files Browse the repository at this point in the history
  • Loading branch information
PlushZ committed May 21, 2024
1 parent 76c174d commit a2376b6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions virheat/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,15 @@ def main(sysargs=sys.argv[1:]):

# extract vcf info
n_scores = 0
if args.scores:
reference_name, frequency_lists, unique_mutations, file_names = data_prep.extract_vcf_data(vcf_files, threshold=args.threshold, scores=True)
n_scores = len(args.scores)
if not vcf_files:
sys.exit("\033[31m\033[1mERROR:\033[0m No VCF files provided")
else:
reference_name, frequency_lists, unique_mutations, file_names = data_prep.extract_vcf_data(vcf_files, threshold=args.threshold)
if args.scores:
reference_name, frequency_lists, unique_mutations, file_names = data_prep.extract_vcf_data(vcf_files, threshold=args.threshold, scores=True)
n_scores = len(args.scores)
else:
reference_name, frequency_lists, unique_mutations, file_names = data_prep.extract_vcf_data(vcf_files, threshold=args.threshold)

if args.zoom:
unique_mutations = data_prep.zoom_to_genomic_regions(unique_mutations, args.zoom)
frequency_array = data_prep.create_freq_array(unique_mutations, frequency_lists)
Expand Down

1 comment on commit a2376b6

@jonas-fuchs
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice, good catch!

Please sign in to comment.