The location of indels can be retrieved from a PairwiseAlignmentsSingleSubject object by using indel. Determining any difference between the two sequences, including substitutions, is not quick nor easy. I suppose that summary displays details of the mismatches, but the variable is of class PairwiseAlignmentsSingleSubjectSummary which has no documented accessors. So, the code to access the information looks bad.
SubjectPosition Subject Pattern Count Probability
1 2 T A 1 1
2 3 T A 1 1
This could be improved with accessors for end users.
Also, instead of being a data.frame, this would be better stored as IRanges with associated metadata columns, accessible with mcols, so that methods like reduce could easily be used to look for contiguous blocks of differences.
Is there a reason why the show method for the summary only shows mismatches, even if there are indels contained in it? This seems arbitrary and also misleading, because it always gives a false impression that there are no indels.
Could the return data types consistently be made to be IRanges ? Sometimes it's IntegerList, sometimes it's IRanges. For example,
11-letter "DNAString" instance
8-letter "DNAString" instance
> alignment <- pairwiseAlignment(A, B, gapOpening = 0, gapExtension = 1, substitutionMatrix = substitutions)
IntegerList of length 1
IRangesList of length 1
IRanges of length 1
start end width
 8 9 2
Lastly, why are functions like insertion, deletion, and indel documented in Numeric Summary Methods? Unlike nchar and score, they are not numerical summaries of the data.
It'd be nice to see this part of Biostrings thoroughly refactored with more focus on UX.
University of Sydney
Camperdown NSW 2050