Package org.broad.igv.util

Examples of org.broad.igv.util.ResourceLocator


    }

    //Scratch work for testing loading from local mysql db
    public void testLoadMySQL() throws Exception {
        String url = DBManager.createConnectionURL("mysql", "calcium", "igv_nobel_dev", null);
        ResourceLocator locator = new ResourceLocator(url);
        locator.setUsername("igv_nobel_dev");
        locator.setPassword("nottherealpassword");
        String tableName = "CNV";
        DBProfile.DBTable table = DBProfile.DBTable.build(locator, tableName);

        SegmentedReader reader = new SegmentedReader(locator);
        SegmentedAsciiDataSet ds = reader.loadFromDB(table);
View Full Code Here


    }

    @Test
    public void testLoadGFF() throws Exception {
        String filepath = TestUtils.DATA_DIR + "gff/simfeatures.gff3";
        List<Track> tracks = trackLoader.load(new ResourceLocator(filepath), genome);
        assertEquals(1, tracks.size());
        FeatureTrack track = (FeatureTrack) tracks.get(0);

        assertEquals("notmeaningful", track.getName());
View Full Code Here

        //Check file
        File outFile = new File(fullout);
        assertTrue(outFile.exists());
        assertTrue(outFile.canRead());

        WiggleParser parser = new WiggleParser(new ResourceLocator(fullout));
        WiggleDataset wgs = parser.parse();
        assertEquals(3, wgs.getChromosomes().length);
        for(String chr: new String[]{"chr1", "chr3", "chr7"}){
            assertNotNull(wgs.getData(null, chr));
        }
View Full Code Here

    @Test
    public void testLoadGFFAliasedChrs() throws Exception {
        String filepath = TestUtils.DATA_DIR + "gff/aliased.unsorted.gff";
        Genome genome = IgvTools.loadGenome(TestUtils.DATA_DIR + "genomes/hg18_truncated_aliased.genome");
        List<Track> tracks = trackLoader.load(new ResourceLocator(filepath), genome);
        assertEquals(1, tracks.size());
        FeatureTrack track = (FeatureTrack) tracks.get(0);

        assertEquals("aliased.unsorted.gff", track.getName());
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testLoadVCFUpperCase() throws Exception {
        String filepath = TestUtils.DATA_DIR + "vcf/HC_MOD_CAPS.VCF";
        ResourceLocator locator = new ResourceLocator(filepath);
        TestUtils.createIndex(filepath);

        List<Track> tracks = trackLoader.load(locator, genome);
        assertEquals(1, tracks.size());
        assertTrue("VCF file loaded incorrect track type", tracks.get(0) instanceof VariantTrack);
View Full Code Here

            } else {
                File outFile = new File(fullout);
                assertTrue(outFile.exists());
                assertTrue(outFile.canRead());

                ResourceLocator locator = new ResourceLocator(fullout);
                WiggleDataset ds = (new WiggleParser(locator, IgvTools.loadGenome(hg18id))).parse();

                //We miss a few alignments with this option sometimes,
                //so it doesn't total up the same
                if (!opt.contains("strands=first")) {
View Full Code Here

    private List<Track> tstLoadFi(String filepath, Integer expected_tracks, Genome genome, boolean makeIndex) throws Exception {
        return tstLoadFi(this.trackLoader, filepath, expected_tracks, genome, makeIndex);
    }

    static List<Track> tstLoadFi(TrackLoader trackLoader, String filepath, Integer expected_tracks, Genome genome, boolean makeIndex) throws Exception {
        ResourceLocator locator = new ResourceLocator(filepath);

        //Try creating an index
        //UI would ask for confirmation
        if (makeIndex) {
            try {
View Full Code Here

        }
        wfs = wfs.substring(0, wfs.lastIndexOf(","));
        String[] cmd = {"count", "--windowFunctions", wfs, inputFile, outputFile, hg18id};
        igvTools.run(cmd);

        TDFReader reader = new TDFReader(new ResourceLocator(outputFile));
        for (WindowFunction wf : windowFunctions) {
            TDFDataset ds = reader.getDataset(chr, 0, wf);
            assertNotNull(ds);
        }
    }
View Full Code Here

    @Test
    public void testLoadSegProfile() throws Exception {
        String path = TestUtils.DATA_DIR + "sql/seg_canFam2_profile.dbxml";

        int expectedTracks = 6;
        List<Track> tracks = trackLoader.load(new ResourceLocator(path), genome);
        assertEquals(expectedTracks, tracks.size());
        Set<String> expSampleIds = new HashSet<String>(Arrays.asList("0123-A", "0123-B-1", "0123-C-1", "0123-C-2", "0123-C-3"));
        Set<String> actSampleIds = new HashSet<String>(5);
        for (Track track : tracks) {
            if (track instanceof DataSourceTrack) {
View Full Code Here

        AttributeManager.getInstance().clearAllAttributes();
        String path = TestUtils.DATA_DIR + "sql/sampleinfo_brca_sif_profile.dbxml";

        int expectedTracks = 0;
        List<Track> tracks = trackLoader.load(new ResourceLocator(path), genome);
        assertEquals(expectedTracks, tracks.size());

        String[] attrNames = "TCGA_EXPERIMENT  TCGA_BATCH  TUMOR_NORMAL  BIRDSEED_GENDER  LEVEL2_NOISE  LEVEL3_SEGMENT_COUNT  PURITY  PLOIDY  DELTA  CANCER_DNA_FRACTION  SUBCLONAL_GENOME_FRACTION".split("\\s+");
        Set<String> expAttrNames = new HashSet<String>(Arrays.asList(attrNames));
        List<String> actAttrNames = AttributeManager.getInstance().getAttributeNames();
View Full Code Here

TOP

Related Classes of org.broad.igv.util.ResourceLocator

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.