better method names for read based reference ordered data access.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3069 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
49117819f5
commit
5079f35e40
|
|
@ -110,7 +110,7 @@ public class ReadMetaDataTracker {
|
||||||
*
|
*
|
||||||
* @return a mapping of read offset to ROD(s)
|
* @return a mapping of read offset to ROD(s)
|
||||||
*/
|
*/
|
||||||
public Map<Long, Collection<ReferenceOrderedDatum>> getPositionMapping() {
|
public Map<Long, Collection<ReferenceOrderedDatum>> getReadOffsetMapping() {
|
||||||
return createReadAlignment(record, mapping, null, null);
|
return createReadAlignment(record, mapping, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -119,7 +119,7 @@ public class ReadMetaDataTracker {
|
||||||
*
|
*
|
||||||
* @return a mapping of genome loc position to ROD(s)
|
* @return a mapping of genome loc position to ROD(s)
|
||||||
*/
|
*/
|
||||||
public Map<Long, Collection<ReferenceOrderedDatum>> getGenomeLocMapping() {
|
public Map<Long, Collection<ReferenceOrderedDatum>> getContigOffsetMapping() {
|
||||||
return createGenomeLocAlignment(record, mapping, null, null);
|
return createGenomeLocAlignment(record, mapping, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ public class ReadMetaDataTracker {
|
||||||
*
|
*
|
||||||
* @return a mapping of read offset to ROD(s)
|
* @return a mapping of read offset to ROD(s)
|
||||||
*/
|
*/
|
||||||
public Map<Long, Collection<ReferenceOrderedDatum>> getPositionMapping(String name) {
|
public Map<Long, Collection<ReferenceOrderedDatum>> getReadOffsetMapping(String name) {
|
||||||
return createReadAlignment(record, mapping, null, name);
|
return createReadAlignment(record, mapping, null, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,7 +137,7 @@ public class ReadMetaDataTracker {
|
||||||
*
|
*
|
||||||
* @return a mapping of genome loc position to ROD(s)
|
* @return a mapping of genome loc position to ROD(s)
|
||||||
*/
|
*/
|
||||||
public Map<Long, Collection<ReferenceOrderedDatum>> getGenomeLocMapping(String name) {
|
public Map<Long, Collection<ReferenceOrderedDatum>> getContigOffsetMapping(String name) {
|
||||||
return createGenomeLocAlignment(record, mapping, null, name);
|
return createGenomeLocAlignment(record, mapping, null, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ public class ReadMetaDataTracker {
|
||||||
*
|
*
|
||||||
* @return a mapping of read offset to ROD(s)
|
* @return a mapping of read offset to ROD(s)
|
||||||
*/
|
*/
|
||||||
public Map<Long, Collection<ReferenceOrderedDatum>> getPositionMapping(Class cl) {
|
public Map<Long, Collection<ReferenceOrderedDatum>> getReadOffsetMapping(Class cl) {
|
||||||
return createReadAlignment(record, mapping, cl, null);
|
return createReadAlignment(record, mapping, cl, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -155,7 +155,7 @@ public class ReadMetaDataTracker {
|
||||||
*
|
*
|
||||||
* @return a mapping of genome loc position to ROD(s)
|
* @return a mapping of genome loc position to ROD(s)
|
||||||
*/
|
*/
|
||||||
public Map<Long, Collection<ReferenceOrderedDatum>> getGenomeLocMapping(Class cl) {
|
public Map<Long, Collection<ReferenceOrderedDatum>> getContigOffsetMapping(Class cl) {
|
||||||
return createGenomeLocAlignment(record, mapping, cl, null);
|
return createGenomeLocAlignment(record, mapping, cl, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,10 @@ import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author aaron
|
* @author aaron
|
||||||
*
|
* <p/>
|
||||||
* Class ReadBasedReferenceOrderedViewTest
|
* Class ReadBasedReferenceOrderedViewTest
|
||||||
*
|
* <p/>
|
||||||
* test out the ReadBasedReferenceOrderedView class
|
* test out the ReadBasedReferenceOrderedView class
|
||||||
*/
|
*/
|
||||||
public class ReadBasedReferenceOrderedViewTest extends BaseTest {
|
public class ReadBasedReferenceOrderedViewTest extends BaseTest {
|
||||||
|
|
@ -82,7 +81,7 @@ public class ReadBasedReferenceOrderedViewTest extends BaseTest {
|
||||||
|
|
||||||
for (SAMRecord rec : records) {
|
for (SAMRecord rec : records) {
|
||||||
ReadMetaDataTracker tracker = view.getReferenceOrderedDataForRead(rec);
|
ReadMetaDataTracker tracker = view.getReferenceOrderedDataForRead(rec);
|
||||||
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getPositionMapping();
|
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getReadOffsetMapping();
|
||||||
for (Long i : map.keySet()) {
|
for (Long i : map.keySet()) {
|
||||||
Assert.assertEquals(1, map.get(i).size());
|
Assert.assertEquals(1, map.get(i).size());
|
||||||
}
|
}
|
||||||
|
|
@ -100,9 +99,11 @@ class FakePeekingRODIterator implements LocationAwareSeekableRODIterator {
|
||||||
private GenomeLoc location;
|
private GenomeLoc location;
|
||||||
private ReadMetaDataTrackerTest.FakeRODatum curROD;
|
private ReadMetaDataTrackerTest.FakeRODatum curROD;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
public FakePeekingRODIterator(GenomeLoc startingLoc, String name) {
|
public FakePeekingRODIterator(GenomeLoc startingLoc, String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.location = GenomeLocParser.createGenomeLoc(startingLoc.getContigIndex(),startingLoc.getStart()+1,startingLoc.getStop()+1);;
|
this.location = GenomeLocParser.createGenomeLoc(startingLoc.getContigIndex(), startingLoc.getStart() + 1, startingLoc.getStop() + 1);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -75,9 +75,9 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
|
|
||||||
// count the positions
|
// count the positions
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (Long x : tracker.getPositionMapping().keySet()) {
|
for (Long x : tracker.getReadOffsetMapping().keySet()) {
|
||||||
count++;
|
count++;
|
||||||
Assert.assertEquals(2, tracker.getPositionMapping().get(x).size());
|
Assert.assertEquals(2, tracker.getReadOffsetMapping().get(x).size());
|
||||||
}
|
}
|
||||||
Assert.assertEquals(10, count);
|
Assert.assertEquals(10, count);
|
||||||
}
|
}
|
||||||
|
|
@ -89,9 +89,9 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
|
|
||||||
// count the positions
|
// count the positions
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (Long x : tracker.getPositionMapping().keySet()) {
|
for (Long x : tracker.getReadOffsetMapping().keySet()) {
|
||||||
count++;
|
count++;
|
||||||
Assert.assertEquals(1, tracker.getPositionMapping().get(x).size());
|
Assert.assertEquals(1, tracker.getReadOffsetMapping().get(x).size());
|
||||||
}
|
}
|
||||||
Assert.assertEquals(10, count);
|
Assert.assertEquals(10, count);
|
||||||
}
|
}
|
||||||
|
|
@ -103,7 +103,7 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
|
|
||||||
// count the positions
|
// count the positions
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getPositionMapping("default");
|
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getReadOffsetMapping("default");
|
||||||
for (Long x : map.keySet()) {
|
for (Long x : map.keySet()) {
|
||||||
count++;
|
count++;
|
||||||
Assert.assertEquals(1, map.get(x).size());
|
Assert.assertEquals(1, map.get(x).size());
|
||||||
|
|
@ -117,7 +117,7 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
ReadMetaDataTracker tracker = getRMDT(1, nameSet, false); // create both RODs of the same type
|
ReadMetaDataTracker tracker = getRMDT(1, nameSet, false); // create both RODs of the same type
|
||||||
// count the positions
|
// count the positions
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getPositionMapping(FakeRODatum.class);
|
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getReadOffsetMapping(FakeRODatum.class);
|
||||||
for (Long x : map.keySet()) {
|
for (Long x : map.keySet()) {
|
||||||
count++;
|
count++;
|
||||||
Assert.assertEquals(2, map.get(x).size());
|
Assert.assertEquals(2, map.get(x).size());
|
||||||
|
|
@ -126,6 +126,7 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test this test can be uncommented to determine the speed impacts of any changes to the RODs for reads system
|
// @Test this test can be uncommented to determine the speed impacts of any changes to the RODs for reads system
|
||||||
|
|
||||||
public void filterByMassiveDupType() {
|
public void filterByMassiveDupType() {
|
||||||
|
|
||||||
for (int y = 0; y < 20; y++) {
|
for (int y = 0; y < 20; y++) {
|
||||||
|
|
@ -135,7 +136,7 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
ReadMetaDataTracker tracker = getRMDT(1, nameSet, false); // create both RODs of the same type
|
ReadMetaDataTracker tracker = getRMDT(1, nameSet, false); // create both RODs of the same type
|
||||||
// count the positions
|
// count the positions
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getPositionMapping(FakeRODatum.class);
|
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getReadOffsetMapping(FakeRODatum.class);
|
||||||
for (Long x : map.keySet()) {
|
for (Long x : map.keySet()) {
|
||||||
count++;
|
count++;
|
||||||
Assert.assertEquals(y + 2, map.get(x).size());
|
Assert.assertEquals(y + 2, map.get(x).size());
|
||||||
|
|
@ -154,7 +155,7 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
|
|
||||||
// count the positions
|
// count the positions
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getPositionMapping(Fake2RODatum.class);
|
Map<Long, Collection<ReferenceOrderedDatum>> map = tracker.getReadOffsetMapping(Fake2RODatum.class);
|
||||||
for (long x : map.keySet()) {
|
for (long x : map.keySet()) {
|
||||||
count++;
|
count++;
|
||||||
Assert.assertEquals(1, map.get(x).size());
|
Assert.assertEquals(1, map.get(x).size());
|
||||||
|
|
@ -168,9 +169,9 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
|
|
||||||
// count the positions
|
// count the positions
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (Long x : tracker.getPositionMapping().keySet()) {
|
for (Long x : tracker.getReadOffsetMapping().keySet()) {
|
||||||
count++;
|
count++;
|
||||||
Assert.assertEquals(1, tracker.getPositionMapping().get(x).size());
|
Assert.assertEquals(1, tracker.getReadOffsetMapping().get(x).size());
|
||||||
}
|
}
|
||||||
Assert.assertEquals(2, count);
|
Assert.assertEquals(2, count);
|
||||||
}
|
}
|
||||||
|
|
@ -181,9 +182,9 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
|
|
||||||
// count the positions
|
// count the positions
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (Long x : tracker.getGenomeLocMapping().keySet()) {
|
for (Long x : tracker.getContigOffsetMapping().keySet()) {
|
||||||
count++;
|
count++;
|
||||||
Assert.assertEquals(1, tracker.getGenomeLocMapping().get(x).size());
|
Assert.assertEquals(1, tracker.getContigOffsetMapping().get(x).size());
|
||||||
}
|
}
|
||||||
Assert.assertEquals(10, count);
|
Assert.assertEquals(10, count);
|
||||||
}
|
}
|
||||||
|
|
@ -219,9 +220,7 @@ public class ReadMetaDataTrackerTest extends BaseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/** for testing, we want a fake rod with a different classname, for the get-by-class-name functions */
|
||||||
* for testing, we want a fake rod with a different classname, for the get-by-class-name functions
|
|
||||||
*/
|
|
||||||
static public class Fake2RODatum extends FakeRODatum {
|
static public class Fake2RODatum extends FakeRODatum {
|
||||||
|
|
||||||
public Fake2RODatum(GenomeLoc location, String name) {
|
public Fake2RODatum(GenomeLoc location, String name) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue