Package org.broadinstitute.gatk.utils

Examples of org.broadinstitute.gatk.utils.GenomeLoc


    static boolean mergeIntoMNPvalidationCheck(GenomeLocParser genomeLocParser, VariantContext vc1, VariantContext vc2) {
        if (!vc1.isSNP() || !vc2.isSNP())
            return false;

        final GenomeLoc loc1 = GATKVariantContextUtils.getLocation(genomeLocParser, vc1);
        final GenomeLoc loc2 = GATKVariantContextUtils.getLocation(genomeLocParser, vc2);

        if (!loc1.onSameContig(loc2))
            return false;

        if (!loc1.isBefore(loc2))
View Full Code Here


    // Flush out sites with (possibly) phased genotypes, if those sites are no longer needed to phase other downstream sites
    private List<VariantContext> discardIrrelevantPhasedSites() {
        List<VariantContext> vcList = new LinkedList<VariantContext>();

        GenomeLoc nextToPhaseLoc = null;
        if (!unphasedSiteQueue.isEmpty())
            nextToPhaseLoc = GATKVariantContextUtils.getLocation(getToolkit().getGenomeLocParser(), unphasedSiteQueue.peek().variant);

        while (!partiallyPhasedSites.isEmpty()) {
            if (nextToPhaseLoc != null) { // otherwise, unphasedSiteQueue.isEmpty(), and therefore no need to keep any of the "past"
View Full Code Here

                                logger.debug("\n");
                            }
                        }

                        if (statsWriter != null) {
                            GenomeLoc prevLoc = null;
                            int curIndex = 0;
                            for (GenotypeAndReadBases grb : prevHetGenotypes) {
                                if (curIndex == prevHetGenotypes.size() - 1 - goBackFromEndOfPrevHets) {
                                    prevLoc = grb.loc;
                                    break;
View Full Code Here

            phaseRelativeToIndex = listHetGenotypes.size() - 1 - goBackFromEndOfPrevHets;
            phasingSiteIndex = listHetGenotypes.size();

            // Add the (het) position to be phased [at phasingSiteIndex]:
            GenomeLoc phaseLocus = GATKVariantContextUtils.getLocation(getToolkit().getGenomeLocParser(), vr.variant);
            GenotypeAndReadBases grbPhase = new GenotypeAndReadBases(vr.variant.getGenotype(sample), vr.sampleReadBases.get(sample), phaseLocus);
            listHetGenotypes.add(grbPhase);
            if (DEBUG) logger.debug("PHASING het site = " + grbPhase.loc + " [phasingSiteIndex = " + phasingSiteIndex + "]");

            // Include as-of-yet unphased sites in the phasing computation:
View Full Code Here

    }

    @Test()
    public void testMultiAlleleWithHomLiks() {
        final SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(seq.getSequenceDictionary());
        final GenomeLoc myLocation = genomeLocParser.createGenomeLoc("1", 10);

        final int pileupSize = 100;
        final int readLength = 10;
        final List<GATKSAMRecord> reads = new LinkedList<GATKSAMRecord>();
        for ( int i = 0; i < pileupSize; i++ ) {
View Full Code Here


    @Test()
    public void testMultiAlleleWithHetLiks() {
        final SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(seq.getSequenceDictionary());
        final GenomeLoc myLocation = genomeLocParser.createGenomeLoc("1", 10);

        final int pileupSize = 100;
        final int readLength = 10;
        final List<GATKSAMRecord> reads = new LinkedList<GATKSAMRecord>();
        for ( int i = 0; i < pileupSize; i++ ) {
View Full Code Here

    public PositionalState map(final RefMetaDataTracker tracker, final ReferenceContext ref, final AlignmentContext context) {
        if ( tracker == null ) // RodWalkers can make funky map calls
            return null;

        final GenomeLoc loc = ref.getLocus();
        return new PositionalState(tracker.getValues(variants, loc), ref.getBases(), loc);
    }
View Full Code Here

                    state.VCs.remove(i);
            }
        }

        if ( !stoppedVCs.isEmpty() ) {
            final GenomeLoc gLoc = genomeLocParser.createGenomeLoc(stoppedVCs.get(0).getChr(), pos);

            // we need the specialized merge if the site contains anything other than ref blocks
            final VariantContext mergedVC;
            if ( containsTrueAltAllele(stoppedVCs) )
                mergedVC = ReferenceConfidenceVariantContextMerger.merge(stoppedVCs, gLoc, refBase, false);
View Full Code Here

                for ( int leftSplice : Arrays.asList(10, 20, 30) ) {
                    for ( int rightSplice : Arrays.asList(20, 30, 40) ) {
                        if ( leftSplice >= rightSplice )
                            continue;

                        final GenomeLoc readLoc = genomeLocParser.createGenomeLoc("1", leftRead, rightRead);
                        final GenomeLoc spliceLoc = genomeLocParser.createGenomeLoc("1", leftSplice, rightSplice);
                        tests.add(new Object[]{readLoc, spliceLoc});
                    }
                }
            }
        }
View Full Code Here

    }

    @Test(dataProvider = "dataSets")
    public void testFilterReadsToOverlap(final String[] samples, final Allele[] alleles, final Map<String,List<GATKSAMRecord>> reads) {
        final ReadLikelihoods<Allele> original = new ReadLikelihoods<>(new IndexedSampleList(samples), new IndexedAlleleList<>(alleles), reads);
        final GenomeLoc evenReadOverlap = locParser.createGenomeLoc(SAM_HEADER.getSequenceDictionary().getSequences().get(0).getSequenceName(),EVEN_READ_START ,EVEN_READ_START );
        fillWithRandomLikelihoods(samples,alleles,original);
        final ReadLikelihoods<Allele> result = original.clone();
        result.filterToOnlyOverlappingUnclippedReads(evenReadOverlap);
        final double[][][] newLikelihoods = new double[samples.length][alleles.length][];
        for (int s = 0; s < samples.length ; s++)
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.utils.GenomeLoc

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.