YuLab-SMU / GOSemSim

:golf: GO-terms Semantic Similarity Measures
https://yulab-smu.top/biomedical-knowledge-mining-book/
58 stars 26 forks source link

Speed up #13

Closed llrs closed 7 years ago

llrs commented 7 years ago

I improved a the speed of mgeneSim and mclusterSim by

  1. avoiding recalculating twice the same position: They previously assigned scores[i, j] to scores[j, i] but it calculate it twice, now the second loop does just one triangle.
  2. Pre-calculating the GO similarity: They used to calculate the similarity between two go terms each time it was needed, now it calculates the similarity only once, so it speeds up the process for large comparisons.

I also changed two prints in goData to two messages for the user.

codecov-io commented 7 years ago

Codecov Report

Merging #13 into master will not change coverage. The diff coverage is 5.88%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #13   +/-   ##
=======================================
  Coverage   33.65%   33.65%           
=======================================
  Files          16       16           
  Lines         410      410           
=======================================
  Hits          138      138           
  Misses        272      272
Impacted Files Coverage Δ
R/mclusterSim.R 0% <0%> (ø) :arrow_up:
R/mgeneSim.R 0% <0%> (ø) :arrow_up:
R/godata.R 78.57% <50%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ae0c37e...1e94999. Read the comment docs.

GuangchuangYu commented 7 years ago

I added your name in the author list as contributor: https://github.com/GuangchuangYu/GOSemSim/blob/master/DESCRIPTION#L8.

Thanks for the PR.