Package org.broad.igv.util

Examples of org.broad.igv.util.ResourceLocator


        String lastHeading = "DN30_3_03";
        String headingsLine = "SNP  Chromosome  PhysicalPosition  yw280-4_44  yw280-4_48  yw280-5_40  yw280-5_41  yw280-5_42  yw280-5_43  yw280-5_44  yw280-5_46  yw280-5_47  yw280-5_48  yw280-5_45  DN30_01  DN30_02  DN30_03  DN30_04  DN30_06  DN30_07  DN30_09  DN30_10  DN30_11  DN30_13  DN30_14  DN30_15  DN30_16  DN30_17  DN30_18  DN30_19  DN30_20  DN30_21  DN30_32  DN30_33  DN30_34  DN30_35  DN30_36  DN30_41  DN30_42  DN30_43  DN30_44  DN30_45  DN30_46  DN30_47  DN30_48  DN30_3_02  DN30_3_03";

        String[] tokens = headingsLine.split("\t");

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

        //parser.scan necessary to set values needed in getHeadings
        List<ChromosomeSummary> summaries = parser.scan(ds);
        String[] headings = parser.getHeadings(tokens, 1);
View Full Code Here


     * Test of scan method. Test that we find
     * all chromosomes we expect
     */
    @Test
    public void testScanDataset() {
        IGVDataset ds = new IGVDataset(new ResourceLocator(cnFile), genome);
        IGVDatasetParser parser = new IGVDatasetParser(new ResourceLocator(cnFile), genome);
        List<ChromosomeSummary> summaries = parser.scan(ds);

        assertEquals(24, summaries.size());
        Set<String> chromos = new TreeSet<String>();
        ArrayList<String> chromos_L = new ArrayList<String>(24);
View Full Code Here

     * @param segFile
     * @param outputFile
     */
    static void segToDB(String segFile, String outputFile) throws IOException {

        ResourceLocator loc = new ResourceLocator(segFile);
        SegmentedAsciiDataSet ds = new SegmentedAsciiDataSet(loc, null);
        SegmentFileParser parser = new SegmentFileParser(loc);
        parser.loadSegments(loc, null);

        Map<String, String> sampleMap = loadSampleMappings("http://www.broadinstitute.org/igvdata/tcga/gbmsubtypes/cn.sampleMappings.txt");
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)) {
View Full Code Here

        TrackLoader loader = new TrackLoader();
        String[] paths = new String[]{TestUtils.DATA_DIR + "bed/test.bed", TestUtils.DATA_DIR + "bed/testAlternateColor.bed"};
        for (String path : paths) {
            TestUtils.createIndex(path);
            FeatureTrack track = (FeatureTrack) loader.load(new ResourceLocator(path), genome).get(0);
            arguments.put(argumentList.get(argnum++), track);
        }


        List<String> cmd = Arrays.asList(reader.getToolPath(tool), command.cmd);
View Full Code Here

public class MutationTrackLoaderTest extends AbstractHeadlessTest {
    @Test
    public void testLoadMutationTrackGZ() throws Exception {
        String testPath = TestUtils.DATA_DIR + "maf/TCGA_GBM_Level3_Somatic_Mutations_08.28.2008.maf.gz";
        MutationTrackLoader parser = new MutationTrackLoader();
        List<FeatureTrack> trackList = parser.loadMutationTracks(new ResourceLocator(testPath), genome);

        String testSampleId = "TCGA-02-0024-01B-01W";
        String testChr = "chr12";
        int testStart = 9150104 - 1;
        int testEnd = testStart + 1;
View Full Code Here

        Genome genome = TestUtils.loadGenome();

        String segfile = TestUtils.DATA_DIR + "seg/canFam2_hg18.seg";


        SegmentedDataSet sd = new SegmentedAsciiDataSet(new ResourceLocator(segfile), genome);

        FreqData fd = new FreqData(sd, genome);
    }
View Full Code Here

    }


    public void testExomeView() throws Exception {
        String file = "http://www.broadinstitute.org/igvdata/1KG/pilot2Bams/NA12891.SLX.bam";
        List<Track> tracks = IGV.getInstance().load(new ResourceLocator(file));
        Thread.sleep(10000);
        //TestUtils.loadSession(igv, TestUtils.DATA_DIR + "sessions/slx_ceu_father.xml");

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

    public void testCopyBAMFile_01() throws Exception{
        String sequence = "chr1";
        int end = 300000000;
        int start = end / 5 - 1;
        String inpath = TestUtils.LARGE_DATA_DIR + "HG00171.hg18.bam";
        ResourceLocator inlocator = new ResourceLocator(inpath);
        tstCopyBAMFile(inlocator, sequence, start, end);
    }
View Full Code Here

        int start = 151667156;
        int end = start + 10000;

        File listFile = new File(TestUtils.LARGE_DATA_DIR, "2largebams.bam.list");
        MergedAlignmentReaderTest.generateRepLargebamsList(listFile);
        ResourceLocator inlocator = new ResourceLocator(listFile.getAbsolutePath());
        tstCopyBAMFile(inlocator, sequence, start, end);
    }
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.