Fixed naming inconsistency in SamLocusIterator #715

Merged
merged 1 commit into from Jan 4, 2017
Jump to file or symbol
Failed to load files and symbols.
+37 −31
Split
View
@@ -136,7 +136,7 @@ task testSRA(type: Test) {
task wrapper(type: Wrapper) {
description = "Regenerate the gradle wrapper"
- gradleVersion = '2.13'
+ gradleVersion = '3.2.1'
}
// This is a hack to disable the java 8 default javadoc lint until we fix the html formatting
Binary file not shown.
@@ -1,6 +1,6 @@
-#Fri May 13 14:00:35 EDT 2016
+#Tue Nov 29 15:10:15 EST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip
View
@@ -161,4 +161,9 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
+ cd "$(dirname "$0")"
+fi
+
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
View
@@ -0,0 +1 @@
+rootProject.name = "htsjdk"
@@ -268,13 +268,13 @@ public void addInserted(final SAMRecord read, int firstPosition) {
public List<RecordAndOffset> getInsertedInRecord() {
return (insertedInRecord == null) ? Collections.emptyList() : Collections.unmodifiableList(insertedInRecord);
}
-
- /**
- * @return the number of records overlapping the position, with deletions included if they are being tracked.
+
+ /**
+ * @return the number of records overlapping the position, with deletions included if they are being tracked.
*/
@Override
- public int size() {
- return super.size() + ((deletedInRecord == null) ? 0 : deletedInRecord.size());
+ public int size() {
+ return super.size() + ((deletedInRecord == null) ? 0 : deletedInRecord.size());
}
@@ -284,7 +284,7 @@ public int size() {
*/
@Override
public boolean isEmpty() {
- return getRecordAndPositions().isEmpty() &&
+ return getRecordAndOffsets().isEmpty() &&
(deletedInRecord == null || deletedInRecord.isEmpty()) &&
(insertedInRecord == null || insertedInRecord.isEmpty());
}
@@ -61,7 +61,7 @@ public void testBasicIterator() {
int pos = startPosition;
for (final SamLocusIterator.LocusInfo li : sli) {
Assert.assertEquals(li.getPosition(), pos++);
- Assert.assertEquals(li.getRecordAndPositions().size(), coverage);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), coverage);
Assert.assertEquals(li.size(), coverage);
// make sure that we are not accumulating indels
Assert.assertEquals(li.getDeletedInRecord().size(), 0);
@@ -86,7 +86,7 @@ public void testMissingQualityString() {
int pos = 165;
for (final SamLocusIterator.LocusInfo li : sli) {
Assert.assertEquals(li.getPosition(), pos++);
- Assert.assertEquals(li.getRecordAndPositions().size(), 2);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), 2);
Assert.assertEquals(li.size(), 2);
}
}
@@ -123,7 +123,7 @@ public void testEmitUncoveredLoci() {
} else {
expectedReads = 0;
}
- Assert.assertEquals(li.getRecordAndPositions().size(), expectedReads);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), expectedReads);
Assert.assertEquals(li.size(), expectedReads);
// make sure that we are not accumulating indels
Assert.assertEquals(li.getDeletedInRecord().size(), 0);
@@ -161,7 +161,7 @@ public void testQualityFilter() {
// make sure we accumulated depth coverage for even positions, coverage/2 for odd positions
int pos = startPosition;
for (final SamLocusIterator.LocusInfo li : sli) {
- Assert.assertEquals(li.getRecordAndPositions().size(), (pos % 2 == 0) ? coverage / 2 : coverage);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), (pos % 2 == 0) ? coverage / 2 : coverage);
Assert.assertEquals(li.size(), (pos % 2 == 0) ? coverage / 2 : coverage);
Assert.assertEquals(li.getPosition(), pos++);
// make sure that we are not accumulating indels
@@ -200,15 +200,15 @@ public void testSimpleDeletion() {
Assert.assertEquals(li.getPosition(), pos++);
if (isDeletedPosition) {
// make sure there are no reads without indels
- Assert.assertEquals(li.getRecordAndPositions().size(), 0);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), 0);
Assert.assertEquals(li.size(), coverage); // should include deletions
// make sure that we are accumulating indels
Assert.assertEquals(li.getDeletedInRecord().size(), coverage);
Assert.assertEquals(li.getInsertedInRecord().size(), 0);
} else {
// make sure we are accumulating normal coverage
- Assert.assertEquals(li.getRecordAndPositions().size(), coverage);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), coverage);
Assert.assertEquals(li.size(), coverage);
// make sure that we are not accumulating indels
@@ -241,7 +241,7 @@ public void testSimpleInsertion() {
for (final SamLocusIterator.LocusInfo li : sli) {
Assert.assertEquals(li.getPosition(), pos++);
// make sure we are accumulating normal coverage
- Assert.assertEquals(li.getRecordAndPositions().size(), coverage);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), coverage);
Assert.assertEquals(li.size(), coverage);
// make sure that we are not accumulating deletions
@@ -278,7 +278,7 @@ public void testStartWithInsertion() {
for (final SamLocusIterator.LocusInfo li : sli) {
Assert.assertEquals(li.getPosition(), pos);
// accumulation of coverage
- Assert.assertEquals(li.getRecordAndPositions().size(), (indelPosition) ? 0 : coverage);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), (indelPosition) ? 0 : coverage);
Assert.assertEquals(li.size(), (indelPosition) ? 0 : coverage);
// no accumulation of deletions
@@ -319,7 +319,7 @@ public void testStartWithSoftClipAndInsertion() {
for (final SamLocusIterator.LocusInfo li : sli) {
Assert.assertEquals(li.getPosition(), pos);
// accumulation of coverage
- Assert.assertEquals(li.getRecordAndPositions().size(), (indelPosition) ? 0 : coverage);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), (indelPosition) ? 0 : coverage);
Assert.assertEquals(li.size(), (indelPosition) ? 0 : coverage);
// no accumulation of deletions
Assert.assertEquals(li.getDeletedInRecord().size(), 0);
@@ -364,7 +364,7 @@ public void testNBeforeInsertion() {
}
Assert.assertEquals(li.getPosition(), pos);
// accumulation of coverage
- Assert.assertEquals(li.getRecordAndPositions().size(), (pos == endN) ? 0 : coverage);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), (pos == endN) ? 0 : coverage);
Assert.assertEquals(li.size(), (pos == endN) ? 0 : coverage);
// no accumulation of deletions
Assert.assertEquals(li.getDeletedInRecord().size(), 0);
@@ -416,7 +416,7 @@ public void testNBeforeDeletion() {
final boolean insideDeletion = incIndels && (pos >= startDel && pos <= endDel);
Assert.assertEquals(li.getPosition(), pos);
// accumulation of coverage
- Assert.assertEquals(li.getRecordAndPositions().size(), (insideDeletion) ? 0 : coverage);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), (insideDeletion) ? 0 : coverage);
Assert.assertEquals(li.size(), coverage); // either will be all deletions, or all non-deletions, but always of size `coverage`.
// accumulation of deletions
Assert.assertEquals(li.getDeletedInRecord().size(), (insideDeletion) ? coverage : 0);
@@ -506,18 +506,18 @@ public void testSimpleGappedAlignment() {
if (inDelRange) {
// check the coverage for insertion and normal records
Assert.assertEquals(li.getDeletedInRecord().size(), coverage);
- Assert.assertEquals(li.getRecordAndPositions().size(), 0);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), 0);
Assert.assertEquals(li.size(), coverage); // includes deletions
// check the offset for the deletion
Assert.assertEquals(li.getDeletedInRecord().get(0).getOffset(), expectedReadOffsets[i]);
Assert.assertEquals(li.getDeletedInRecord().get(1).getOffset(), expectedReadOffsets[i]);
} else {
// if it is not a deletion, perform the same test as before
- Assert.assertEquals(li.getRecordAndPositions().size(), coverage);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), coverage);
Assert.assertEquals(li.size(), coverage);
// Assert.assertEquals(li.getDeletedInRecord().size(), 0);
- Assert.assertEquals(li.getRecordAndPositions().get(0).getOffset(), expectedReadOffsets[i]);
- Assert.assertEquals(li.getRecordAndPositions().get(1).getOffset(), expectedReadOffsets[i]);
+ Assert.assertEquals(li.getRecordAndOffsets().get(0).getOffset(), expectedReadOffsets[i]);
+ Assert.assertEquals(li.getRecordAndOffsets().get(1).getOffset(), expectedReadOffsets[i]);
}
++i;
}
@@ -576,12 +576,12 @@ public void testOverlappingGappedAlignmentsWithoutIndels() {
i = 0;
for (final SamLocusIterator.LocusInfo li : sli) {
- Assert.assertEquals(li.getRecordAndPositions().size(), expectedDepths[i]);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), expectedDepths[i]);
Assert.assertEquals(li.size(), expectedDepths[i]);
Assert.assertEquals(li.getPosition(), expectedReferencePositions[i]);
- Assert.assertEquals(li.getRecordAndPositions().size(), expectedReadOffsets[i].length);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), expectedReadOffsets[i].length);
for (int j = 0; j < expectedReadOffsets[i].length; ++j) {
- Assert.assertEquals(li.getRecordAndPositions().get(j).getOffset(), expectedReadOffsets[i][j]);
+ Assert.assertEquals(li.getRecordAndOffsets().get(j).getOffset(), expectedReadOffsets[i][j]);
}
// make sure that we are not accumulating indels
Assert.assertEquals(li.getDeletedInRecord().size(), 0);
@@ -652,12 +652,12 @@ public void testOverlappingGappedAlignmentsWithIndels() {
i = 0;
for (final SamLocusIterator.LocusInfo li : sli) {
// checking the same as without indels
- Assert.assertEquals(li.getRecordAndPositions().size(), expectedDepths[i]);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), expectedDepths[i]);
Assert.assertEquals(li.size(), expectedDepths[i] + expectedDelDepths[i]); // include deletions
Assert.assertEquals(li.getPosition(), expectedReferencePositions[i]);
- Assert.assertEquals(li.getRecordAndPositions().size(), expectedReadOffsets[i].length);
+ Assert.assertEquals(li.getRecordAndOffsets().size(), expectedReadOffsets[i].length);
for (int j = 0; j < expectedReadOffsets[i].length; ++j) {
- Assert.assertEquals(li.getRecordAndPositions().get(j).getOffset(), expectedReadOffsets[i][j]);
+ Assert.assertEquals(li.getRecordAndOffsets().get(j).getOffset(), expectedReadOffsets[i][j]);
}
// check the deletions
Assert.assertEquals(li.getDeletedInRecord().size(), expectedDelDepths[i]);
@@ -670,4 +670,4 @@ public void testOverlappingGappedAlignmentsWithIndels() {
}
}
-}
+}