@@ -0,0 +1,2634 @@
+/*%0A * Copyright (c) 2007-2012 The Broad Institute, Inc.%0A * SOFTWARE COPYRIGHT NOTICE%0A * This software and its documentation are the copyright of the Broad Institute, Inc. All rights are reserved.%0A *%0A * This software is supplied without any warranty or guaranteed support whatsoever. The Broad Institute is not responsible for its use, misuse, or functionality.%0A *%0A * This software is licensed under the terms of the GNU Lesser General Public License (LGPL),%0A * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php.%0A */%0A%0Apackage org.broad.igv.variant.vcf;%0A%0Aimport org.broad.igv.feature.LocusScore;%0Aimport org.broad.igv.track.FeatureSource;%0Aimport org.broadinstitute.sting.gatk.walkers.na12878kb.core.*;%0Aimport org.broadinstitute.sting.utils.GenomeLocParser;%0A%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.Iterator;%0Aimport java.util.List;%0A%0A/**%0A * User: jacob%0A * Date: 2012-Dec-14%0A */%0Apublic class NA12878KBReview implements FeatureSource%3CVCFVariant%3E %7B%0A%0A    private int featureWindowSize = 1000000;%0A    private NA12878DBArgumentCollection args;%0A    private NA12878KnowledgeBase kb;%0A%0A    public NA12878KBReview(String dbPathString)%7B%0A        this.args = new NA12878DBArgumentCollection(dbPathString);%0A%0A    %7D%0A%0A    private void initKB() %7B%0A        kb = new NA12878KnowledgeBase(null, this.args);%0A    %7D%0A%0A    private void closeKB() %7B%0A        if (kb != null) %7B%0A            kb.close();%0A            kb = null;%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected void finalize() throws Throwable %7B%0A        super.finalize();%0A        this.closeKB();%0A    %7D%0A%0A    @Override%0A    public Iterator%3CVCFVariant%3E getFeatures(String chr, int start, int end) throws IOException %7B%0A        if(kb == null)%7B%0A            initKB();%0A        %7D%0A        SiteSelector criteria = new SiteSelector(new GenomeLocParser(null));%0A        criteria.addInterval(chr, start, end).onlyReviewed();%0A        SiteIterator%3CMongoVariantContext%3E iterator  = kb.getCalls(criteria);%0A        List%3CVCFVariant%3E variants = new ArrayList%3CVCFVariant%3E();%0A        while(iterator.hasNext())%7B%0A            MongoVariantContext mvc = iterator.next();%0A            VCFVariant vcf = new VCFVariant(mvc.getVariantContext(), mvc.getChr());%0A            variants.add(vcf);%0A        %7D%0A        return variants.iterator();%0A    %7D%0A%0A%0A    @Override%0A    public List%3CLocusScore%3E getCoverageScores(String chr, int start, int end, int zoom) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public int getFeatureWindowSize() %7B%0A        return featureWindowSize;%0A    %7D%0A%0A    @Override%0A    public void setFeatureWindowSize(int size) %7B%0A        this.featureWindowSize = size;%0A    %7D%0A%7D%0A

Add NA12878KBReview implements FeatureSource. In theory should be able to query db when called correctly, provided we find a way to create a GenomeLocParser