Waypoint check-in: a couple of changes to for Tribble, and adding some options to the integration test for passing in auxillary files that aren’t “%s” command line options.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2925 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
6759acbdef
commit
c8077b7a22
|
|
@ -72,6 +72,16 @@ public class FeatureReaderTrack extends RMDTrack implements QueryableTrack {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* do we support the query interface?
|
||||
*
|
||||
* @return true
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsQuery() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<GATKFeature> query(GenomeLoc interval) throws IOException {
|
||||
return new FeatureToGATKFeatureIterator(reader.query(interval.getContig(),(int)interval.getStart(),(int)interval.getStop()),this.getName());
|
||||
|
|
|
|||
|
|
@ -85,4 +85,10 @@ public abstract class RMDTrack {
|
|||
public boolean matches(String name, String type) {
|
||||
return (name.equals(this.name) && type.equals(this.type.getSimpleName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* do we support the query interface?
|
||||
* @return true if we can be cast to the QueryableTrack interface
|
||||
*/
|
||||
public abstract boolean supportsQuery();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
package org.broadinstitute.sting.gatk.refdata.tracks;
|
||||
|
||||
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData;
|
||||
import org.broadinstitute.sting.gatk.refdata.SeekableRODIterator;
|
||||
import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature;
|
||||
import org.broadinstitute.sting.gatk.refdata.utils.LocationAwareSeekableRODIterator;
|
||||
import org.broadinstitute.sting.gatk.refdata.utils.RODRecordList;
|
||||
|
|
@ -40,7 +39,7 @@ import java.util.Iterator;
|
|||
*
|
||||
* Class RODRMDTrack
|
||||
*
|
||||
* wrap a reference ordered data object in the new track style. This will hopefully be phased-out as we move to
|
||||
* wrap a reference ordered data object in the new track style. This track will hopefully be phased-out as we move to
|
||||
* a FeatureReader based system.
|
||||
*/
|
||||
public class RODRMDTrack extends RMDTrack {
|
||||
|
|
@ -67,15 +66,29 @@ public class RODRMDTrack extends RMDTrack {
|
|||
*/
|
||||
@Override
|
||||
public Iterator<GATKFeature> getIterator() {
|
||||
return new SRIToIterator(data.iterator());
|
||||
return new RODIteratorToRMDIterator(data.iterator());
|
||||
}
|
||||
|
||||
/**
|
||||
* do we support the query interface?
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsQuery() {
|
||||
return false; // sadly no, we don't
|
||||
}
|
||||
}
|
||||
|
||||
class SRIToIterator implements Iterator<GATKFeature> {
|
||||
/**
|
||||
* this class wraps a ROD iterator, so that it produces GATKFeatures (basicly features that can generate a GenomeLoc
|
||||
* for its position).
|
||||
*/
|
||||
class RODIteratorToRMDIterator implements Iterator<GATKFeature> {
|
||||
private RODRecordList list = null;
|
||||
private LocationAwareSeekableRODIterator iterator = null;
|
||||
|
||||
SRIToIterator(LocationAwareSeekableRODIterator iter) {
|
||||
RODIteratorToRMDIterator(LocationAwareSeekableRODIterator iter) {
|
||||
iterator = iter;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
public class WalkerTest extends BaseTest {
|
||||
public String assertMatchingMD5(final String name, final File resultsFile, final String expectedMD5 ) {
|
||||
|
|
@ -90,6 +89,8 @@ public class WalkerTest extends BaseTest {
|
|||
List<String> md5s = null;
|
||||
List<String> exts = null;
|
||||
|
||||
Map<String,File> auxillaryFiles = new HashMap<String,File>();
|
||||
|
||||
public WalkerTestSpec(String args, int nOutputFiles, List<String> md5s) {
|
||||
this.args = args;
|
||||
this.nOutputFiles = nOutputFiles;
|
||||
|
|
@ -102,6 +103,10 @@ public class WalkerTest extends BaseTest {
|
|||
this.md5s = md5s;
|
||||
this.exts = exts;
|
||||
}
|
||||
|
||||
public void addAuxFile(String expectededMD5sum, File outputfile) {
|
||||
auxillaryFiles.put(expectededMD5sum,outputfile);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean parameterize() {
|
||||
|
|
@ -125,6 +130,28 @@ public class WalkerTest extends BaseTest {
|
|||
System.out.println(Utils.dupString('-', 80));
|
||||
System.out.println(String.format("Executing test %s with GATK arguments: %s", name, args));
|
||||
|
||||
List<String> md5s = new LinkedList<String>();
|
||||
md5s.addAll(spec.md5s);
|
||||
|
||||
// check to see if they included any auxillary files, if so add them to the list
|
||||
for (String md5 : spec.auxillaryFiles.keySet()) {
|
||||
md5s.add(md5);
|
||||
tmpFiles.add(spec.auxillaryFiles.get(md5));
|
||||
}
|
||||
|
||||
return executeTest(name, md5s, tmpFiles, args);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* execute the test, given the following:
|
||||
* @param name the name of the test
|
||||
* @param md5s the list of md5s
|
||||
* @param tmpFiles the temp file corresponding to the md5 list
|
||||
* @param args the argument list
|
||||
* @return a pair of file and string lists
|
||||
*/
|
||||
private Pair<List<File>, List<String>> executeTest(String name, List<String> md5s, List<File> tmpFiles, String args) {
|
||||
CommandLineGATK instance = new CommandLineGATK();
|
||||
String[] command;
|
||||
|
||||
|
|
@ -142,8 +169,8 @@ public class WalkerTest extends BaseTest {
|
|||
throw new RuntimeException("Error running the GATK with arguments: " + args);
|
||||
}
|
||||
|
||||
return new Pair<List<File>, List<String>>(tmpFiles, assertMatchingMD5s(name, tmpFiles, spec.md5s));
|
||||
}
|
||||
return new Pair<List<File>, List<String>>(tmpFiles, assertMatchingMD5s(name, tmpFiles, md5s));
|
||||
}
|
||||
|
||||
private static String[] escapeExpressions(String args, String delimiter) {
|
||||
String[] command = {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue