Search in sources :

Example 6 with GeneCoexpressionNodeDegreeValueObject

use of ubic.gemma.model.association.coexpression.GeneCoexpressionNodeDegreeValueObject in project Gemma by PavlidisLab.

the class CoexpressionServiceImpl method updateNodeDegree.

private void updateNodeDegree(Gene g, TreeMap<Integer, Map<Long, Integer>> forRanksPos, TreeMap<Integer, Map<Long, Integer>> forRanksNeg) {
    GeneCoexpressionNodeDegreeValueObject updatedVO = this.updateNodeDegree(g);
    if (CoexpressionServiceImpl.log.isDebugEnabled())
        CoexpressionServiceImpl.log.debug(updatedVO.toString());
    /*
         * Positive
         */
    Long id = updatedVO.getGeneId();
    for (Integer i = 0; i < updatedVO.asIntArrayPos().length; i++) {
        if (!forRanksPos.containsKey(i)) {
            forRanksPos.put(i, new HashMap<Long, Integer>());
        }
        // note this is the cumulative value.
        assert !forRanksPos.get(i).containsKey(id);
        forRanksPos.get(i).put(id, updatedVO.getLinksWithMinimumSupport(i, true));
    }
    /*
         * Negative
         */
    for (Integer i = 0; i < updatedVO.asIntArrayNeg().length; i++) {
        if (!forRanksNeg.containsKey(i)) {
            forRanksNeg.put(i, new HashMap<Long, Integer>());
        }
        // note this is the cumulative value.
        assert !forRanksNeg.get(i).containsKey(id);
        forRanksNeg.get(i).put(id, updatedVO.getLinksWithMinimumSupport(i, false));
    }
}
Also used : GeneCoexpressionNodeDegreeValueObject(ubic.gemma.model.association.coexpression.GeneCoexpressionNodeDegreeValueObject)

Aggregations

GeneCoexpressionNodeDegreeValueObject (ubic.gemma.model.association.coexpression.GeneCoexpressionNodeDegreeValueObject)6 Gene (ubic.gemma.model.genome.Gene)3 Transactional (org.springframework.transaction.annotation.Transactional)2 GeneCoexpressionNodeDegree (ubic.gemma.model.association.coexpression.GeneCoexpressionNodeDegree)2 StopWatch (org.apache.commons.lang3.time.StopWatch)1 Test (org.junit.Test)1 SearchResult (ubic.gemma.core.search.SearchResult)1 PhenotypeAssociation (ubic.gemma.model.association.phenotype.PhenotypeAssociation)1 SearchSettingsImpl (ubic.gemma.model.common.search.SearchSettingsImpl)1 Taxon (ubic.gemma.model.genome.Taxon)1 CharacteristicValueObject (ubic.gemma.model.genome.gene.phenotype.valueObject.CharacteristicValueObject)1 CoexpressionValueObject (ubic.gemma.persistence.service.association.coexpression.CoexpressionValueObject)1