calculate Coverage And Identity
This function will walk the ref and query sequences, checking for bp coverage, and bp matches. The counts at each overlapping position in the coverageArray and identityArray will be updated The alignments pulled are those that overlap the user requested coordinates so it is necessary to calculate the start and end positions on the alignment that should be processed. This function processes a single alignment block. It may have multiple query sequences, but they are all to the same contig and coordinates on that contig
This method assumes the alignments List contains only the "s" lines, with ref line first Any existing "i,"e" or "q" lines from the alignment block should have been filtered by the calling method.
If there is need for this to be called from a process that will not have filtered for only S lines, we could add additional filtering at the begining and then process the filteredAlignments
val filteredAlignments = alignments.filter { it.startsWith("s")}