Package org.broad.igv.util

Examples of org.broad.igv.util.ResourceLocator


    private SQLCodecSource getUnigene(String path) {
        AsciiFeatureCodec codec = new IGVBEDCodec();
        String host = (new File(TestUtils.DATA_DIR)).getAbsolutePath();

        String url = DBManager.createConnectionURL("sqlite", host, path, null);
        ResourceLocator locator = new ResourceLocator(url);
        String tableName = "unigene";

        DBProfile.DBTable table = new DBProfile.DBTable(locator, tableName, "n/a", null, "chrom", "chromStart", "chromEnd", 1, Integer.MAX_VALUE, null, null, null);
        SQLCodecSource reader = new SQLCodecSource(table, codec);
        return reader;
View Full Code Here


            expectedValues.put(chr, value);
            value++;
        }

        String testFile = TestUtils.DATA_DIR + "tdf/wholeGenomeTest.tdf";
        TDFReader reader = new TDFReader(new ResourceLocator(testFile));
        TDFDataSource ds = new TDFDataSource(reader, 0, "", genome);

        List<LocusScore> wgScores = ds.getSummaryScores(Globals.CHR_ALL, 0, Integer.MAX_VALUE, 0);
        for (LocusScore score : wgScores) {
View Full Code Here

            e.printStackTrace();
        }
        Assume.assumeTrue(genome != null);


        WiggleDataset ds = (new WiggleParser(new ResourceLocator(wigPath), genome)).parse();
        DatasetDataSource wigSource = new DatasetDataSource(wigPath, ds, genome);


        TDFReader tdfReader = TDFReader.getReader(tdfPath);
        TDFDataSource tdfSource = new TDFDataSource(tdfReader, 0, tdfPath, genome);
View Full Code Here

    private static void checkConnectUCSC() throws Exception {
        boolean succeeded = false;
        try {
            String testPath = DBManager.createConnectionURL("mysql", UCSC_HOST, "hg18", null);
            ResourceLocator locator = new ResourceLocator(testPath);
            locator.setUsername("genome");
            DBManager.getConnection(locator);
            succeeded = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

        String path = "hg18";
        String port = null;

        String url = DBManager.createConnectionURL("mysql", host, path, port);
        ResourceLocator locator = new ResourceLocator(url);
        locator.setUsername("genome");

        String tableName = "knownGene";
        int strt = 100000;
        int end = 400000;
View Full Code Here

    }

    static ResultSet getAllFromSQLTable(String path, String table) throws Exception {
        File dataDir = new File(TestUtils.DATA_DIR);
        String url = DBManager.createConnectionURL("sqlite", dataDir.getAbsolutePath(), path, null);
        ResourceLocator locator = new ResourceLocator(url);
        Connection conn = DBManager.getConnection(locator);

        String query = "SELECT * FROM " + table;
        Statement st = conn.createStatement();
        return st.executeQuery(query);
View Full Code Here

    @Test
    public void testGetStoredConnection() throws Exception {
        String subPath = "sql/unigene_profile.dbxml";
        File profile = new File(TestUtils.DATA_DIR, subPath);
        ResourceLocator locator = DBProfile.parseProfile(profile.getAbsolutePath()).getDBLocator();
        Connection conn = DBManager.getConnection(locator);
        Statement st = conn.createStatement();
        ResultSet rs = st.executeQuery("SELECT * FROM unigene");
        assertFalse(conn.isClosed());
        conn.close();
View Full Code Here

import java.net.URL;

public class IGVComponentMethods extends AbstractFeatureReader.ComponentMethods {

    public boolean isTabix(String resourcePath, String tabxIndex) throws IOException {
        ResourceLocator locator = new ResourceLocator(resourcePath);
        if (tabxIndex == null) {
            if (HttpUtils.isRemoteURL(locator.getPath())) {
                final URL url = new URL(locator.getPath());
                String path = url.getPath();
                String indexPath = path + ".tbi";   // Strip off parameters
                tabxIndex = locator.getPath().replace(path, indexPath);
            } else {
                tabxIndex = locator.getPath() + ".tbi";
            }
        }
        boolean isTabix =  (locator.getPath().endsWith(".gz") || locator.getPath().endsWith(".bgz")) && FileUtils.resourceExists(tabxIndex);
        if(isTabix) {
            locator.setIndexPath(tabxIndex);
        }
        return isTabix;
    }
View Full Code Here

    private void loadVariantsButtonActionPerformed(ActionEvent e) {

        File variantListFile = FileDialogUtils.chooseFile("Import variant list");
        if (variantListFile != null) {
            try {
                VariantListManager.loadVariants(new ResourceLocator(variantListFile.getAbsolutePath()));
            } catch (IOException e1) {
                MessageUtils.showMessage("Error loading variant file: " + e.toString());
            }
        }
        refreshList();
View Full Code Here

                    for (String sample : variant.samples) {
                        String path = VariantListManager.samplePathMap.get(sample);
                        if (path == null) {
                            MessageUtils.showMessage("Sample not found: " + sample);
                        } else {
                            locators.add(new ResourceLocator(path));
                        }
                    }

                    // New session
                    IGV.getInstance().resetSession(null);
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.