Examples of BasicFeature


Examples of org.broad.igv.feature.BasicFeature

        assertEquals(parserFeats.size(), sourceFeats.size());

        int sF = 0;
        for (Feature f : parserFeats) {
            BasicFeature sourceFeat = (BasicFeature) sourceFeats.get(sF);
            BasicFeature bf = (BasicFeature) f;
            assertEquals(bf.getExonCount(), sourceFeat.getExonCount());
            assertEquals(bf.getIdentifier(), sourceFeat.getIdentifier());
            sF++;
        }
    }
View Full Code Here

Examples of org.broad.igv.feature.BasicFeature


            //Feature feat = features.next();
            assertEquals(chr, feat.getChr());

            BasicFeature bf = (BasicFeature) feat;

            String id = bf.getIdentifier().toLowerCase();
            if (id.contains("gene")) geneCount++;
            if (id.contains("rna")) rnaCount++;

            if ("gene21".equals(id)) {
                assertEquals(0, bf.getExonCount());
                assertEquals("gene", bf.getType());
            }
            if ("rna22".equals(id)) {
                assertEquals(6, bf.getExonCount());
                assertEquals("mRNA", bf.getType());
            }
        }
        assertEquals(2, geneCount);
        assertEquals(2, rnaCount);
View Full Code Here

Examples of org.broad.igv.feature.BasicFeature

    }

    @Test
    public void testInsertFeature() throws Exception{
        MongoCollabPlugin.Locator locator = assumeTestDBRunning();
        BasicFeature feat = new BasicFeature("chromo", 50, 100);
        //Set name/desc which look like colors, to make sure color parsing isn't activated
        feat.setColor(Color.magenta);
        feat.setName("0,1,2");
        feat.setDescription("mydescription,is,here");
        DBFeature dbFeat = DBFeature.create(feat);

        assertNull(dbFeat.get_id());

        DBCollection coll = MongoCollabPlugin.getCollection(locator);
View Full Code Here

Examples of org.broad.igv.feature.BasicFeature

    }

    private NamedFeature getUnigeneTestFeature(){
        //Note the cases are incorrect, want to make sure matching is case-insensitive
        BasicFeature testFeat = new BasicFeature("chr2", 179908392, 179909870);
        testFeat.setName("hs.516555");
        return testFeat;
    }
View Full Code Here

Examples of org.broad.igv.feature.BasicFeature

    public void testLoadUCSCFromProfileSNP() throws Exception {
        SQLCodecSource source = tstLoadFromProfile(profilePath, "snp126");
        Iterator<Feature> feats = source.getFeatures("chr2", 10000, 100000);
        int count = 0;
        while (feats.hasNext()) {
            BasicFeature f = (BasicFeature) feats.next();
            assertEquals(0.0f, f.getScore());
            assertFalse(f.hasExons());
            assertNotSame(Strand.NONE, f.getStrand());
            count++;
        }

        assertTrue(count > 0);
    }
View Full Code Here

Examples of org.broad.igv.feature.BasicFeature

    public BasicFeature decode(EmblTableIterator s) throws IOException {

        EmblRecord emblRecord = s.next();
        if(emblRecord == null) return null;

        BasicFeature feature = new BasicFeature(emblRecord.getChromosome(), emblRecord.getStart(),
                emblRecord.getEnd());
        feature.setType(emblRecord.getType());
        feature.setIdentifier(emblRecord.getIdentifier());
        feature.setName(emblRecord.getIdentifier());
        feature.setStrand(emblRecord.getStrand());
        feature.setDescription(emblRecord.getDescription());
        if (emblRecord.getAlias() != null) {
            feature.setName(emblRecord.getAlias());
        }

        // If this is a "gene part" add the exons
        for (Exon exon : emblRecord.getExons()) {
            feature.addExon(exon);
        }

        return feature;
    }
View Full Code Here

Examples of org.broad.igv.feature.BasicFeature

            return decodeLegacy(tokens);
        }
        String chr = genome == null ? tokens[5] : genome.getChromosomeAlias(tokens[5]);
        int start = Integer.parseInt(tokens[6]);
        int end = Integer.parseInt(tokens[7]);
        return new BasicFeature(chr, start, end);
    }
View Full Code Here

Examples of org.broad.igv.feature.BasicFeature

        }

        String chr = genome == null ? tokens[5] : genome.getChromosomeAlias(tokens[5]);
        int start = Integer.parseInt(tokens[6]);
        int end = Integer.parseInt(tokens[7]);
        BasicFeature feature = new BasicFeature(chr, start, end);

        String strandString = tokens[3].trim();
        char strand = (strandString.length() == 0) ? ' ' : strandString.charAt(0);
        if (strand == '-') {
            feature.setStrand(Strand.NEGATIVE);
        } else if (strand == '+') {
            feature.setStrand(Strand.POSITIVE);
        } else {
            feature.setStrand(Strand.NONE);
        }
        String name = tokens[10];
        feature.setName(name);
        feature.setIdentifier(name);

        MultiMap<String, String> attributes = new MultiMap<String, String>();
        attributes.put("Smith Waterman score", tokens[1]);
        attributes.put("base mismatches per thousand", tokens[2]);
        attributes.put("bases deleted per thousand", tokens[3]);
        attributes.put("bases inserted per thousand", tokens[4]);
        attributes.put("repeat class", tokens[11]);
        attributes.put("repeat family", tokens[12]);
        attributes.put("repeat start", tokens[13]);
        attributes.put("repeat end", tokens[14]);
        feature.setAttributes(attributes);

        return feature;
    }
View Full Code Here

Examples of org.broad.igv.feature.BasicFeature

        int end = start + 1;
        if (tokenCount > 2) {
            end = Integer.parseInt(tokens[2]);
        }

        BasicFeature feature = new BasicFeature(chr, start, end);

        // The rest of the columns are optional.  Stop parsing upon encountering
        // a non-expected value

        // Strand
        if (tokenCount > 3) {
            String strandString = tokens[3].trim();
            char strand = (strandString.length() == 0) ? ' ' : strandString.charAt(0);

            if (strand == '-') {
                feature.setStrand(Strand.NEGATIVE);
            } else if (strand == '+') {
                feature.setStrand(Strand.POSITIVE);
            } else {
                feature.setStrand(Strand.NONE);
            }
        }

        // Name
        if (tokenCount > 4) {
            String name = tokens[4].replaceAll("\"", "");
            feature.setName(name);
            feature.setIdentifier(name);
        }


        return feature;
    }
View Full Code Here

Examples of org.broad.igv.feature.BasicFeature

            } else if (strandString.trim().equals("-")) {
                strand = Strand.NEGATIVE;
            }
        }

        BasicFeature gene = new BasicFeature(chr, start, end, strand);

        gene.setName(name);
        gene.setIdentifier(identifier);

        if (tokenCount > 7) {
            gene.setThickStart(Integer.parseInt(tokens[6]));
            gene.setThickEnd(Integer.parseInt(tokens[7]));
        }

        // Coding information is optional
        if (tokenCount > 8) {
            createExons(tokens, tokenCount, gene, chr, strand);
        }

        // Optional standard name column
        if (tokenCount > 16) {
            gene.setAttribute("Standard Name", tokens[16]);
        }

        return gene;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.