Package org.broadinstitute.gatk.utils

Examples of org.broadinstitute.gatk.utils.GenomeLocParser


    private SAMFileHeader header;

    @BeforeClass
    public void setup() throws FileNotFoundException {
        seq = new CachingIndexedFastaSequenceFile(new File(b37KGReference));
        genomeLocParser = new GenomeLocParser(seq);
        header = ArtificialSAMUtils.createArtificialSamHeader(seq.getSequenceDictionary());
    }
View Full Code Here


        this.readCigars = readCigars;
        this.bq = bq;
        this.dq = dq;
        this.iq = iq;
        this.kmerSize = kmerSize;
        this.genomeLocParser = new GenomeLocParser(ArtificialSAMUtils.createArtificialSamHeader(1,1,reference.length()).getSequenceDictionary());
    }
View Full Code Here

    @BeforeClass
    public void init() throws FileNotFoundException {
        // sequence
        seq = new CachingIndexedFastaSequenceFile(new File(hg18Reference));
        genomeLocParser = new GenomeLocParser(seq);
    }
View Full Code Here

            // technically, at this point our confidence in a reference call isn't accurately estimated
            //  because it didn't take into account samples with no data, so let's get a better estimate
            return limitedContext ? null : estimateReferenceConfidence(vc, stratifiedContexts, getModelTheta(model), true, PoFGT0);

        // start constructing the resulting VC
        final GenomeLocParser genomeLocParser = this.genomeLocParser != null || refContext == null ? this.genomeLocParser : refContext.getGenomeLocParser();
        if (genomeLocParser == null)
            throw new IllegalStateException("this UG engine was created without a valid genomeLocParser and no refContext was provided");
        final GenomeLoc loc = genomeLocParser.createGenomeLoc(vc);
        final List<Allele> outputAlleles = outputAlternativeAlleles.outputAlleles(vc.getReference());
        final VariantContextBuilder builder = new VariantContextBuilder(callSourceString(), loc.getContig(), loc.getStart(), loc.getStop(), outputAlleles);

        // Seems that when log10PError is 0.0, you must pass -0.0 to get a nice output at the other end otherwise is a "-0".
        // Truth is that this should be fixed in the "variant" dependency code but perhaps it can be amended also in the VariantContextWriter.
View Full Code Here

     * - Uses global variables: intervalList and previousLocus
     *
     * takes into account that the traversal may have been due over a set of intervals, or over the whole genome.
     */
    private void tallyUncoveredBasesTillEndOfTraversal() {
        GenomeLocParser parser = getToolkit().getGenomeLocParser();
        GenomeLoc lastLocus;
        if (intervalList.isEmpty()) { // whole genome, add up all contigs past previousLocus
            final int lastContigIndex = getToolkit().getSAMFileHeader().getSequenceDictionary().size() - 1;
            final int lastContigLength = getToolkit().getSAMFileHeader().getSequence(lastContigIndex).getSequenceLength();
            final String lastContigName = getToolkit().getSAMFileHeader().getSequence(lastContigIndex).getSequenceName();
            lastLocus = parser.createGenomeLoc(lastContigName, lastContigIndex, lastContigLength, lastContigLength);
        } else {
            GenomeLoc lastInterval = intervalList.getLast();
            lastLocus = parser.createGenomeLoc(lastInterval.getContig(), lastInterval.getContigIndex(), lastInterval.getStop(), lastInterval.getStop());
        }
        tallyUncoveredBases(lastLocus);
    }
View Full Code Here

     * @param currentLocus the locus we are visiting right now
     */
    private void tallyUncoveredBases(GenomeLoc currentLocus) {
        long distance = 0;
        if (previousLocus == null) { // first base visited
            GenomeLocParser parser = getToolkit().getGenomeLocParser();
            if (intervalList.isEmpty()) { // if this is whole genome (no intervals requested), add what we missed.
                final GenomeLoc zeroLoc = parser.createGenomeLoc(getToolkit().getSAMFileHeader().getSequence(0).getSequenceName(), 0, 1, 1);
                distance += currentLocus.distanceAcrossContigs(zeroLoc, getToolkit().getSAMFileHeader());
            } else { // if we are running on an interval list, add all intervals before the current locus to the uncovered bases counter
                while (!intervalList.peek().containsP(currentLocus)) {
                    GenomeLoc interval = intervalList.removeFirst();
                    distance += interval.size();
View Full Code Here

    private static GenomeLocParser genomeLocParser;

    @BeforeClass
    public void beforeClass() {
        header = ArtificialSAMUtils.createArtificialSamHeader(3, 1, 10000);
        genomeLocParser = new GenomeLocParser(header.getSequenceDictionary());
    }
View Full Code Here

    private final int readLength = 100;      // all reads will have the same size
    private final int referencePadding = 10; // standard reference padding

    @BeforeClass
    public void init() {
        parser = new GenomeLocParser(ArtificialSAMUtils.createArtificialSamHeader().getSequenceDictionary());
        readBin = new ReadBin(parser, referencePadding);
    }
View Full Code Here

    @Override protected void setUp() {
        final int nPileupsToGenerate = 100;
        pileups = new ArrayList<ReadBackedPileup>(nPileupsToGenerate);
        SAMFileHeader header = ArtificialSAMUtils.createArtificialSamHeader(1, 1, 1000);
        GenomeLocParser genomeLocParser;
        genomeLocParser = new GenomeLocParser(header.getSequenceDictionary());
        GenomeLoc loc = genomeLocParser.createGenomeLoc("chr1", 50);
        final int readLen = 100;

        for ( int pileupN = 0; pileupN < nPileupsToGenerate; pileupN++ ) {
            ReadBackedPileup rbp = ArtificialSAMUtils.createReadBackedPileup(header, loc, readLen, insertSize, pileupSize);
            pileups.add(rbp);
View Full Code Here

    @Override
    public int execute() throws IOException {
        // initialize reference
        IndexedFastaSequenceFile refReader = new IndexedFastaSequenceFile(referenceFile);
        GenomeLocParser genomeLocParser = new GenomeLocParser(refReader);       

        // initialize reads
        List<SAMReaderID> bamReaders = ListFileUtils.unpackBAMFileList(samFiles,parser);
        SAMDataSource dataSource = new SAMDataSource(bamReaders,new ThreadAllocation(),null,genomeLocParser);
View Full Code Here

TOP

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

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.