EBIvariation / vcf-validator

Validation suite for Variant Call Format (VCF) files, implemented using C++11
Apache License 2.0
130 stars 39 forks source link

Extracted record.cpp check blocks into private methods #66

Closed Anishka0107 closed 7 years ago

Anishka0107 commented 7 years ago

In this PR, the various check blocks of the methods in record.cpp have been extracted into new private methods. Though it is unrelated to this PR, I have added the version checking for duplicate ID, because in earlier commits, duplicate IDs threw an error for v4.1 and v4.2, which was wrong. So, now it only throws error for v4.3 in case of duplicate IDs.

Anishka0107 commented 7 years ago

@cyenyxe @jmmut I have not included comments for the new methods introduced in record.hpp and will put in them in a new commit to this PR once it is made sure that I am doing the extraction correctly. Also, I have not done the extraction for the method check_samples() yet as it seemed a bit complicated and will do that also in the next commit if needed.

cyenyxe commented 7 years ago

These changes look good to me. The options I see for extracting code from check_samples are:

  1. Initial check
  2. This block is not a check but is still quite self-contained
  3. This block checks the number of fields in a sample column
  4. In fact, this whole block could be turned into check_sample (notice the singular)

@jmmut please confirm you would be fine with these changes too.

Anishka0107 commented 7 years ago

@jmmut @cyenyxe Should I add a commit with the new changes you suggested above?

cyenyxe commented 7 years ago

Yes please.