Removed outdated Sequenom rod and renamed HapMapGenotypeROD to HapMapROD.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3149 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
fa01876255
commit
961ca05abc
|
|
@ -5,9 +5,9 @@ import java.util.*;
|
|||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.GenomeLocParser;
|
||||
|
||||
public class HapMapGenotypeROD extends TabularROD
|
||||
public class HapMapROD extends TabularROD
|
||||
{
|
||||
public HapMapGenotypeROD(final String name) {
|
||||
public HapMapROD(final String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
package org.broadinstitute.sting.gatk.refdata;
|
||||
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.GenomeLocParser;
|
||||
import org.broadinstitute.sting.utils.StingException;
|
||||
import org.broadinstitute.sting.utils.genotype.Variation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class SequenomROD extends TabularROD implements Variation {
|
||||
|
||||
public SequenomROD(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public GenomeLoc getLocation() {
|
||||
long pos = Long.parseLong(this.get("1"));
|
||||
return GenomeLocParser.createGenomeLoc(this.get("0"), pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the reference base(s) at this position
|
||||
*
|
||||
* @return the reference base or bases, as a string
|
||||
*/
|
||||
@Override
|
||||
public String getReference() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public List<String> getFWDAlleles() {
|
||||
return Arrays.asList(this.get("2"));
|
||||
}
|
||||
|
||||
public String getAltBasesFWD() { return getFWDAlleles().get(0); }
|
||||
|
||||
/**
|
||||
* get the frequency of this variant, if we're a variant. If we're reference this method
|
||||
* should return 0.
|
||||
*
|
||||
* @return double with the stored frequency
|
||||
*/
|
||||
@Override
|
||||
public double getNonRefAlleleFrequency() {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* A convenience method, for switching over the variation type
|
||||
*
|
||||
* @return the VARIANT_TYPE of the current variant
|
||||
*/
|
||||
@Override
|
||||
public VARIANT_TYPE getType() {
|
||||
return VARIANT_TYPE.SNP;
|
||||
}
|
||||
|
||||
public boolean isSNP() { return true; }
|
||||
public boolean isReference() { return false; }
|
||||
public boolean isInsertion() { return false; }
|
||||
public boolean isDeletion() { return false; }
|
||||
public boolean isIndel() { return false; }
|
||||
|
||||
/**
|
||||
* gets the alternate base is the case of a SNP. Throws an IllegalStateException if we're not a SNP
|
||||
* of
|
||||
*
|
||||
* @return a char, representing the alternate base
|
||||
*/
|
||||
@Override
|
||||
public char getAlternativeBaseForSNP() {
|
||||
return getAltBasesFWD().charAt(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the reference base is the case of a SNP. Throws an IllegalStateException if we're not a SNP
|
||||
*
|
||||
* @return a char, representing the alternate base
|
||||
*/
|
||||
@Override
|
||||
public char getReferenceForSNP() {
|
||||
return 'N';
|
||||
}
|
||||
|
||||
public boolean isBiallelic() { return true; }
|
||||
|
||||
/**
|
||||
* get the -1 * (log 10 of the error value)
|
||||
*
|
||||
* @return the postive number space log based error estimate
|
||||
*/
|
||||
@Override
|
||||
public double getNegLog10PError() {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the alternate alleles. This method should return all the alleles present at the location,
|
||||
* NOT including the reference base. This is returned as a string list with no guarantee ordering
|
||||
* of alleles (i.e. the first alternate allele is not always going to be the allele with the greatest
|
||||
* frequency).
|
||||
*
|
||||
* @return an alternate allele list
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAlternateAlleleList() {
|
||||
List<String> ret = new ArrayList<String>();
|
||||
for (char c: getAltBasesFWD().toCharArray())
|
||||
ret.add(String.valueOf(c));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the alleles. This method should return all the alleles present at the location,
|
||||
* including the reference base. The first allele should always be the reference allele, followed
|
||||
* by an unordered list of alternate alleles.
|
||||
*
|
||||
* @return an alternate allele list
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAlleleList() {
|
||||
throw new StingException("SequenomRod doesn't know of the reference, and can't generate allele lists");
|
||||
}
|
||||
|
||||
public boolean isHom() { return false; }
|
||||
public boolean isHet() { return false; }
|
||||
public double getHeterozygosity() { return 0.0; }
|
||||
public double getMAF() { return 0.0; }
|
||||
public int getPloidy() { return 2; }
|
||||
public int length() { return 1; }
|
||||
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(getLocation().getContig() + "\t" + getLocation().getStart() + "\t" + getFWDAlleles().get(0));
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ public class VariantContextAdaptors {
|
|||
adaptors.put(RodVCF.class, new RodVCFAdaptor());
|
||||
adaptors.put(VCFRecord.class, new VCFRecordAdaptor());
|
||||
adaptors.put(PlinkRod.class, new PlinkRodAdaptor());
|
||||
adaptors.put(HapMapGenotypeROD.class, new HapMapAdaptor());
|
||||
adaptors.put(HapMapROD.class, new HapMapAdaptor());
|
||||
adaptors.put(RodGLF.class, new GLFAdaptor());
|
||||
adaptors.put(RodGeliText.class, new GeliAdaptor());
|
||||
}
|
||||
|
|
@ -604,7 +604,7 @@ public class VariantContextAdaptors {
|
|||
* @return a VariantContext object
|
||||
*/
|
||||
VariantContext convert(String name, Object input, Allele refAllele) {
|
||||
HapMapGenotypeROD hapmap = (HapMapGenotypeROD)input;
|
||||
HapMapROD hapmap = (HapMapROD)input;
|
||||
|
||||
// add the reference allele
|
||||
HashSet<Allele> alleles = new HashSet<Allele>();
|
||||
|
|
|
|||
|
|
@ -63,11 +63,10 @@ public class RODTrackBuilder implements RMDTrackBuilder {
|
|||
Types.put("Table", TabularROD.class);
|
||||
Types.put("PooledEM", PooledEMSNPROD.class);
|
||||
Types.put("CleanedOutSNP", CleanedOutSNPROD.class);
|
||||
Types.put("Sequenom", SequenomROD.class);
|
||||
Types.put("SangerSNP", SangerSNPROD.class);
|
||||
Types.put("SimpleIndel", SimpleIndelROD.class);
|
||||
Types.put("PointIndel", PointIndelROD.class);
|
||||
Types.put("HapMapGenotype", HapMapGenotypeROD.class);
|
||||
Types.put("HapMap", HapMapROD.class);
|
||||
Types.put("Intervals", IntervalRod.class);
|
||||
Types.put("Variants", RodGeliText.class);
|
||||
Types.put("GLF", RodGLF.class);
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
|
|||
Object rod = rods.get(0);
|
||||
if ( rod instanceof RodVCF )
|
||||
samples.addAll(Arrays.asList(((RodVCF)rod).getSampleNames()));
|
||||
else if ( rod instanceof HapMapGenotypeROD )
|
||||
samples.addAll(Arrays.asList(((HapMapGenotypeROD)rod).getSampleIDs()));
|
||||
else if ( rod instanceof HapMapROD )
|
||||
samples.addAll(Arrays.asList(((HapMapROD)rod).getSampleIDs()));
|
||||
else
|
||||
samples.addAll(Arrays.asList(rec.getSampleNames()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class VariantsToVCFIntegrationTest extends WalkerTest {
|
|||
|
||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||
"-R " + oneKGLocation + "reference/human_b36_both.fasta" +
|
||||
" -B variant,HapMapGenotype," + validationDataLocation + "rawHapMap.yri.chr1.txt" +
|
||||
" -B variant,HapMap," + validationDataLocation + "rawHapMap.yri.chr1.txt" +
|
||||
" -T VariantsToVCF" +
|
||||
" -L 1:1-1,000,000" +
|
||||
" -o %s",
|
||||
|
|
|
|||
Loading…
Reference in New Issue