Examples of NamedFeature


Examples of au.csiro.ontology.model.NamedFeature

            return new Conjunction(result);
        }
    }

    protected void addDatatype(final List<Concept> result, au.csiro.snorocket.core.model.Datatype datatype) {
        Feature feature = new NamedFeature(factory.lookupFeatureId(datatype.getFeature()));
        Operator operator = Operator.EQUALS;
        Literal literal;
        if (datatype.getLiteral() instanceof DecimalLiteral) {
            literal = new au.csiro.ontology.model.DecimalLiteral(((DecimalLiteral) datatype.getLiteral()).getValue());
        } else if (datatype.getLiteral() instanceof IntegerLiteral) {
View Full Code Here

Examples of au.csiro.ontology.model.NamedFeature

            Datatype d = (Datatype) o;
            String feature = factory.lookupFeatureId(d.getFeature());
            AbstractLiteral literal = d.getLiteral();
           
            if(literal instanceof DateLiteral) {
                return new au.csiro.ontology.model.Datatype(new NamedFeature(feature), d.getOperator(),
                        new au.csiro.ontology.model.DateLiteral(((DateLiteral) literal).getValue()));
            } else if(literal instanceof DecimalLiteral) {
                return new au.csiro.ontology.model.Datatype(new NamedFeature(feature), d.getOperator(),
                        new au.csiro.ontology.model.DecimalLiteral(((DecimalLiteral) literal).getValue()));
            } else if(literal instanceof IntegerLiteral) {
                return new au.csiro.ontology.model.Datatype(new NamedFeature(feature), d.getOperator(),
                        new au.csiro.ontology.model.IntegerLiteral(((IntegerLiteral) literal).getValue()));
            } else if(literal instanceof StringLiteral) {
                return new au.csiro.ontology.model.Datatype(new NamedFeature(feature), d.getOperator(),
                        new au.csiro.ontology.model.StringLiteral(((StringLiteral) literal).getValue()));
            } else {
                throw new RuntimeException("Unexpected literal " + literal.getClass().getName());
            }
           
View Full Code Here

Examples of org.broad.igv.feature.NamedFeature

    @Test
    public void testGetFeaturesByName() throws Exception{

        setupUnigene();
        NamedFeature testFeat = getUnigeneTestFeature();

        Collection<? extends NamedFeature> features = this.source.search(testFeat.getName(), 0);
        List<? extends NamedFeature> list = Lists.newArrayList(features);

        assertEquals(1, list.size());
        NamedFeature resFeat = list.get(0);

        TestUtils.assertNamedFeaturesEqual(testFeat, resFeat);
    }
View Full Code Here

Examples of org.broad.igv.feature.NamedFeature

    }

    @Test
    public void testSearchCommand() throws Exception{
        setupUnigene();
        NamedFeature testFeat = getUnigeneTestFeature();

        //Need to call this to attach listener
        MongoFeatureSource.loadFeatureTrack(MongoCollabPluginTest.getTestLocator(), new ArrayList<Track>());

        String searchStr = testFeat.getName();
        SearchCommand cmd = new SearchCommand(null, searchStr, false);
        List<SearchCommand.SearchResult> list = cmd.runSearch(searchStr);

        assertEquals(1, list.size());
        SearchCommand.SearchResult result = list.get(0);

        assertEquals(SearchCommand.ResultType.FEATURE, result.getType());
        NamedFeature resFeat = result.getFeature();

        TestUtils.assertNamedFeaturesEqual(testFeat, resFeat);
    }
View Full Code Here

Examples of org.broad.igv.feature.NamedFeature

                    continue;
                } else {
                    identifier = identifiers[0];
                }

                NamedFeature gene = FeatureDB.getFeature(identifier.toUpperCase());
                if (gene == null) {
                    log.debug("Unknown identifier: " + identifier);
                    continue;
                }

                for (int i = 0; i < nColumns; i++) {
                    try {
                        int dataIndex = dataStartColumn + i * skip;

                        // If we are out of value tokens, or the cell is blank, assign NAN to the cell.
                        if ((dataIndex >= nTokens) || (tokens[dataIndex].length() == 0)) {
                            values[i] = Float.NaN;
                        } else {
                            values[i] = Float.parseFloat(tokens[dataIndex]);
                        }

                        String sample = columnHeadings[i];
                        RNAIHairpinValue hairpin = new RNAIHairpinValue(probeId, values[i]);
                        RNAIHairpinCache.getInstance().addHairpinScore(sample, gene.getName(),
                                hairpin);

                        HashMap<String, Float> geneScoreMap = sampleGeneScoreMap.get(sample);

                        if (geneScoreMap == null) {
                            geneScoreMap = new HashMap();
                            sampleGeneScoreMap.put(sample, geneScoreMap);
                        }

                        Float geneScore = geneScoreMap.get(gene.getName());
                        if (geneScore == null) {
                            geneScore = values[i];
                            geneScoreMap.put(gene.getName(), geneScore);
                        } else {

                            geneScore = new Float(Math.min(values[i], geneScore.floatValue()));
                            geneScoreMap.put(gene.getName(), geneScore);
                        }
                    } catch (NumberFormatException numberFormatException) {

                        // This is an expected condition.  IGV uses NaN to
                        // indicate non numbers (missing data values)
View Full Code Here

Examples of org.broad.igv.feature.NamedFeature

                String[] tokens = nextLine.split("\t");
                if (tokens.length > maxColumn) {
                    try {
                        String batchId = (batchColumn < 0) ? "" : tokens[batchColumn].trim();
                        String geneName = tokens[geneColumn].trim().toUpperCase();
                        NamedFeature gene = FeatureDB.getFeature(geneName);

                        if (gene != null) {
                            float geneScore = Float.NaN;
                            try {
                                geneScore = Float.parseFloat(tokens[scoreColumn]);
View Full Code Here

Examples of org.broad.igv.feature.NamedFeature

        // Convert the loci strings to a list of loci, if the loci represents multiple features (e.g. isoforms) use the largest
        int averageFeatureSize = 0;
        List<NamedFeature> loci = new ArrayList<NamedFeature>(lociStrings.size());
        for (String l : lociStrings) {
            NamedFeature feature = FeatureDB.getFeature(l);
            if (feature == null) {
                feature = Locus.fromString(l);
            }
            if (feature != null) {
                loci.add(feature);
                averageFeatureSize += (feature.getEnd() - feature.getStart());
            }
        }
        if (loci.size() > 0) averageFeatureSize /= loci.size();

        // Determine data types -- all data tracks + mutation, and samples
View Full Code Here

Examples of org.togglz.core.util.NamedFeature

        return isActive ? Tag.EVAL_BODY_INCLUDE : Tag.SKIP_BODY;
    }

    protected boolean isFeatureActive() {
        if (Strings.isNotBlank(name)) {
            return featureManager.isActive(new NamedFeature(name));
        }
        return false;
    }
View Full Code Here

Examples of org.togglz.core.util.NamedFeature

        for (Entry<Object, Object> entry : properties.entrySet()) {

            String name = entry.getKey().toString();
            String spec = entry.getValue().toString();

            NamedFeature feature = new NamedFeature(name);

            features.add(feature);
            metadata.put(name, new PropertyFeatureMetaData(feature, spec));

        }
View Full Code Here

Examples of org.togglz.core.util.NamedFeature

        delegate = Mockito.mock(StateRepository.class);
        // the mock supports the ENUM
        Mockito.when(delegate.getFeatureState(DummyFeature.TEST))
            .thenReturn(new FeatureState(DummyFeature.TEST, true));
        // and NamedFeature
        Mockito.when(delegate.getFeatureState(new NamedFeature("TEST")))
            .thenReturn(new FeatureState(DummyFeature.TEST, true));
    }
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.