Package org.broad.igv.util

Examples of org.broad.igv.util.ResourceLocator


    }

    public static AlignmentDataManager getManager171() throws IOException {

        String infilepath = TestUtils.LARGE_DATA_DIR + "HG00171.hg18.bam";
        ResourceLocator locator = new ResourceLocator(infilepath);
        AlignmentDataManager manager = new AlignmentDataManager(locator, genome);
        return manager;
    }
View Full Code Here


     * Note that SAMFileReader (which is the non-caching reader) is 1-based
     * and inclusive-end. AlignmentIntervalLoader is 0-based and exclusive end.
     */
    public void tstQuery(String testFile, String sequence, int start, int end, boolean contained, int maxDepth) throws IOException {

        ResourceLocator loc = new ResourceLocator(testFile);
        AlignmentReader reader = AlignmentReaderFactory.getReader(loc);
        CloseableIterator<Alignment> iter = reader.query(sequence, start, end, contained);

        List<Alignment> expectedResult = new ArrayList<Alignment>();
        while (iter.hasNext()) {
View Full Code Here

public class WiggleParserTest extends AbstractHeadlessTest{

    @Test
    public void testParseBedgraph_onefeat() throws Exception {
        String filepath = TestUtils.DATA_DIR + "wig/test_coords.bedgraph";
        WiggleParser parser = new WiggleParser(new ResourceLocator(filepath));
        String chr = "chr1";
        WiggleDataset ds = parser.parse();
        assertArrayEquals(new String[]{chr}, ds.getChromosomes());
        assertEquals(1.0, ds.getDataMax(), 0.01);
        assertArrayEquals(new int[]{1}, ds.getStartLocations(chr));
View Full Code Here

    @Test
    public void testQueryLargeFile() throws Exception {
        PreferenceManager.getInstance().put(PreferenceManager.SAM_MAX_VISIBLE_RANGE, "5");
        String path = TestUtils.LARGE_DATA_DIR + "ABCD_igvSample.bam";

        ResourceLocator loc = new ResourceLocator(path);
        AlignmentDataManager manager = new AlignmentDataManager(loc, genome);

        //Edge location
        String sequence = "chr12";
        int start = 56815621 - 1;
View Full Code Here

    @Test
    public void testParseBedgraph_stats() throws Exception {

        String filepath = TestUtils.DATA_DIR + "wig/test_stats.bedgraph";
        WiggleParser parser = new WiggleParser(new ResourceLocator(filepath));

        String chr = "chr1";
        WiggleDataset ds = parser.parse();

        int len = 998;
View Full Code Here

    public void testQueryPiledUp() throws Exception {
        PreferenceManager.getInstance().put(PreferenceManager.SAM_MAX_VISIBLE_RANGE, "5");
        PreferenceManager.getInstance().put(PreferenceManager.SAM_DOWNSAMPLE_READS, "false");
        String path = TestUtils.DATA_DIR + "aligned/pileup.sorted.aligned";

        ResourceLocator loc = new ResourceLocator(path);
        AlignmentDataManager manager = new AlignmentDataManager(loc, genome);

        //Edge location
        String sequence = "chr1";
        int start = 141 - 1;
View Full Code Here

    @Ignore
    @Test
    public void testQueryLargeFile2() throws Exception {
        String path = "http://1000genomes.s3.amazonaws.com/data/NA12878/high_coverage_alignment/NA12878.mapped.ILLUMINA.bwa.CEU.high_coverage_pcr_free.20130520.bam";

        ResourceLocator loc = new ResourceLocator(path);

        String sequence = "chrM";
        int start = 0;
        int end = 200;
View Full Code Here

    @Test
    public void testWithPadding() throws Exception{
        String filepath = TestUtils.DATA_DIR + "sam/has_padding.sam";
        TestUtils.createIndex(filepath);

        AlignmentDataManager manager = new AlignmentDataManager(new ResourceLocator(filepath), genome);
        AlignmentInterval interval = manager.loadInterval("chr22", 0, Integer.MAX_VALUE, null);
        Iterator<Alignment> iter = interval.getAlignmentIterator();
        while(iter.hasNext()){
            Alignment al = iter.next();
            assertNotNull(al);
View Full Code Here

     */
    @Test
    public void testAfterBAMRemoved() throws Exception {
        int startingNumTracks = igv.getAllTracks().size();
        String bamPath = TestUtils.LARGE_DATA_DIR + "HG00171.hg18.bam";
        Collection<ResourceLocator> locators = Arrays.asList(new ResourceLocator(bamPath));
        igv.loadResources(locators);
        List<Track> tracks = igv.getAllTracks();
        assertEquals(startingNumTracks + 2, tracks.size());

        String startLocString = "chr1:151666494-151666594";
View Full Code Here

     */
    @Test
    public void testDataset() {


        IGVDataset ds = new IGVDataset(new ResourceLocator(cnFile), genome);

        // Get the start locations and data from sample yw280-4_44 on chr 1
        int[] startLocations = ds.getStartLocations("chr1");
        float[] data = ds.getData("yw280-4_44", "chr1");
        assertEquals(startLocations.length, data.length);
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.