From f3049fba63899bfb35f245198b829472f480c9fa Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Mon, 25 Jul 2011 13:21:52 -0400 Subject: [PATCH] refdata directory cleanup Removing unused files RODRecordIterator, ReferenceOrderedData, QueryableTrack, RMDTrackCreationException, GATKFeatureIterator, ReferenceOrderedDataUnitTest Refactored dbSNP and refseq utilities to be closer to the other files implementing these features --- .../sting/gatk/GenomeAnalysisEngine.java | 2 +- .../rmd/ReferenceOrderedDataPool.java | 2 +- .../rmd/ReferenceOrderedDataSource.java | 2 +- .../sting/gatk/refdata/RODRecordIterator.java | 238 ------------------ .../gatk/refdata/ReferenceOrderedData.java | 130 ---------- .../gatk/refdata/VariantContextAdaptors.java | 2 +- .../helpers => features}/DbSNPHelper.java | 2 +- .../features/refseq/RefSeqFeature.java | 1 - .../{ => features/refseq}/Transcript.java | 2 +- .../gatk/refdata/indexer/RMDIndexer.java | 2 +- .../gatk/refdata/tracks/QueryableTrack.java | 45 ---- .../{builders => }/RMDTrackBuilder.java | 8 +- .../tracks/RMDTrackCreationException.java | 45 ---- .../refdata/utils/GATKFeatureIterator.java | 65 ----- .../sting/gatk/walkers/PileupWalker.java | 2 +- .../annotator/VariantAnnotatorEngine.java | 2 +- .../coverage/DepthOfCoverageWalker.java | 2 +- .../walkers/genotyper/UnifiedGenotyper.java | 2 +- .../indels/SomaticIndelDetectorWalker.java | 4 +- .../TableRecalibrationWalker.java | 2 +- .../varianteval/VariantEvalWalker.java | 2 +- .../variantutils/ValidateVariants.java | 2 +- .../walkers/variantutils/VariantsToVCF.java | 4 +- .../gatk/GATKExtensionsGenerator.java | 2 +- .../queue/extensions/gatk/RodBindField.java | 2 +- .../interval/IntervalFileMergingIterator.java | 1 - .../StringToGenomeLocIteratorAdapter.java | 2 +- .../sting/utils/text/ListFileUtils.java | 2 +- .../ReferenceOrderedViewUnitTest.java | 2 +- .../rmd/ReferenceOrderedDataPoolUnitTest.java | 2 +- .../refdata/ReferenceOrderedDataUnitTest.java | 48 ---- .../RMDTrackBuilderUnitTest.java | 3 +- 32 files changed, 28 insertions(+), 604 deletions(-) delete mode 100644 public/java/src/org/broadinstitute/sting/gatk/refdata/RODRecordIterator.java delete mode 100644 public/java/src/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedData.java rename public/java/src/org/broadinstitute/sting/gatk/refdata/{utils/helpers => features}/DbSNPHelper.java (99%) rename public/java/src/org/broadinstitute/sting/gatk/refdata/{ => features/refseq}/Transcript.java (95%) delete mode 100644 public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/QueryableTrack.java rename public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/{builders => }/RMDTrackBuilder.java (98%) delete mode 100644 public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackCreationException.java delete mode 100644 public/java/src/org/broadinstitute/sting/gatk/refdata/utils/GATKFeatureIterator.java rename public/java/src/org/broadinstitute/sting/{gatk/refdata/utils => utils/interval}/StringToGenomeLocIteratorAdapter.java (95%) delete mode 100644 public/java/test/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedDataUnitTest.java rename public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/{builders => }/RMDTrackBuilderUnitTest.java (98%) diff --git a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java index 918bc1251..a414d24aa 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/GenomeAnalysisEngine.java @@ -43,7 +43,7 @@ import org.broadinstitute.sting.gatk.filters.ReadGroupBlackListFilter; import org.broadinstitute.sting.gatk.io.OutputTracker; import org.broadinstitute.sting.gatk.io.stubs.Stub; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrack; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.gatk.refdata.utils.RMDIntervalGenerator; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet; import org.broadinstitute.sting.gatk.walkers.*; diff --git a/public/java/src/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPool.java b/public/java/src/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPool.java index abd5929eb..9d5a54f58 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPool.java +++ b/public/java/src/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPool.java @@ -27,7 +27,7 @@ package org.broadinstitute.sting.gatk.datasources.rmd; import net.sf.samtools.SAMSequenceDictionary; import org.broadinstitute.sting.gatk.refdata.SeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrack; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.gatk.refdata.utils.FlashBackIterator; import org.broadinstitute.sting.gatk.refdata.utils.LocationAwareSeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet; diff --git a/public/java/src/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataSource.java b/public/java/src/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataSource.java index 60b68bda5..6992fc1ff 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataSource.java +++ b/public/java/src/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataSource.java @@ -29,7 +29,7 @@ import org.broadinstitute.sting.commandline.Tags; import org.broadinstitute.sting.gatk.datasources.reads.Shard; import org.broadinstitute.sting.gatk.refdata.SeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrack; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.gatk.refdata.utils.LocationAwareSeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet; import org.broadinstitute.sting.utils.GenomeLoc; diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/RODRecordIterator.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/RODRecordIterator.java deleted file mode 100644 index ce924fd87..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/RODRecordIterator.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) 2010 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.refdata; - -import org.broadinstitute.sting.gatk.iterators.PushbackIterator; -import org.broadinstitute.sting.utils.exceptions.DynamicClassResolutionException; -import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; -import org.broadinstitute.sting.utils.exceptions.UserException; -import org.broadinstitute.sting.utils.text.XReadLines; - -import java.io.File; -import java.io.FileNotFoundException; -import java.lang.reflect.Constructor; -import java.util.Iterator; -import java.util.regex.Pattern; - -/** - * This is a low-level iterator designed to provide system-wide generic support for reading record-oriented data - * files. The only assumption made is that every line in the file provides a complete and separate data record. The records - * can be associated with coordinates or coordinate intervals, there can be one or more records associated with a given - * position/interval, or intervals can overlap. The records must be comprised of delimited fields, but the format is - * otherwise free. For any specific line-based data format, an appropriate implementation of ReferenceOrderedDatum must be - * provided that is capable of parsing itself from a single line of data. This implementation will be used, - * through reflection mechanism, as a callback to do all the work. - * - * The model is, hence, as follows: - * - * String dataRecord <---> RodImplementation ( ::parseLine(dataRecord.split(delimiter)) is aware of the format and fills - * an instance of RodImplementation with data values from dataRecord line). - * - * - * instantiation of RODRecordIterator(dataFile, trackName, RodImplementation.class) will immediately provide an iterator - * that walks along the dataFile line by line, and on each call to next() returns a new RodImplementation object - * representing a single line (record) of data. The returned object will be initialized with "track name" trackName - - * track names (as returned by ROD.getName()) are often used in other parts of the code to distinguish between - * multiple streams of (possibly heterogeneous) annotation data bound to an application. - * - * This generic iterator skips and ignores a) empty lines, b) lines starting with '#' (comments): they are never sent back - * to the ROD implementation class for processing. - * - * This iterator does not actually check if the ROD records (lines) in the file are indeed ordedered by coordinate, - * and it does not depend on such an order as it still implements a low-level line-based traversal of the data. Higher-level - * iterators/wrappers will perform all the necessary checks. - * - * Note: some data formats/ROD implementations may require a header line in the file. In this case the current (ugly) - * mechanism is as follows: - * 1) rod implementation's ::initialize(file) method should be able to open the file, find and read the header line - * and return the header object (to be kept by the iterator) - * 2) rod implementation's ::parseLine(header,line) method should be capable of making use of that saved header object now served to it - * and - * 3) ::parseLine(header,line) should be able to recognize the original header line in the file and skip it (after ROD's initialize() - * method is called, the iterator will re-open the file and start reading it from the very beginning; there is no - * other way, except for "smart" ::parseLine(), to avoid reading in the header line as "data"). - * - * Created by IntelliJ IDEA. - * User: asivache - * Date: Sep 10, 2009 - * Time: 1:22:23 PM - * To change this template use File | Settings | File Templates. - */ -public class RODRecordIterator implements Iterator { - - private PushbackIterator reader; - - // stores name of the track this iterator reads (will be also returned by getName() of ROD objects - // generated by this iterator) - private String name; - - // we keep the file object, only to use file name in error reports - private File file; - - // rod type; this is what we will instantiate for RODs at runtime - private Class type; - - private Object header = null; // Some RODs may use header - - // field delimiter in the file. Should it be the job of the iterator to split the lines though? RODs can do that! - private String fieldDelimiter; - - // constructor for the ROD objects we are going to return. Constructor that takes the track name as its single arg is required. - private Constructor named_constructor; - - // keep track of the lines we are reading. used for error messages only. - private long linenum = 0; - - private boolean allow_empty = true; - private boolean allow_comments = true; - public static Pattern EMPTYLINE_PATTERN = Pattern.compile("^\\s*$"); - - public RODRecordIterator(File file, String name, Class type) { - try { - reader = new PushbackIterator(new XReadLines(file)); - } catch (FileNotFoundException e) { - throw new UserException.CouldNotReadInputFile(file, e); - } - this.file = file; - this.name = name; - this.type = type; - try { - named_constructor = type.getConstructor(String.class); - } - catch (java.lang.NoSuchMethodException e) { - throw new ReviewedStingException("ROD class "+type.getName()+" does not have constructor that accepts a single String argument (track name)"); - } - ROD rod = instantiateROD(name); - fieldDelimiter = rod.delimiterRegex(); // get delimiter from the ROD itself - try { - header = rod.initialize(file); - } catch (FileNotFoundException e) { - throw new UserException.CouldNotReadInputFile(file, "ROD "+type.getName() + " failed to initialize properly from file "+file); - } - - } - - - /** - * Returns true if the iteration has more elements. (In other - * words, returns true if next would return an element - * rather than throwing an exception.) - * - * @return true if the iterator has more elements. - */ - public boolean hasNext() { - if ( allow_empty || allow_comments ) { - while ( reader.hasNext() ) { - String line = reader.next(); - if ( allow_empty && EMPTYLINE_PATTERN.matcher(line).matches() ) continue; // skip empty line - if ( allow_comments && line.charAt(0) == '#' ) continue; // skip comment lines - // the line is not empty and not a comment line, so we have next after all - reader.pushback(line); - return true; - } - return false; // oops, we end up here if there's nothing left - } else { - return reader.hasNext(); - } - } - - /** - * Returns the next valid ROD record in the file, skipping empty and comment lines. - * - * @return the next element in the iteration. - * @throws java.util.NoSuchElementException - * iteration has no more elements. - */ - public ROD next() { - ROD n = null; - boolean parsed_ok = false; - String line ; - - while ( ! parsed_ok && reader.hasNext() ) { - line = reader.next(); - linenum++; - while ( allow_empty && EMPTYLINE_PATTERN.matcher(line).matches() || - allow_comments && line.charAt(0) == '#' ) { - if ( reader.hasNext() ) { - line = reader.next(); - linenum++; - } else { - line = null; - break; - } - } - - if ( line == null ) break; // if we ran out of lines while skipping empty lines/comments, then we are done - - String parts[] = line.split(fieldDelimiter); - - try { - n = instantiateROD(name); - parsed_ok = n.parseLine(header,parts) ; - } - catch ( Exception e ) { - throw new UserException.MalformedFile(file, "Failed to parse ROD data ("+type.getName()+") from file "+ file + " at line #"+linenum+ - "\nOffending line: "+line+ - "\nReason ("+e.getClass().getName()+")", e); - } - } - - - return n; - } - - /** - * Removes from the underlying collection the last element returned by the - * iterator (optional operation). This method can be called only once per - * call to next. The behavior of an iterator is unspecified if - * the underlying collection is modified while the iteration is in - * progress in any way other than by calling this method. - * - * @throws UnsupportedOperationException if the remove - * operation is not supported by this Iterator. - * @throws IllegalStateException if the next method has not - * yet been called, or the remove method has already - * been called after the last call to the next - * method. - */ - public void remove() { - throw new UnsupportedOperationException("remove() operation is not supported by RODRecordIterator"); - } - - /** Instantiates appropriate implementation of the ROD used by this iteratot. The 'name' argument is the name - * of the ROD track. - * @param name - * @return - */ - private ROD instantiateROD(final String name) { - try { - return (ROD) named_constructor.newInstance(name); - } catch (Exception e) { - throw new DynamicClassResolutionException(named_constructor.getDeclaringClass(), e); - } - } - -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedData.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedData.java deleted file mode 100644 index 5cdb6e9f7..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedData.java +++ /dev/null @@ -1,130 +0,0 @@ -package org.broadinstitute.sting.gatk.refdata; - -import org.apache.log4j.Logger; -import org.broadinstitute.sting.utils.exceptions.UserException; - -import java.io.*; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -/** - * Class for representing arbitrary reference ordered data sets - *

- * User: mdepristo - * Date: Feb 27, 2009 - * Time: 10:47:14 AM - * To change this template use File | Settings | File Templates. - */ -public class ReferenceOrderedData implements Iterable { - private String name; - private File file = null; -// private String fieldDelimiter; - - /** Header object returned from the datum */ -// private Object header = null; - - private Class type = null; // runtime type information for object construction - - /** our log, which we want to capture anything from this class */ - private static Logger logger = Logger.getLogger(ReferenceOrderedData.class); - - /** - * given an existing file, open it and append all the valid triplet lines to an existing list - * - * @param rodTripletList the list of existing triplets - * @param filename the file to attempt to extract ROD triplets from - */ - protected static void extractRodsFromFile(List rodTripletList, String filename) { - BufferedReader str; - try { - str = new BufferedReader(new FileReader(new File(filename))); - } catch (FileNotFoundException e) { - throw new UserException.CouldNotReadInputFile(new File(filename), "Unable to load the ROD input file", e); - } - String line = "NO LINES READ IN"; - try { - while ((line = str.readLine()) != null) { - if (line.matches(".+,.+,.+")) rodTripletList.add(line.trim()); - else logger.warn("the following file line didn't parsing into a triplet -> " + line); - } - } catch (IOException e) { - throw new UserException.CouldNotReadInputFile(new File(filename), "Failed reading the input rod file; last line read was " + line, e); - } - } - - - // ---------------------------------------------------------------------- - // - // Constructors - // - // ---------------------------------------------------------------------- - public ReferenceOrderedData(final String name, File file, Class type ) { - this.name = name; - this.file = file; - this.type = type; -// this.header = initializeROD(name, file, type); -// this.fieldDelimiter = newROD(name, type).delimiterRegex(); - } - - public String getName() { return name; } - - public File getFile() { return file; } - - public Class getType() { return type; } - - /** - * Special equals override to see if this ROD is compatible with the given - * name and type. 'Compatible' means that this ROD has the name that's passed - * in and its data can fit into the container specified by type. - * - * @param name Name to check. - * @param type Type to check. - * - * @return True if these parameters imply this rod. False otherwise. - */ - public boolean matches(String name, Class type) { - return this.name.equals(name) && type.isAssignableFrom(this.type); - } - - public Iterator iterator() { - Iterator it; - try { - Method m = type.getDeclaredMethod("createIterator", String.class, java.io.File.class); - it = (Iterator) m.invoke(null, name, file); - } catch (java.lang.NoSuchMethodException e) { - it = new RODRecordIterator(file,name,type); - } catch (java.lang.NullPointerException e) { - throw new RuntimeException(e); - } catch (java.lang.SecurityException e) { - throw new RuntimeException(e); - } catch (java.lang.IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.IllegalArgumentException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e); - } - // return new RODIterator(it); - return it; - } - - // ---------------------------------------------------------------------- - // - // Manipulations of all of the data - // - // ---------------------------------------------------------------------- - - public static void write(ArrayList data, File output) throws IOException { - final FileWriter out = new FileWriter(output); - - for (ReferenceOrderedDatum rec : data) { - out.write(rec.repl() + "\n"); - } - - out.close(); - } - - -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/VariantContextAdaptors.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/VariantContextAdaptors.java index 1d622e2c7..8ccd9081b 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/VariantContextAdaptors.java +++ b/public/java/src/org/broadinstitute/sting/gatk/refdata/VariantContextAdaptors.java @@ -4,7 +4,7 @@ import org.broad.tribble.Feature; import org.broad.tribble.dbsnp.DbSNPFeature; import org.broad.tribble.gelitext.GeliTextFeature; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; -import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; +import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.utils.classloader.PluginManager; import org.broadinstitute.sting.utils.codecs.hapmap.HapMapFeature; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeader; diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/utils/helpers/DbSNPHelper.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/features/DbSNPHelper.java similarity index 99% rename from public/java/src/org/broadinstitute/sting/gatk/refdata/utils/helpers/DbSNPHelper.java rename to public/java/src/org/broadinstitute/sting/gatk/refdata/features/DbSNPHelper.java index 3201769e0..b847fa2e6 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/utils/helpers/DbSNPHelper.java +++ b/public/java/src/org/broadinstitute/sting/gatk/refdata/features/DbSNPHelper.java @@ -1,4 +1,4 @@ -package org.broadinstitute.sting.gatk.refdata.utils.helpers; +package org.broadinstitute.sting.gatk.refdata.features; import net.sf.samtools.util.SequenceUtil; import org.broad.tribble.annotation.Strand; diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/RefSeqFeature.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/RefSeqFeature.java index d12114f9a..a38d45428 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/RefSeqFeature.java +++ b/public/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/RefSeqFeature.java @@ -1,7 +1,6 @@ package org.broadinstitute.sting.gatk.refdata.features.refseq; import org.broad.tribble.Feature; -import org.broadinstitute.sting.gatk.refdata.Transcript; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; import org.broadinstitute.sting.gatk.refdata.utils.RODRecordList; import org.broadinstitute.sting.utils.GenomeLoc; diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/Transcript.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/Transcript.java similarity index 95% rename from public/java/src/org/broadinstitute/sting/gatk/refdata/Transcript.java rename to public/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/Transcript.java index b8a0868dd..d8bf12810 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/Transcript.java +++ b/public/java/src/org/broadinstitute/sting/gatk/refdata/features/refseq/Transcript.java @@ -1,4 +1,4 @@ -package org.broadinstitute.sting.gatk.refdata; +package org.broadinstitute.sting.gatk.refdata.features.refseq; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.HasGenomeLocation; diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/indexer/RMDIndexer.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/indexer/RMDIndexer.java index 085d6b5b3..85374757d 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/indexer/RMDIndexer.java +++ b/public/java/src/org/broadinstitute/sting/gatk/refdata/indexer/RMDIndexer.java @@ -12,7 +12,7 @@ import org.broadinstitute.sting.commandline.CommandLineProgram; import org.broadinstitute.sting.commandline.Input; import org.broadinstitute.sting.gatk.arguments.ValidationExclusion; import org.broadinstitute.sting.gatk.refdata.ReferenceDependentFeatureCodec; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.utils.GenomeLocParser; import org.broadinstitute.sting.utils.Utils; import org.broadinstitute.sting.utils.fasta.CachingIndexedFastaSequenceFile; diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/QueryableTrack.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/QueryableTrack.java deleted file mode 100644 index 731df997d..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/QueryableTrack.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2010. The Broad Institute - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.refdata.tracks; - -import net.sf.samtools.util.CloseableIterator; -import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; -import org.broadinstitute.sting.utils.GenomeLoc; - -import java.io.IOException; - -/** - * @author aaron - *

- * Interface QueryableTrack - *

- * a decorator interface for tracks that are queryable - */ -public interface QueryableTrack { - public CloseableIterator query(final GenomeLoc interval) throws IOException; - public CloseableIterator query(final GenomeLoc interval, final boolean contained) throws IOException; - public CloseableIterator query(final String contig, final int start, final int stop) throws IOException; - public CloseableIterator query(final String contig, final int start, final int stop, final boolean contained) throws IOException; - public void close(); -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/builders/RMDTrackBuilder.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilder.java similarity index 98% rename from public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/builders/RMDTrackBuilder.java rename to public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilder.java index 19c91be1b..41e8cf15b 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/builders/RMDTrackBuilder.java +++ b/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilder.java @@ -23,7 +23,7 @@ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.refdata.tracks.builders; +package org.broadinstitute.sting.gatk.refdata.tracks; import net.sf.samtools.SAMSequenceDictionary; import net.sf.samtools.SAMSequenceRecord; @@ -36,8 +36,6 @@ import org.broad.tribble.util.LittleEndianOutputStream; import org.broadinstitute.sting.commandline.Tags; import org.broadinstitute.sting.gatk.arguments.ValidationExclusion; import org.broadinstitute.sting.gatk.refdata.ReferenceDependentFeatureCodec; -import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrack; -import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackCreationException; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet.RMDStorageType; import org.broadinstitute.sting.utils.GenomeLocParser; @@ -133,10 +131,8 @@ public class RMDTrackBuilder extends PluginManager { * @param fileDescriptor a description of the type of track to build. * * @return an instance of the track - * @throws RMDTrackCreationException - * if we don't know of the target class or we couldn't create it */ - public RMDTrack createInstanceOfTrack(RMDTriplet fileDescriptor) throws RMDTrackCreationException { + public RMDTrack createInstanceOfTrack(RMDTriplet fileDescriptor) { String name = fileDescriptor.getName(); File inputFile = new File(fileDescriptor.getFile()); diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackCreationException.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackCreationException.java deleted file mode 100644 index 29aefacc6..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackCreationException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2010. The Broad Institute - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.refdata.tracks; - -import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; - - -/** - * - * @author aaron - * - * Class RMDTrackCreationException - * - * if we fail for some reason to make a track, throw this exception - */ -public class RMDTrackCreationException extends ReviewedStingException { - public RMDTrackCreationException(String msg) { - super(msg); - } - - public RMDTrackCreationException(String message, Throwable throwable) { - super(message, throwable); - } -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/utils/GATKFeatureIterator.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/utils/GATKFeatureIterator.java deleted file mode 100644 index 17c9fa718..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/utils/GATKFeatureIterator.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2010. The Broad Institute - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.refdata.utils; - -import net.sf.samtools.util.CloseableIterator; -import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum; - -import java.util.Iterator; - - -/** - * - * @author aaron - * - * Class GATKFeatureIterator - * - * Takes a RODatum iterator and makes it an iterator of GATKFeatures. Shazam! - */ -public class GATKFeatureIterator implements CloseableIterator { - private final Iterator iter; - public GATKFeatureIterator(Iterator iter) { - this.iter = iter; - } - - @Override - public boolean hasNext() { - return iter.hasNext(); - } - - @Override - public GATKFeature next() { - return new GATKFeature.RODGATKFeature(iter.next()); - } - - @Override - public void remove() { - throw new UnsupportedOperationException("Remove not supported"); - } - - @Override - public void close() { - // do nothing, our underlying iterator doesn't support this - } -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java index 508d1f6ee..5db4fb417 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java @@ -32,8 +32,8 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum; +import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; -import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; import org.broadinstitute.sting.utils.Utils; import org.broadinstitute.sting.utils.collections.Pair; import org.broadinstitute.sting.utils.pileup.ReadBackedExtendedEventPileup; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java index fdf498a3d..f9b1563b4 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java @@ -30,7 +30,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; -import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; +import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.gatk.walkers.annotator.genomicannotator.GenomicAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.genomicannotator.JoinTable; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotationInterfaceManager; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java index c1956f1d7..708d6bb94 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java @@ -35,7 +35,7 @@ import org.broadinstitute.sting.gatk.refdata.SeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.features.refseq.RefSeqCodec; import org.broadinstitute.sting.gatk.refdata.features.refseq.RefSeqFeature; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrack; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; import org.broadinstitute.sting.gatk.refdata.utils.LocationAwareSeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.utils.RODRecordList; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java index 2a0338bca..492991a14 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java @@ -35,7 +35,7 @@ import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.filters.BadMateFilter; import org.broadinstitute.sting.gatk.filters.MappingQualityUnavailableReadFilter; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; -import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; +import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.gatk.walkers.annotator.VariantAnnotatorEngine; import org.broadinstitute.sting.utils.SampleUtils; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/SomaticIndelDetectorWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/SomaticIndelDetectorWalker.java index 443e6e9f2..78ad42ce1 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/SomaticIndelDetectorWalker.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/SomaticIndelDetectorWalker.java @@ -39,11 +39,11 @@ import org.broadinstitute.sting.gatk.filters.PlatformUnitFilter; import org.broadinstitute.sting.gatk.filters.PlatformUnitFilterHelper; import org.broadinstitute.sting.gatk.refdata.ReadMetaDataTracker; import org.broadinstitute.sting.gatk.refdata.SeekableRODIterator; -import org.broadinstitute.sting.gatk.refdata.Transcript; +import org.broadinstitute.sting.gatk.refdata.features.refseq.Transcript; import org.broadinstitute.sting.gatk.refdata.features.refseq.RefSeqCodec; import org.broadinstitute.sting.gatk.refdata.features.refseq.RefSeqFeature; import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrack; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.gatk.refdata.utils.LocationAwareSeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.utils.RODRecordList; import org.broadinstitute.sting.gatk.walkers.ReadFilters; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/TableRecalibrationWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/TableRecalibrationWalker.java index fec7ee4e6..a34719b18 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/TableRecalibrationWalker.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/TableRecalibrationWalker.java @@ -32,7 +32,7 @@ import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.io.StingSAMFileWriter; import org.broadinstitute.sting.gatk.refdata.ReadMetaDataTracker; -import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; +import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.utils.QualityUtils; import org.broadinstitute.sting.utils.Utils; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalWalker.java index fe3173506..8766ea4f7 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalWalker.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/varianteval/VariantEvalWalker.java @@ -9,7 +9,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; -import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; +import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.gatk.report.GATKReport; import org.broadinstitute.sting.gatk.report.GATKReportTable; import org.broadinstitute.sting.gatk.walkers.Reference; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java index 0644c669b..044fc6533 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/ValidateVariants.java @@ -33,7 +33,7 @@ import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; -import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; +import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.variantcontext.Allele; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java index aa0e5987f..37fd0d547 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java @@ -35,9 +35,9 @@ import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.refdata.VariantContextAdaptors; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; +import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature; -import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.utils.SampleUtils; diff --git a/public/java/src/org/broadinstitute/sting/queue/extensions/gatk/GATKExtensionsGenerator.java b/public/java/src/org/broadinstitute/sting/queue/extensions/gatk/GATKExtensionsGenerator.java index 5095bd6e5..92e339aa1 100644 --- a/public/java/src/org/broadinstitute/sting/queue/extensions/gatk/GATKExtensionsGenerator.java +++ b/public/java/src/org/broadinstitute/sting/queue/extensions/gatk/GATKExtensionsGenerator.java @@ -41,7 +41,7 @@ import org.broadinstitute.sting.gatk.io.stubs.OutputStreamArgumentTypeDescriptor import org.broadinstitute.sting.gatk.io.stubs.SAMFileReaderArgumentTypeDescriptor; import org.broadinstitute.sting.gatk.io.stubs.SAMFileWriterArgumentTypeDescriptor; import org.broadinstitute.sting.gatk.io.stubs.VCFWriterArgumentTypeDescriptor; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.gatk.walkers.PartitionBy; import org.broadinstitute.sting.gatk.walkers.PartitionType; import org.broadinstitute.sting.gatk.walkers.Walker; diff --git a/public/java/src/org/broadinstitute/sting/queue/extensions/gatk/RodBindField.java b/public/java/src/org/broadinstitute/sting/queue/extensions/gatk/RodBindField.java index ea180d33c..02d2fd0a8 100644 --- a/public/java/src/org/broadinstitute/sting/queue/extensions/gatk/RodBindField.java +++ b/public/java/src/org/broadinstitute/sting/queue/extensions/gatk/RodBindField.java @@ -26,7 +26,7 @@ package org.broadinstitute.sting.queue.extensions.gatk; import org.broadinstitute.sting.commandline.Input; import org.broadinstitute.sting.gatk.WalkerManager; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.gatk.walkers.RMD; import org.broadinstitute.sting.gatk.walkers.Walker; diff --git a/public/java/src/org/broadinstitute/sting/utils/interval/IntervalFileMergingIterator.java b/public/java/src/org/broadinstitute/sting/utils/interval/IntervalFileMergingIterator.java index 988240ef9..2bc3fa284 100644 --- a/public/java/src/org/broadinstitute/sting/utils/interval/IntervalFileMergingIterator.java +++ b/public/java/src/org/broadinstitute/sting/utils/interval/IntervalFileMergingIterator.java @@ -26,7 +26,6 @@ package org.broadinstitute.sting.utils.interval; import org.broadinstitute.sting.gatk.iterators.PushbackIterator; -import org.broadinstitute.sting.gatk.refdata.utils.StringToGenomeLocIteratorAdapter; import org.broadinstitute.sting.utils.GenomeLoc; import org.broadinstitute.sting.utils.GenomeLocParser; import org.broadinstitute.sting.utils.exceptions.UserException; diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/utils/StringToGenomeLocIteratorAdapter.java b/public/java/src/org/broadinstitute/sting/utils/interval/StringToGenomeLocIteratorAdapter.java similarity index 95% rename from public/java/src/org/broadinstitute/sting/gatk/refdata/utils/StringToGenomeLocIteratorAdapter.java rename to public/java/src/org/broadinstitute/sting/utils/interval/StringToGenomeLocIteratorAdapter.java index fc7f7c58f..659260345 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/utils/StringToGenomeLocIteratorAdapter.java +++ b/public/java/src/org/broadinstitute/sting/utils/interval/StringToGenomeLocIteratorAdapter.java @@ -23,7 +23,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.refdata.utils; +package org.broadinstitute.sting.utils.interval; import org.broadinstitute.sting.gatk.iterators.PushbackIterator; import org.broadinstitute.sting.utils.GenomeLoc; diff --git a/public/java/src/org/broadinstitute/sting/utils/text/ListFileUtils.java b/public/java/src/org/broadinstitute/sting/utils/text/ListFileUtils.java index f6aa882ad..4ab1c1685 100644 --- a/public/java/src/org/broadinstitute/sting/utils/text/ListFileUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/text/ListFileUtils.java @@ -27,8 +27,8 @@ package org.broadinstitute.sting.utils.text; import org.broadinstitute.sting.commandline.ParsingEngine; import org.broadinstitute.sting.commandline.Tags; import org.broadinstitute.sting.gatk.datasources.reads.SAMReaderID; +import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet; -import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper; import org.broadinstitute.sting.utils.exceptions.UserException; import java.io.File; diff --git a/public/java/test/org/broadinstitute/sting/gatk/datasources/providers/ReferenceOrderedViewUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/datasources/providers/ReferenceOrderedViewUnitTest.java index b32473b9d..cb156b682 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/datasources/providers/ReferenceOrderedViewUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/datasources/providers/ReferenceOrderedViewUnitTest.java @@ -3,13 +3,13 @@ package org.broadinstitute.sting.gatk.datasources.providers; import org.broadinstitute.sting.commandline.Tags; import org.broadinstitute.sting.gatk.datasources.reads.MockLocusShard; import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet; import org.testng.Assert; import org.broadinstitute.sting.BaseTest; import org.broadinstitute.sting.gatk.datasources.reads.Shard; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.refdata.features.table.TableFeature; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet.RMDStorageType; import org.broadinstitute.sting.utils.GenomeLocParser; import org.broadinstitute.sting.utils.fasta.CachingIndexedFastaSequenceFile; diff --git a/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPoolUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPoolUnitTest.java index 5b0d67e88..bd4f93d24 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPoolUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/datasources/rmd/ReferenceOrderedDataPoolUnitTest.java @@ -1,10 +1,10 @@ package org.broadinstitute.sting.gatk.datasources.rmd; import org.broadinstitute.sting.commandline.Tags; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.testng.Assert; import org.broadinstitute.sting.BaseTest; import org.broadinstitute.sting.gatk.refdata.features.table.TableFeature; -import org.broadinstitute.sting.gatk.refdata.tracks.builders.RMDTrackBuilder; import org.broadinstitute.sting.gatk.refdata.utils.LocationAwareSeekableRODIterator; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet.RMDStorageType; diff --git a/public/java/test/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedDataUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedDataUnitTest.java deleted file mode 100644 index fa20ea913..000000000 --- a/public/java/test/org/broadinstitute/sting/gatk/refdata/ReferenceOrderedDataUnitTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.broadinstitute.sting.gatk.refdata; - -import org.testng.Assert; -import org.broadinstitute.sting.BaseTest; - -import org.testng.annotations.Test; - -import java.util.ArrayList; -import java.util.List; - - -/** - * - * @author aaron - * - * Class ReferenceOrderedDataUnitTest - * - * some functionality to test parts of the reference ordered data system that I've added. This is by NO MEANS - * a complete test suite, but additions would be extremely welcome - */ -public class ReferenceOrderedDataUnitTest extends BaseTest { - @Test - public void extractRodsFromFileTest() { - String file = validationDataLocation + "testRODFileImpl.csv"; - List lst = new ArrayList(); - ReferenceOrderedData.extractRodsFromFile(lst,file); - Assert.assertEquals(lst.size(), 6); - int index = 0; - for (String entry: lst) { - String first = entry.subSequence(0,entry.indexOf(",")).toString(); - Assert.assertTrue(first.equals("rod" + String.valueOf(++index))); - } - } - @Test - public void extractRodsFromMultiFileTest() { - String file = validationDataLocation + "testRODFileImpl.csv"; - String file2 = validationDataLocation + "testRODFileImpl2.csv"; - List lst = new ArrayList(); - ReferenceOrderedData.extractRodsFromFile(lst,file); - ReferenceOrderedData.extractRodsFromFile(lst,file2); - Assert.assertEquals(lst.size(), 12); - int index = 0; - for (String entry: lst) { - String first = entry.subSequence(0,entry.indexOf(",")).toString(); - Assert.assertTrue(first.equals("rod" + String.valueOf(++index))); - } - } -} diff --git a/public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/builders/RMDTrackBuilderUnitTest.java b/public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilderUnitTest.java similarity index 98% rename from public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/builders/RMDTrackBuilderUnitTest.java rename to public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilderUnitTest.java index e475e732d..70d2e7a85 100644 --- a/public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/builders/RMDTrackBuilderUnitTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilderUnitTest.java @@ -21,13 +21,14 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package org.broadinstitute.sting.gatk.refdata.tracks.builders; +package org.broadinstitute.sting.gatk.refdata.tracks; import net.sf.picard.reference.IndexedFastaSequenceFile; import net.sf.samtools.SAMSequenceDictionary; import org.broad.tribble.Tribble; import org.broad.tribble.index.Index; +import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder; import org.broadinstitute.sting.utils.codecs.vcf.VCF3Codec; import org.broadinstitute.sting.utils.codecs.vcf.VCFCodec; import org.broadinstitute.sting.utils.exceptions.UserException;