remove RodBed and all it's dependencies.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3396 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
ffb1b46166
commit
02cc1afdc8
|
|
@ -1,110 +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 java.util.*;
|
||||
import java.io.IOException;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.GenomeLocParser;
|
||||
import org.broadinstitute.sting.utils.StingException;
|
||||
import org.broadinstitute.sting.utils.Utils;
|
||||
|
||||
import net.sf.samtools.util.CloseableIterator;
|
||||
|
||||
|
||||
/**
|
||||
* Simple bed format parser:
|
||||
*
|
||||
* http://genome.ucsc.edu/FAQ/FAQformat.html
|
||||
*
|
||||
*
|
||||
* User: mdepristo
|
||||
* Date: April 20, 2010
|
||||
* Time: 10:47:14 AM
|
||||
*/
|
||||
public class RodBed extends BasicReferenceOrderedDatum {
|
||||
protected GenomeLoc loc;
|
||||
private List<String> fields;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// Constructors
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
public RodBed(final String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ROD accessors
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
public GenomeLoc getLocation() {
|
||||
return loc;
|
||||
}
|
||||
//
|
||||
// public ArrayList<String> getHeader() {
|
||||
// return header;
|
||||
// }
|
||||
|
||||
public List<String> getFields(final Object key) {
|
||||
return fields;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// formatting
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
public String toString() { return "BED: " + Utils.join("\t", fields); }
|
||||
|
||||
/**
|
||||
* Used by ROD management system to set the data in this ROD associated with a line in a rod
|
||||
*
|
||||
* @param headerObj
|
||||
* @param parts
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public boolean parseLine(final Object headerObj, final String[] parts) throws IOException {
|
||||
if ( parts.length < 4 )
|
||||
throw new StingException("BED format requires at least 3 fields: contig start and stop");
|
||||
|
||||
String contig = parts[0];
|
||||
int start = Integer.valueOf(parts[1]) + 1; // 1 indel
|
||||
int stop = Integer.valueOf(parts[2]) + 1; // 1 indel
|
||||
loc = GenomeLocParser.parseGenomeLoc(contig, start, stop);
|
||||
|
||||
fields = Arrays.asList(parts);
|
||||
// for ( int i = 0; i < parts.length; i++ ) {
|
||||
// fields.add(parts[i]);
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -63,8 +63,7 @@ public class RODTrackBuilder implements RMDTrackBuilder {
|
|||
Types.put("PicardDbSNP", rodPicardDbSNP.class);
|
||||
Types.put("HapmapVCF", HapmapVCFROD.class);
|
||||
Types.put("Beagle", BeagleROD.class);
|
||||
Types.put("Plink", PlinkRod.class);
|
||||
Types.put("Bed", RodBed.class);
|
||||
Types.put("Plink", PlinkRod.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -76,8 +76,7 @@ public class TribbleRMDTrackBuilder extends PluginManager<FeatureCodec> implemen
|
|||
public Map<String, Class> getAvailableTrackNamesAndTypes() {
|
||||
Map<String, Class> classes = new HashMap<String, Class>();
|
||||
for (String c : this.pluginsByName.keySet())
|
||||
if (!c.contains("BED")) // ugg the collision for Bed files is a problem right now
|
||||
classes.put(c,this.pluginsByName.get(c));
|
||||
classes.put(c, this.pluginsByName.get(c));
|
||||
return classes;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers;
|
||||
|
||||
import org.broad.tribble.bed.BEDFeature;
|
||||
import org.broadinstitute.sting.commandline.Argument;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
||||
|
|
@ -31,7 +32,7 @@ public class DesignFileGeneratorWalker extends RodWalker<Long,Long> {
|
|||
|
||||
private HashMap<GenomeLoc,IntervalInfoBuilder> intervalBuffer = new HashMap<GenomeLoc,IntervalInfoBuilder>();
|
||||
private HashSet<rodRefSeq> refseqBuffer = new HashSet<rodRefSeq>();
|
||||
private RodBed currentTCGA = null;
|
||||
private BEDFeature currentTCGA = null;
|
||||
|
||||
public Long map(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
|
||||
// three items to look up: interval_list, tcga, and refseq
|
||||
|
|
@ -67,7 +68,7 @@ public class DesignFileGeneratorWalker extends RodWalker<Long,Long> {
|
|||
// update the current tcga target
|
||||
|
||||
if ( tcgaList != null && tcgaList.size() > 0 ) {
|
||||
currentTCGA = (RodBed) tcgaList.get(0);
|
||||
currentTCGA = (BEDFeature) tcgaList.get(0);
|
||||
}
|
||||
|
||||
cleanup(ref);
|
||||
|
|
@ -96,13 +97,13 @@ public class DesignFileGeneratorWalker extends RodWalker<Long,Long> {
|
|||
}
|
||||
|
||||
if ( currentTCGA != null &&
|
||||
interval.overlapsP(currentTCGA.getLocation()) &&
|
||||
currentTCGA.getFields(null).size() > 2 &&
|
||||
! intervalBuffer.get(interval).geneNames.contains("TCGA_"+currentTCGA.getFields(null).get(3)) ) {
|
||||
interval.overlapsP(GenomeLocParser.createGenomeLoc(currentTCGA.getChr(),currentTCGA.getStart(),currentTCGA.getEnd())) &&
|
||||
!currentTCGA.getName().equals("") &&
|
||||
! intervalBuffer.get(interval).geneNames.contains("TCGA_"+currentTCGA.getName()) ) {
|
||||
|
||||
intervalBuffer.get(interval).update("TCGA_"+currentTCGA.getFields(null).get(3).split("_f|_r")[0],
|
||||
new ArrayList<GenomeLoc>(Arrays.asList(currentTCGA.getLocation())),
|
||||
new ArrayList<Integer>(Arrays.asList(Integer.parseInt(currentTCGA.getFields(null).get(3).split("_f|_r")[1])-1)));
|
||||
intervalBuffer.get(interval).update("TCGA_"+currentTCGA.getName().split("_f|_r")[0],
|
||||
new ArrayList<GenomeLoc>(Arrays.asList(GenomeLocParser.createGenomeLoc(currentTCGA.getChr(),currentTCGA.getStart(),currentTCGA.getEnd()))),
|
||||
new ArrayList<Integer>(Arrays.asList(Integer.parseInt(currentTCGA.getName().split("_f|_r")[1])-1)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -138,7 +139,7 @@ public class DesignFileGeneratorWalker extends RodWalker<Long,Long> {
|
|||
intervalBuffer.remove(interval);
|
||||
}
|
||||
|
||||
if ( currentTCGA != null && currentTCGA.getLocation().isBefore(ref.getLocus()) ) {
|
||||
if ( currentTCGA != null && GenomeLocParser.createGenomeLoc(currentTCGA.getChr(),currentTCGA.getStart(),currentTCGA.getEnd()).isBefore(ref.getLocus()) ) {
|
||||
currentTCGA = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue