Package org.broad.igv.variant

Examples of org.broad.igv.variant.VariantTrack$SampleBounds


        boolean enableMethylationRateSupport = (header.getFormatHeaderLine("MR") != null &&
                header.getFormatHeaderLine("GB") != null);

        List<String> allSamples = new ArrayList(header.getGenotypeSamples());

        VariantTrack t = new VariantTrack(locator, src, allSamples, enableMethylationRateSupport);

        // VCF tracks handle their own margin
        t.setMargin(0);
        newTracks.add(t);
    }
View Full Code Here


        boolean enableMethylationRateSupport = (header.getFormatHeaderLine("MR") != null &&
                header.getFormatHeaderLine("GB") != null);

        List<String> allSamples = new ArrayList(header.getGenotypeSamples());

        VariantTrack t = new VariantTrack(locator, src, allSamples, enableMethylationRateSupport);

        // VCF tracks handle their own margin
        t.setMargin(0);
        newTracks.add(t);
    }
View Full Code Here

    }

    private void tstLoadVCF(String sessionPath) throws Exception{
        rewriteRestoreSession(sessionPath);

        VariantTrack vTrack = (VariantTrack) IGV.getInstance().getAllTracks().get(0);

        assertEquals(3, vTrack.getAllSamples().size());
        assertEquals(8, vTrack.getSquishedHeight());
        assertEquals(VariantTrack.ColorMode.ALLELE, vTrack.getColorMode());
    }
View Full Code Here

    @Test
    public void basicIOTest() throws Exception {
        String inputPath = TestUtils.DATA_DIR + "vcf/hc_mod.vcf";
        TestUtils.createIndex(inputPath);

        VariantTrack inputTrack = (VariantTrack) (new TrackLoader()).load(new ResourceLocator(inputPath), genome).get(0);

        VCFEncoder encoder = new VCFEncoder();
        Argument arg = new Argument(null, Argument.InputType.VARIANT_TRACK, null, null, null, null, false, null);

        Map<Argument, Object> arguments = new HashMap(1);
        arguments.put(arg, inputTrack);
        encoder.setInputs(null, arguments, arg);

        String chr = "chr20";
        int start = 10499005;
        int end = 10499500;

        String outpath = TestUtils.TMP_OUTPUT_DIR + "hc_mod_out.vcf";
        OutputStream outputStream = new FileOutputStream(outpath);

        List<VCFVariant> infeatures = new ArrayList<VCFVariant>();
        for (Feature feat : inputTrack.getFeatures(chr, start, end)) {
            infeatures.add((VCFVariant) feat);
        }

        encoder.encodeAll(outputStream, infeatures.iterator());

        TestUtils.createIndex(outpath);
        VariantTrack outputTrack = (VariantTrack) (new TrackLoader()).load(new ResourceLocator(inputPath), genome).get(0);

        VCFWriterTest.assertHeadersEquals((VCFHeader) inputTrack.getHeader(), (VCFHeader) outputTrack.getHeader());

        int n = 0;
        for (Feature var1 : inputTrack.getFeatures(chr, start, end)) {
            VCFVariant var0 = infeatures.get(n++);
            VCFWriterTest.assertVCFVariantsEqual(var0, (VCFVariant) var1);
View Full Code Here

                    newTrack = new DataSourceTrack(null, UUID.randomUUID().toString(), name, dataSource);
                    break;
                case VARIANT_TRACK:
                    PluginFeatureSource VfeatSource1 = new PluginFeatureSource(cmdList, argumentValues, outputAttr, specPath, this.forbidEmptyOutput);
                    FeatureSource VfeatSource = new CachingFeatureSource(VfeatSource1);
                    newTrack = new VariantTrack(name, VfeatSource);
                    break;
            }
            newTracks.add(newTrack);
        }
        return newTracks;
View Full Code Here

    private VCFHeader header;

    @Override
    public void setInputs(List<String> commands, Map<Argument, Object> argumentMap, Argument argument) {
        assert argument.getType() == Argument.InputType.VARIANT_TRACK;
        VariantTrack track = (VariantTrack) argumentMap.get(argument);
        this.header = (VCFHeader) track.getHeader();
    }
View Full Code Here

    public static VariantTrack loadVariantReview(ResourceLocator locator, List<Track> newTracks) {
        //TODO Figure out how to name the samples properly
        List<String> allSamples = Collections.emptyList();
        VariantReviewSource source = new VariantReviewSource(locator);
        VariantTrack track = new VariantTrack(locator, source, allSamples, false);
        track.setRenderer(new VariantReviewRenderer(track));
        newTracks.add(track);
        track.setMargin(0);
        return track;
    }
View Full Code Here

            public JMenuItem build(Collection<Track> selectedTracks, TrackClickEvent te) {
                if(!isSingleVariantTrack(selectedTracks)){
                    return null;
                }
                Track track = selectedTracks.iterator().next();
                final VariantTrack vTrack = (VariantTrack) track;
                final Variant variant = vTrack.getSelectedVariant(te);

                ResourceLocator trackLocator = vTrack.getResourceLocator();
                //If the track isn't connected to a database, use the default
                if(!trackLocator.getPath().toLowerCase().endsWith(VARIANT_DB_EXT) && defaultLocator != null){
                    trackLocator = defaultLocator;
                }
                String dbName = trackLocator.getName();
View Full Code Here

TOP

Related Classes of org.broad.igv.variant.VariantTrack$SampleBounds

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.