Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correlation networks #256

Merged
merged 14 commits into from
Apr 26, 2024
Merged

Correlation networks #256

merged 14 commits into from
Apr 26, 2024

Conversation

d-callan
Copy link
Contributor

in an effort to get to a place where we can filter our networks here based on correlation coef and pvalue, weve introduced some dedicated classes for networks specifically representing correlations.

@d-callan d-callan marked this pull request as ready for review April 25, 2024 02:02
@d-callan d-callan requested a review from asizemore April 25, 2024 02:02
@d-callan
Copy link
Contributor Author

hmmmm. not sure i added the thresholds used to the response yet..

Copy link
Member

@asizemore asizemore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally good, but i have two larger comments

  1. Can you please explain the value of the extra BaseNetwork class? I don't follow why CorrelationNetwork can't just inherit from Network
  2. I'd like to voice my general disdain for functions with argument names "object" or "x" and are more than 4 lines long :) It makes the code so much harder to follow for me.

R/class-CorrelationLink.R Show resolved Hide resolved
R/class-CorrelationLink.R Outdated Show resolved Hide resolved
R/class-CorrelationLink.R Show resolved Hide resolved
R/class-CorrelationLink.R Outdated Show resolved Hide resolved
linkColorScheme <- veupathUtils::matchArg(linkColorScheme)

if (!inherits(isValidEdgeList(object), "logical")) {
stop(paste("Invalid edgeList:", isValidEdgeList(object), collapse = '\n'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"edgeList" should be "linkList"? I think we're generally using "link" instead of edge, but i may be misremembering.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is gonna sound stupid, bc it is.. but for some reason i dont like the way linkList looks or sounds

R/class-Network.R Show resolved Hide resolved
R/class-Network.R Show resolved Hide resolved
R/methods-CorrelationNetwork.R Outdated Show resolved Hide resolved
R/methods-CorrelationNetwork.R Outdated Show resolved Hide resolved
tests/testthat/test-correlation-network.R Outdated Show resolved Hide resolved
@d-callan
Copy link
Contributor Author

Can you please explain the value of the extra BaseNetwork class? I don't follow why CorrelationNetwork can't just inherit from Network

Network has type LinkList for its links slot, and we want CorrelationLinkList specifically for a CorrelationNetwork. this strategy guarantees us that. BaseNetwork, bc it inherits from VIRTUAL, is not implementable. it serves only as a thing to hang other classes and relevant methods etc off of.

I'd like to voice my general disdain for functions with argument names "object" or "x" and are more than 4 lines long :) It makes the code so much harder to follow for me.

yea. it bothers me sometimes too.. unfortunately the arg/ docs i think have to keep saying 'object' or similar for the case of the S4 methods... but we could rapidly rename them within the methods maybe in the future..

@d-callan d-callan merged commit 6df5b39 into main Apr 26, 2024
5 checks passed
@d-callan d-callan deleted the correlation-networks branch April 26, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants