generic declarations added here and there to eliminate a few annoying warnings; no consequential changes
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@268 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
4bc035d919
commit
5d9b068b8b
|
|
@ -8,6 +8,7 @@ import net.sf.samtools.SAMSequenceRecord;
|
||||||
import net.sf.samtools.util.RuntimeIOException;
|
import net.sf.samtools.util.RuntimeIOException;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData;
|
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData;
|
||||||
|
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum;
|
||||||
import org.broadinstitute.sting.gatk.refdata.rodDbSNP;
|
import org.broadinstitute.sting.gatk.refdata.rodDbSNP;
|
||||||
import org.broadinstitute.sting.gatk.refdata.rodGFF;
|
import org.broadinstitute.sting.gatk.refdata.rodGFF;
|
||||||
import org.broadinstitute.sting.gatk.refdata.HapMapAlleleFrequenciesROD;
|
import org.broadinstitute.sting.gatk.refdata.HapMapAlleleFrequenciesROD;
|
||||||
|
|
@ -155,26 +156,24 @@ public class GenomeAnalysisTK extends CommandLineProgram {
|
||||||
|
|
||||||
protected int execute() {
|
protected int execute() {
|
||||||
final boolean TEST_ROD = false;
|
final boolean TEST_ROD = false;
|
||||||
List<ReferenceOrderedData> rods = new ArrayList<ReferenceOrderedData>();
|
List<ReferenceOrderedData<? extends ReferenceOrderedDatum> > rods = new ArrayList<ReferenceOrderedData<? extends ReferenceOrderedDatum> >();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ( TEST_ROD ) {
|
if ( TEST_ROD ) {
|
||||||
ReferenceOrderedData gff = new ReferenceOrderedData(new File("trunk/data/gFFTest.gff"), rodGFF.class );
|
ReferenceOrderedData<rodGFF> gff = new ReferenceOrderedData<rodGFF>(new File("trunk/data/gFFTest.gff"), rodGFF.class );
|
||||||
gff.testMe();
|
gff.testMe();
|
||||||
|
|
||||||
//ReferenceOrderedData dbsnp = new ReferenceOrderedData(new File("trunk/data/dbSNP_head.txt"), rodDbSNP.class );
|
//ReferenceOrderedData dbsnp = new ReferenceOrderedData(new File("trunk/data/dbSNP_head.txt"), rodDbSNP.class );
|
||||||
ReferenceOrderedData dbsnp = new ReferenceOrderedData(new File("/Volumes/Users/mdepristo/broad/ATK/exampleSAMs/dbSNP_chr20.txt"), rodDbSNP.class );
|
ReferenceOrderedData<rodDbSNP> dbsnp = new ReferenceOrderedData<rodDbSNP>(new File("/Volumes/Users/mdepristo/broad/ATK/exampleSAMs/dbSNP_chr20.txt"), rodDbSNP.class );
|
||||||
//dbsnp.testMe();
|
//dbsnp.testMe();
|
||||||
rods.add(dbsnp); // { gff, dbsnp };
|
rods.add(dbsnp); // { gff, dbsnp };
|
||||||
} else {
|
} else {
|
||||||
if ( DBSNP_FILE != null ) {
|
if ( DBSNP_FILE != null ) {
|
||||||
ReferenceOrderedData dbsnp = new ReferenceOrderedData(new File(DBSNP_FILE), rodDbSNP.class );
|
ReferenceOrderedData<rodDbSNP> dbsnp = new ReferenceOrderedData<rodDbSNP>(new File(DBSNP_FILE), rodDbSNP.class );
|
||||||
//dbsnp.testMe();
|
//dbsnp.testMe();
|
||||||
rods.add(dbsnp); // { gff, dbsnp };
|
rods.add(dbsnp); // { gff, dbsnp };
|
||||||
}
|
}
|
||||||
if ( HAPMAP_FILE != null ) {
|
if ( HAPMAP_FILE != null ) {
|
||||||
ReferenceOrderedData hapmap = new ReferenceOrderedData(new File(HAPMAP_FILE), HapMapAlleleFrequenciesROD.class );
|
ReferenceOrderedData<HapMapAlleleFrequenciesROD> hapmap = new ReferenceOrderedData<HapMapAlleleFrequenciesROD>(new File(HAPMAP_FILE), HapMapAlleleFrequenciesROD.class );
|
||||||
//dbsnp.testMe();
|
//dbsnp.testMe();
|
||||||
rods.add(hapmap); // { gff, dbsnp };
|
rods.add(hapmap); // { gff, dbsnp };
|
||||||
}
|
}
|
||||||
|
|
@ -182,7 +181,7 @@ public class GenomeAnalysisTK extends CommandLineProgram {
|
||||||
|
|
||||||
initializeOutputStreams();
|
initializeOutputStreams();
|
||||||
|
|
||||||
Walker my_walker = null;
|
Walker<?,?> my_walker = null;
|
||||||
try {
|
try {
|
||||||
my_walker = walkerManager.createWalkerByName( Analysis_Name );
|
my_walker = walkerManager.createWalkerByName( Analysis_Name );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,10 @@ import java.util.*;
|
||||||
|
|
||||||
public abstract class TraversalEngine {
|
public abstract class TraversalEngine {
|
||||||
// list of reference ordered data objects
|
// list of reference ordered data objects
|
||||||
protected List<ReferenceOrderedData> rods = null;
|
protected List<ReferenceOrderedData<? extends ReferenceOrderedDatum>> rods = null;
|
||||||
|
|
||||||
// Iterator over rods
|
// Iterator over rods
|
||||||
List<ReferenceOrderedData.RODIterator> rodIters;
|
List<ReferenceOrderedData<? extends ReferenceOrderedDatum>.RODIterator> rodIters;
|
||||||
|
|
||||||
// How strict should we be with SAM/BAM parsing?
|
// How strict should we be with SAM/BAM parsing?
|
||||||
protected ValidationStringency strictness = ValidationStringency.STRICT;
|
protected ValidationStringency strictness = ValidationStringency.STRICT;
|
||||||
|
|
@ -112,7 +112,7 @@ public abstract class TraversalEngine {
|
||||||
* @param ref Reference file in FASTA format, assumes a .dict file is also available
|
* @param ref Reference file in FASTA format, assumes a .dict file is also available
|
||||||
* @param rods Array of reference ordered data sets
|
* @param rods Array of reference ordered data sets
|
||||||
*/
|
*/
|
||||||
public TraversalEngine(File reads, File ref, List<ReferenceOrderedData> rods) {
|
public TraversalEngine(File reads, File ref, List<ReferenceOrderedData<? extends ReferenceOrderedDatum>> rods) {
|
||||||
readsFile = reads;
|
readsFile = reads;
|
||||||
refFileName = ref;
|
refFileName = ref;
|
||||||
this.rods = rods;
|
this.rods = rods;
|
||||||
|
|
@ -411,10 +411,10 @@ public abstract class TraversalEngine {
|
||||||
*
|
*
|
||||||
* @return A list of ROD iterators for getting data from each ROD
|
* @return A list of ROD iterators for getting data from each ROD
|
||||||
*/
|
*/
|
||||||
protected List<ReferenceOrderedData.RODIterator> initializeRODs() {
|
protected List<ReferenceOrderedData<? extends ReferenceOrderedDatum>.RODIterator> initializeRODs() {
|
||||||
// set up reference ordered data
|
// set up reference ordered data
|
||||||
rodIters = new ArrayList<ReferenceOrderedData.RODIterator>();
|
rodIters = new ArrayList<ReferenceOrderedData<? extends ReferenceOrderedDatum>.RODIterator>();
|
||||||
for (ReferenceOrderedData data : rods) {
|
for (ReferenceOrderedData<? extends ReferenceOrderedDatum> data : rods) {
|
||||||
rodIters.add(data.iterator());
|
rodIters.add(data.iterator());
|
||||||
}
|
}
|
||||||
return rodIters;
|
return rodIters;
|
||||||
|
|
@ -459,10 +459,10 @@ public abstract class TraversalEngine {
|
||||||
* @param loc The location to get the rods at
|
* @param loc The location to get the rods at
|
||||||
* @return A list of ReferenceOrderDatum at loc. ROD without a datum at loc will be null in the list
|
* @return A list of ReferenceOrderDatum at loc. ROD without a datum at loc will be null in the list
|
||||||
*/
|
*/
|
||||||
protected List<ReferenceOrderedDatum> getReferenceOrderedDataAtLocus(List<ReferenceOrderedData.RODIterator> rodIters,
|
protected List<ReferenceOrderedDatum> getReferenceOrderedDataAtLocus(List<ReferenceOrderedData<? extends ReferenceOrderedDatum>.RODIterator> rodIters,
|
||||||
final GenomeLoc loc) {
|
final GenomeLoc loc) {
|
||||||
List<ReferenceOrderedDatum> data = new ArrayList<ReferenceOrderedDatum>();
|
List<ReferenceOrderedDatum> data = new ArrayList<ReferenceOrderedDatum>();
|
||||||
for (ReferenceOrderedData.RODIterator iter : rodIters) {
|
for (ReferenceOrderedData<? extends ReferenceOrderedDatum>.RODIterator iter : rodIters) {
|
||||||
data.add(iter.seekForward(loc));
|
data.add(iter.seekForward(loc));
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
|
|
|
||||||
|
|
@ -31,14 +31,13 @@ import edu.mit.broad.picard.filter.FilteringIterator;
|
||||||
*/
|
*/
|
||||||
public class TraverseByLoci extends TraversalEngine {
|
public class TraverseByLoci extends TraversalEngine {
|
||||||
|
|
||||||
public TraverseByLoci(File reads, File ref, List<ReferenceOrderedData> rods) {
|
public TraverseByLoci(File reads, File ref, List<ReferenceOrderedData<? extends ReferenceOrderedDatum>> rods) {
|
||||||
super(reads, ref, rods);
|
super(reads, ref, rods);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <M,T> T traverse(Walker<M,T> walker, ArrayList<GenomeLoc> locations) {
|
public <M,T> T traverse(Walker<M,T> walker, ArrayList<GenomeLoc> locations) {
|
||||||
if ( walker instanceof LocusWalker ) {
|
if ( walker instanceof LocusWalker ) {
|
||||||
Walker x = walker;
|
LocusWalker<M, T> locusWalker = (LocusWalker<M, T>)walker;
|
||||||
LocusWalker<?, ?> locusWalker = (LocusWalker<?, ?>)x;
|
|
||||||
return (T)this.traverseByLoci(locusWalker, locations);
|
return (T)this.traverseByLoci(locusWalker, locations);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Walker isn't a loci walker!");
|
throw new IllegalArgumentException("Walker isn't a loci walker!");
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ import edu.mit.broad.picard.filter.FilteringIterator;
|
||||||
*/
|
*/
|
||||||
public class TraverseByLociByReference extends TraverseByLoci {
|
public class TraverseByLociByReference extends TraverseByLoci {
|
||||||
|
|
||||||
public TraverseByLociByReference(File reads, File ref, List<ReferenceOrderedData> rods) {
|
public TraverseByLociByReference(File reads, File ref, List<ReferenceOrderedData<? extends ReferenceOrderedDatum>> rods) {
|
||||||
super(reads, ref, rods);
|
super(reads, ref, rods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import org.broadinstitute.sting.gatk.walkers.LocusWalker;
|
||||||
import org.broadinstitute.sting.gatk.walkers.Walker;
|
import org.broadinstitute.sting.gatk.walkers.Walker;
|
||||||
import org.broadinstitute.sting.gatk.LocusContext;
|
import org.broadinstitute.sting.gatk.LocusContext;
|
||||||
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData;
|
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedData;
|
||||||
|
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum;
|
||||||
import org.broadinstitute.sting.gatk.iterators.ReferenceIterator;
|
import org.broadinstitute.sting.gatk.iterators.ReferenceIterator;
|
||||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||||
import org.broadinstitute.sting.utils.Utils;
|
import org.broadinstitute.sting.utils.Utils;
|
||||||
|
|
@ -26,7 +27,7 @@ import net.sf.samtools.SAMRecord;
|
||||||
*/
|
*/
|
||||||
public class TraverseByReads extends TraversalEngine {
|
public class TraverseByReads extends TraversalEngine {
|
||||||
|
|
||||||
public TraverseByReads(File reads, File ref, List<ReferenceOrderedData> rods) {
|
public TraverseByReads(File reads, File ref, List<ReferenceOrderedData<? extends ReferenceOrderedDatum>> rods) {
|
||||||
super(reads, ref, rods);
|
super(reads, ref, rods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.playground;
|
package org.broadinstitute.sting.playground;
|
||||||
|
|
||||||
import net.sf.samtools.*;
|
import net.sf.samtools.*;
|
||||||
import net.sf.samtools.SAMFileReader.ValidationStringency;
|
import net.sf.samtools.SAMFileReader.ValidationStringency;
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ public class PrepareROD extends CommandLineProgram {
|
||||||
@Option(shortName="RODNAME", doc="Name of the data") public String ROD_NAME = null;
|
@Option(shortName="RODNAME", doc="Name of the data") public String ROD_NAME = null;
|
||||||
@Option(shortName="RODTYPE", doc="Referenced Ordered Data type") public String ROD_TYPE = null;
|
@Option(shortName="RODTYPE", doc="Referenced Ordered Data type") public String ROD_TYPE = null;
|
||||||
|
|
||||||
public static HashMap<String, Class> Types = new HashMap<String,Class>();
|
public static HashMap<String, Class<? extends ReferenceOrderedDatum>> Types = new HashMap<String,Class<? extends ReferenceOrderedDatum>>();
|
||||||
public static void addModule(final String name, final Class rodType) {
|
public static void addModule(final String name, final Class<? extends ReferenceOrderedDatum> rodType) {
|
||||||
System.out.printf("* Adding rod class %s%n", name);
|
System.out.printf("* Adding rod class %s%n", name);
|
||||||
Types.put(name.toLowerCase(), rodType);
|
Types.put(name.toLowerCase(), rodType);
|
||||||
}
|
}
|
||||||
|
|
@ -47,9 +47,9 @@ public class PrepareROD extends CommandLineProgram {
|
||||||
final ReferenceSequenceFile refFile = ReferenceSequenceFileFactory.getReferenceSequenceFile(REF_FILE_ARG);
|
final ReferenceSequenceFile refFile = ReferenceSequenceFileFactory.getReferenceSequenceFile(REF_FILE_ARG);
|
||||||
GenomeLoc.setupRefContigOrdering(refFile);
|
GenomeLoc.setupRefContigOrdering(refFile);
|
||||||
|
|
||||||
Class rodClass = Types.get(ROD_TYPE.toLowerCase());
|
Class<? extends ReferenceOrderedDatum> rodClass = Types.get(ROD_TYPE.toLowerCase());
|
||||||
|
|
||||||
ReferenceOrderedData rod = new ReferenceOrderedData(new File(ROD_FILE), rodClass );
|
ReferenceOrderedData<? extends ReferenceOrderedDatum> rod = new ReferenceOrderedData(new File(ROD_FILE), rodClass );
|
||||||
try {
|
try {
|
||||||
rod.validateFile();
|
rod.validateFile();
|
||||||
} catch ( Exception e ) {
|
} catch ( Exception e ) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue