Package org.broad.igv.feature.genome

Examples of org.broad.igv.feature.genome.Genome


        this.record = record;

        this.flags = record.getFlags();

        String refName = record.getReferenceName();
        Genome genome = GenomeManager.getInstance().getCurrentGenome();
        this.chr = genome == null ? refName : genome.getChromosomeAlias(refName);

        // SAMRecord is 1 based inclusive.  IGV is 0 based exclusive.

        this.end = record.getAlignmentEnd();   // might be modified later for soft clipping
        this.start = record.getAlignmentStart() - 1;   // might be modified later for soft clipping


        if (record.getReadPairedFlag()) {
            String mateReferenceName = record.getMateReferenceName();
            String mateChr = genome == null ? mateReferenceName : genome.getChromosomeAlias(mateReferenceName);
            this.setMate(new ReadMate(mateChr,
                    record.getMateAlignmentStart() - 1,
                    record.getMateNegativeStrandFlag(),
                    record.getMateUnmappedFlag()));
        }
View Full Code Here


        int zoom = context.getZoom();

        try {
            featuresLoading = true;
            int maxEnd = end;
            Genome genome = GenomeManager.getInstance().getCurrentGenome();

            String queryChr = chr;
            if (genome != null) {
                queryChr = genome.getChromosomeAlias(chr);
                Chromosome c = genome.getChromosome(chr);
                if (c != null) maxEnd = Math.max(c.getLength(), end);
            }

            // Expand interval +/- 50%, unless in a multi-locus mode with "lots" of frames
            boolean multiLocus = FrameManager.isExomeMode() || (FrameManager.getFrames().size() > 4);
View Full Code Here

            GenomeManager.getInstance().clearGenomeCache();

            String genomeURL = LoadFromServerAction.getGenomeDataURL(genomeItem.getId());

            TrackLoader loader = new TrackLoader();
            Genome curGenome = null;
            try {
                curGenome = GenomeManager.getInstance().loadGenome(genomeItem.getLocation(), null);
            } catch (IOException e) {
                recordError(new ResourceLocator(genomeItem.getLocation()), e, failedFiles);
                continue;
            }

            errorWriter.println("Genome: " + curGenome.getId());

            try {
                nodeURLs = LoadFromServerAction.getNodeURLs(genomeURL);
                if (nodeURLs == null) {
                    errorWriter.println("Warning: No Data found for " + genomeURL);
View Full Code Here

        assertEquals(0, failedGenomes.size());
    }

    public void tstLoadGenome(String path) throws Exception {
        FeatureDB.clearFeatures();
        Genome genome = GenomeManager.getInstance().loadGenome(path, null);
        assertTrue(genome.getAllChromosomeNames().size() > 0);
    }
View Full Code Here

    public void testColumnCounts() throws Exception {
        String ifile = TestUtils.DATA_DIR + "sam/NA12878.muc1.test.sam";

        File wigFile = null;
        Genome genome = this.genome;
        int[] windowSizes = new int[]{1, 50, 100, 500};
        //All possible combinations of STRAND_XXX flags
        int[] strandops = new int[2];
        strandops[0] = 0;
        strandops[1] = CoverageCounter.STRANDS_BY_READ;
View Full Code Here

        String bamURL = "http://www.broadinstitute.org/igvdata/BodyMap/hg18/Merged/HBM.adipose.bam.sorted.bam";
        int options = CoverageCounter.INCLUDE_DUPS;
        String queryString = "chr1:153425249-153425249";
        int windowSize = 1;
        File wigFile = null;
        Genome genome = null;

        TestDataConsumer dc = new TestDataConsumer();

        CoverageCounter cc = new CoverageCounter(bamURL, dc, windowSize, 0, wigFile, genome, queryString, 0, options);
View Full Code Here

        File oFile = new File(outputFile);
        oFile.deleteOnExit();

        String input = "formatexp " + inputFile + " " + outputFile;
        igvTools.run(input.split("\\s+"));
        Genome genome = TestUtils.loadGenome();

        ExpressionFileParser parser = new ExpressionFileParser(new ResourceLocator(outputFile), null, genome);
        Dataset ds = parser.createDataset();
        assertEquals(10, ds.getChromosomes().length);
    }
View Full Code Here

    }

    @Test
    public void testGffTags() throws Exception {
        String bedFile = TestUtils.DATA_DIR + "bed/gene.bed";
        Genome genome = TestUtils.loadGenome();

        FeatureCodec codec1 = CodecFactory.getCodec(bedFile, genome);
        assertTrue(codec1 instanceof IGVBEDCodec);
        IGVBEDCodec codec = (IGVBEDCodec) codec1;
View Full Code Here

    @Test
    public void testFilesHeaded() throws Exception {

        String ex_filename = "/vcf/example4-last-gsnap-2_fixed.vcf";
        Genome genome = TestUtils.loadGenome();
        List<String> finames = new ArrayList<String>(Arrays.asList(TrackLoaderTest.filenamesTryIndex));

        finames.add(ex_filename);

        for (String finame : finames) {
View Full Code Here

        igvTools.run(cmd_withdups.split("\\s+"));

        assertTrue((new File(outputFileND).exists()));
        assertTrue((new File(outputFileWithDup).exists()));

        Genome genome = TestUtils.loadGenome();

        //Have to read back in using aliased chromosome names
        String readChr = genome.getChromosomeAlias(queryChr);

        int noDupCount = (int) getCount(outputFileND, readChr, 23, pos, genome);
        int dupCount = (int) getCount(outputFileWithDup, readChr, 23, pos, genome);

        assertEquals(noDupCount + 4, dupCount);
View Full Code Here

TOP

Related Classes of org.broad.igv.feature.genome.Genome

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.