Package org.broad.igv.util

Examples of org.broad.igv.util.ResourceLocator


    public void testAffyMapping() throws IOException {
        String gctFile = TestUtils.DATA_DIR + "gct/affy_human.gct";
        File igvFile = new File(TestUtils.DATA_DIR + "gct/affy_human.gct.igv");
        igvFile.deleteOnExit();

        ResourceLocator locator = new ResourceLocator(gctFile);
        GCTtoIGVConverter.convert(locator, igvFile, null, 50000, null, genome);
    }
View Full Code Here


    @Test
    public void testReadVCF() throws Exception {
        String file = TestUtils.DATA_DIR + "vcf/outputPileup.flt1.vcf";
        TestUtils.createIndex(file);
        ResourceLocator locator = new ResourceLocator(file);
        //For files with 1 record, this threw a null pointer exception prior to r1595
        List<Track> tracks = igv.load(locator);

        Assert.assertEquals(1, tracks.size());
    }
View Full Code Here

        String sample = "TCGA-02-0055-01A-01W";
        String chr = "chr1";
        int start = 97575730;
        int end = 123482409;

        MutationFeatureSource.MutationDataManager mgr = new MutationFeatureSource.MutationDataManager(new ResourceLocator(path), genome);
        Iterator<Mutation> mutations =  mgr.getFeatures(sample, chr, start, end);

        int mutationCount = 0;
        while(mutations.hasNext()) {
            Mutation m = mutations.next();
View Full Code Here

    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() throws Exception {
        reader = new BAMHttpReader(new ResourceLocator(BAM_URL_STRING), true);
    }
View Full Code Here

    private List<Feature> tstOperationBED(String pathA, String pathB,
                                          CombinedFeatureSource.Operation operation, int expectedNumFeatures) throws Exception {
        IgvTools igvTools = new IgvTools();
        igvTools.doIndex(pathA, null, 1, 16000);
        igvTools.doIndex(pathB, null, 1, 16000);
        FeatureSource sourceA = TribbleFeatureSource.getFeatureSource(new ResourceLocator(pathA), genome);
        FeatureSource sourceB = TribbleFeatureSource.getFeatureSource(new ResourceLocator(pathB), genome);


        CombinedFeatureSource combinedFeatureSource = new CombinedFeatureSource(new FeatureSource[]{sourceA, sourceB}, operation);
        Iterator<Feature> features = combinedFeatureSource.getFeatures("chr1", 0, (int) 1e6);
        List<Feature> featureList = new ArrayList(10);
View Full Code Here

    @Test
    public void testIntersectBED() throws Exception {
        List<Feature> actFeatures = tstOperationBED3(CombinedFeatureSource.Operation.INTERSECT, 4);
        String expectedPath = TestUtils.DATA_DIR + "bed/isect_res.bed";
        FeatureSource expFeatureSource = TribbleFeatureSource.getFeatureSource(new ResourceLocator(expectedPath), genome);
        Iterator<Feature> expFeatures = expFeatureSource.getFeatures("chr1", 0, (int) 1e6);
        TestUtils.assertFeatureListsEqual(expFeatures, actFeatures.iterator());

    }
View Full Code Here

    @Test
    public void testMultiinterBED() throws Exception {
        String[] bedfiles = new String[]{"test.bed", "test2.bed", "isect_res.bed"};
        List<FeatureSource> sources = new ArrayList<FeatureSource>(bedfiles.length);
        for (String bedfile : bedfiles) {
            sources.add(TribbleFeatureSource.getFeatureSource(new ResourceLocator(TestUtils.DATA_DIR + "bed/" + bedfile), genome));
        }

        CombinedFeatureSource combinedFeatureSource = new CombinedFeatureSource(sources.toArray(new FeatureSource[0]),
                CombinedFeatureSource.Operation.MULTIINTER);
        Iterator<Feature> features = combinedFeatureSource.getFeatures("chr1", 0, (int) 1e6);
View Full Code Here

public class SegmentedReaderTest extends AbstractHeadlessTest {


    private SegmentedAsciiDataSet loadSegFile() throws Exception {
        String filePath = TestUtils.DATA_DIR + "seg/canFam2_hg18.seg";
        ResourceLocator locator = new ResourceLocator(filePath);
        SegmentedReader reader = new SegmentedReader(locator);
        SegmentedAsciiDataSet ds = reader.loadFromFile();

        assertEquals(18, ds.getChromosomes().size());
View Full Code Here

    private SegmentedAsciiDataSet loadSegDB() throws Exception {
        String host = (new File(TestUtils.DATA_DIR)).getAbsolutePath();
        String path = "seg/canFam2_hg18.db";
        String url = DBManager.createConnectionURL("sqlite", host, path, null);
        ResourceLocator locator = new ResourceLocator(url);
        String tableName = "canFam2";

        SegmentedReader reader = new SegmentedReader(locator);
        DBProfile.DBTable table = DBProfile.DBTable.build(locator, tableName);
        SegmentedAsciiDataSet ds = reader.loadFromDB(table);
View Full Code Here

    }

    @Test
    public void testLoadBEDNotIndexed() throws Exception {
        String filepath = TestUtils.DATA_DIR + "bed/intervalTest.bed";
        if (TrackLoader.isIndexed(new ResourceLocator(filepath), null)) {
            File f = new File(filepath + ".idx");
            f.delete();
        }
        tstLoadFi(filepath, 1, false);
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.