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));
}
}
Aggregations