public void assignPVarInGaussian( final double pVar ) { pVarInGaussian.add( pVar ); }
@Override public Pair<ExpandingArrayList<Long>, Long> treeReduce(Pair<ExpandingArrayList<Long>, Long> lhs, Pair<ExpandingArrayList<Long>, Long> rhs) { ExpandingArrayList<Long> nt = new ExpandingArrayList<Long>(); nt.addAll(lhs.first); int index = 0; for (Long l : rhs.first) { if (nt.get(index) == null) nt.add(l); else nt.set(index,nt.get(index) + l); index++; } return new Pair<ExpandingArrayList<Long>, Long>(nt, lhs.second + rhs.second); }
@BeforeMethod public void before() { empty = new ExpandingArrayList<Integer>(); initCap10 = new ExpandingArrayList<Integer>(10); hasOne = new ExpandingArrayList<Integer>(); hasOne.add(1); hasTen = new ExpandingArrayList<Integer>(); hasTen.addAll(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); }
private void maybeExpand(int index, E value) { if ( index >= size() ) { ensureCapacity(index+1); // make sure we have space to hold at least index + 1 elements // We need to add null items until we can safely set index to element for ( int i = size(); i <= index; i++ ) add(value); } }
/** * add a datum representing a variant site (or allele) to the data in {@code variants}, which represents the callset to be recalibrated * @param variants is modified by having a new VariantDatum added to it */ private void addDatum(final ExpandingArrayList<VariantDatum> variants, final boolean isInput, final RefMetaDataTracker tracker, final AlignmentContext context, final VariantContext vc, final Allele refAllele, final Allele altAllele) { final VariantDatum datum = new VariantDatum(); // Populate the datum with lots of fields from the VariantContext, unfortunately the VC is too big so we just pull in only the things we absolutely need. datum.referenceAllele = refAllele; datum.alternateAllele = altAllele; dataManager.decodeAnnotations(datum, vc, true); //BUGBUG: when run with HierarchicalMicroScheduler this is non-deterministic because order of calls depends on load of machine datum.loc = (isInput ? getToolkit().getGenomeLocParser().createGenomeLoc(vc) : null); datum.originalQual = vc.getPhredScaledQual(); datum.isSNP = vc.isSNP() && vc.isBiallelic(); datum.isTransition = datum.isSNP && GATKVariantContextUtils.isTransition(vc); datum.isAggregate = !isInput; // Loop through the training data sets and if they overlap this locus (and allele, if applicable) then update the prior and training status appropriately dataManager.parseTrainingSets(tracker, context.getLocation(), vc, datum, TRUST_ALL_POLYMORPHIC); final double priorFactor = QualityUtils.qualToProb(datum.prior); datum.prior = Math.log10(priorFactor) - Math.log10(1.0 - priorFactor); variants.add(datum); }