apriha/snps

Class based source readers?

Opened this issue · 1 comments

Currently, there is a single general Reader class with various methods for different sources.

I wonder if a series of specific classes for different filetypes be better e.g. Reader23andMe, ReaderAncestry, etc. Still keeping the single Reader class overall, but delegating a lot of the details to the specific classes for implementation.

By grouping everything for a particular format together it makes it easier to read, and to add extra sources. Also it would allow subclasses (e.g. for Global Screening Array based sources) to abstract functionality more easily.

Thanks @afaulconbridge, this is a great idea. Since several read functions use the same parser, I wonder if the top level Reader class should implement the parser functions?