Merge branch 'master' of ssh://nickel.broadinstitute.org/humgen/gsa-scr1/gsa-engineering/git/unstable

This commit is contained in:
Ryan Poplin 2012-04-18 15:02:42 -04:00
commit 4999ae87ad
4 changed files with 17 additions and 5 deletions

View File

@ -1,6 +1,7 @@
package org.broadinstitute.sting.gatk.walkers.coverage;
import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.exceptions.UserException;
import java.util.HashMap;
import java.util.Map;
@ -45,8 +46,7 @@ public class DepthOfCoverageStats {
public static int[] calculateBinEndpoints(int lower, int upper, int bins) {
if ( bins > upper - lower || lower < 1 ) {
throw new IllegalArgumentException("Illegal argument to calculateBinEndpoints; "+
"lower bound must be at least 1, and number of bins may not exceed stop - start");
throw new UserException.BadInput("the start must be at least 1 and the number of bins may not exceed stop - start");
}
int[] binLeftEndpoints = new int[bins+1];

View File

@ -35,6 +35,7 @@ import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.walkers.PartitionBy;
import org.broadinstitute.sting.gatk.walkers.PartitionType;
import org.broadinstitute.sting.gatk.walkers.RodWalker;
import org.broadinstitute.sting.gatk.walkers.TreeReducible;
import org.broadinstitute.sting.utils.SampleUtils;
import org.broadinstitute.sting.utils.codecs.vcf.*;
import org.broadinstitute.sting.utils.exceptions.UserException;
@ -83,8 +84,8 @@ import java.util.*;
*
*/
@PartitionBy(PartitionType.NONE)
public class ApplyRecalibration extends RodWalker<Integer, Integer> {
@PartitionBy(PartitionType.LOCUS)
public class ApplyRecalibration extends RodWalker<Integer, Integer> implements TreeReducible<Integer> {
/////////////////////////////
// Inputs
@ -266,6 +267,10 @@ public class ApplyRecalibration extends RodWalker<Integer, Integer> {
return 1; // This value isn't used for anything
}
public Integer treeReduce( final Integer lhs, final Integer rhs ) {
return 1; // This value isn't used for anything
}
public void onTraversalDone( final Integer reduceSum ) {
}
}

View File

@ -73,6 +73,8 @@ public class RefSeqCodec implements ReferenceDependentFeatureCodec<RefSeqFeature
} catch ( UserException.MalformedGenomeLoc e ) {
Utils.warnUser("RefSeq file is potentially incorrect, as some transcripts or exons have a negative length ("+fields[2]+")");
return null;
} catch ( NumberFormatException e ) {
throw new UserException.MalformedFile("Could not parse location from line: " + line);
}
}

View File

@ -473,7 +473,12 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec {
protected static Allele oneAllele(String index, List<Allele> alleles) {
if ( index.equals(VCFConstants.EMPTY_ALLELE) )
return Allele.NO_CALL;
int i = Integer.valueOf(index);
final int i;
try {
i = Integer.valueOf(index);
} catch ( NumberFormatException e ) {
throw new TribbleException.InternalCodecException("The following invalid GT allele index was encountered in the file: " + index);
}
if ( i >= alleles.size() )
throw new TribbleException.InternalCodecException("The allele with index " + index + " is not defined in the REF/ALT columns in the record");
return alleles.get(i);