Skip to content

Commit

Permalink
fix: Fixes concerning @tbl3rd's review
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisVerkhoturov committed Jan 25, 2018
1 parent 340248d commit e4c8c0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/main/java/picard/sam/HitsForInsert.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public SAMRecord getSecondOfPair(final int i) {
* @return the index, or -1 if no primary was found.
*/
public int getIndexOfEarliestPrimary() {
for (int i = 0; i < numHits(); i++) {
for (int i = 0; i < numHits(); ++i) {
final SAMRecord firstAligned = getFirstOfPair(i);
final SAMRecord secondAligned = getSecondOfPair(i);
final boolean isPrimaryAlignment = (firstAligned != null && !firstAligned.isSecondaryOrSupplementary()) ||
Expand Down Expand Up @@ -247,12 +247,12 @@ void coordinateByMate() {
final List<SAMRecord> newFirstOfPairOrFragment = new ArrayList<>();
final List<SAMRecord> newSecondOfPair = new ArrayList<>();

for (int i = 0; i < firstOfPairOrFragment.size(); i++) {
for (int i = 0; i < firstOfPairOrFragment.size(); ++i) {
final SAMRecord first = firstOfPairOrFragment.get(i);
newFirstOfPairOrFragment.add(i, first);
newSecondOfPair.add(null);

for (int k = 0; k < secondOfPair.size(); k++) {
for (int k = 0; k < secondOfPair.size(); ++k) {
final SAMRecord second = secondOfPair.get(k);
if (arePair(first, second)) {
newSecondOfPair.set(i, second);
Expand All @@ -262,7 +262,7 @@ void coordinateByMate() {
}
}

for (int i = 0; i < secondOfPair.size(); i++) {
for (int i = 0; i < secondOfPair.size(); ++i) {
if (secondOfPair.get(i) != null) {
newFirstOfPairOrFragment.add(i, null);
newSecondOfPair.add(i, secondOfPair.get(i));
Expand All @@ -278,7 +278,7 @@ void coordinateByMate() {
}

/**
* Identifies weather records present pairwise alignment or not.
* Identifies whether records present pairwise alignment or not.
*
* It is unnecessary to check QNAME here cause an object of {@code HitsForInsert}
* presents only records with the same QNAME.
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/picard/sam/MergeBamAlignmentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ public void testPairedReadsAreProcessedProperlyInAbsenceOfHitIndexTags () throws
}

@Test
public void testCoordinateByMateMethodWorksProperly () throws IOException {
public void testCoordinateByMateMethodWorksProperly () {
final HitsForInsert hitsForInsert = new HitsForInsert();
final SAMFileHeader header = new SAMFileHeader();
header.setSortOrder(SAMFileHeader.SortOrder.queryname);
Expand Down Expand Up @@ -1973,7 +1973,7 @@ public void testCoordinateByMateMethodWorksProperly () throws IOException {
hitsForInsert.addFirstOfPairOrFragment(second);
}

for (int i = 0; i < 3; i++) {
for (int i = 0; i < hitsForInsert.numHits(); i++) {
final SAMRecord first = hitsForInsert.getFirstOfPair(i);
final SAMRecord second = hitsForInsert.getSecondOfPair(i);

Expand Down

0 comments on commit e4c8c0d

Please sign in to comment.