Skip to content

Commit

Permalink
Fixed wrong sequenceHistory tracking in case of sequence-based merge …
Browse files Browse the repository at this point in the history
…events. Minor fix for exportAlignmentsPretty translation mechanism.
  • Loading branch information
dbolotin committed Apr 6, 2018
1 parent 39cea2e commit a25ba11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,16 @@ public static void drawAASequence(MultiAlignmentHelper helper, SequencePartition
++aaPosition;
}
while (aaPosition < aa.size() &&
aa.codeAt(aaPosition) != AminoAcidAlphabet.INCOMPLETE_CODON) {
(aaPosition < aa.size() - 1 || aa.codeAt(aaPosition) != AminoAcidAlphabet.INCOMPLETE_CODON)) {
ntPosition = trParam.range.getFrom()
+ AminoAcidSequence.convertAAPositionToNt(aaPosition, mainSequence.size(),
trParam.translationParameters);
line[helper.subjectToAlignmentPosition(ntPosition + 1)] =
AminoAcidSequence.ALPHABET.codeToSymbol(aa.codeAt(aaPosition));
++aaPosition;
}
if (aaPosition < aa.size() && aa.codeAt(aaPosition) == AminoAcidAlphabet.INCOMPLETE_CODON) {
if (aaPosition < aa.size() &&
(aaPosition < aa.size() - 1 || aa.codeAt(aaPosition) != AminoAcidAlphabet.INCOMPLETE_CODON)) {
ntPosition = trParam.range.getFrom()
+ AminoAcidSequence.convertAAPositionToNt(aaPosition, mainSequence.size(),
trParam.translationParameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,16 @@ protected VDJCAlignmentResult<PairedRead> process0(final PairedRead read) {
new SequenceHistory[]{
new SequenceHistory.Merge(
SequenceHistory.OverlapType.SequenceOverlap,
new SequenceHistory.RawSequence(read.getId(), (byte) (isRC ? 1 : 0), false, read.getR1().getData().size()),
new SequenceHistory.RawSequence(read.getId(), (byte) (isRC ? 0 : 1), merged.isReversed(), read.getR2().getData().size()),
merged.getOffset(), merged.getErrors())
new SequenceHistory.RawSequence(read.getId(),
(byte) (isRC ? 1 : 0), false,
(isRC ? read.getR2().getData().size() : read.getR1().getData().size())),
new SequenceHistory.RawSequence(read.getId(),
(byte) (isRC ? 0 : 1), merged.isReversed(),
(isRC ? read.getR1().getData().size() : read.getR2().getData().size())),
isRC
? merged.getOffset() + read.getR2().getData().size() - read.getR1().getData().size()
: merged.getOffset(),
merged.getErrors())
},
new SequenceRead[]{read});
}
Expand Down

0 comments on commit a25ba11

Please sign in to comment.