-
Notifications
You must be signed in to change notification settings - Fork 24
Param tuning code integration:no param tuning #208
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
Open
ntalluri
wants to merge
11
commits into
Reed-CompBio:main
Choose a base branch
from
ntalluri:param-tuning-no-param-tuning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d2da12b
updated ml back to og
ntalluri e80d124
updated snakemake file to only include no param tuning
ntalluri a1e69db
updated test cases to be for no param tuning
ntalluri 38b6f54
keep precision and recall only in evaluate.py
ntalluri 00e3182
reverted expected pca coordinates and precommit
ntalluri 98f6cdb
merge from master
ntalluri 0ca4964
update evaluation.py to be up to date
ntalluri b483be7
readd evaluation tests
ntalluri 6a3e533
update snakefile and updated test cases
ntalluri 61e7839
fix error, add plt.close
ntalluri 7be0c78
add in color palette
ntalluri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/evaluate/expected/expected-precision-recall-per-pathway-empty.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Pathway Precision Recall | ||
test/evaluate/input/data-test-params-empty/pathway.txt 0.0 0.0 |
1 change: 1 addition & 0 deletions
1
test/evaluate/expected/expected-precision-recall-per-pathway-nothing.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
5 changes: 5 additions & 0 deletions
5
test/evaluate/expected/expected-precision-recall-per-pathway.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Pathway Precision Recall | ||
test/evaluate/input/data-test-params-456/pathway.txt 0.0 0.0 | ||
test/evaluate/input/data-test-params-empty/pathway.txt 0.0 0.0 | ||
test/evaluate/input/data-test-params-123/pathway.txt 0.6666666666666666 0.6666666666666666 | ||
test/evaluate/input/data-test-params-789/pathway.txt 1.0 1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Node1 Node2 Rank Direction | ||
A B 1 U | ||
B C 1 U |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Node1 Node2 Rank Direction | ||
F L 1 U |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Node1 Node2 Rank Direction | ||
A B 1 U | ||
B Q 1 U |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Node1 Node2 Rank Direction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
NODEID | ||
A | ||
B | ||
Q |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import filecmp | ||
from pathlib import Path | ||
|
||
import pandas as pd | ||
import pytest | ||
|
||
import spras.analysis.ml as ml | ||
from spras.evaluation import Evaluation | ||
|
||
INPUT_DIR = 'test/evaluate/input/' | ||
OUT_DIR = 'test/evaluate/output/' | ||
EXPECT_DIR = 'test/evaluate/expected/' | ||
NODE_TABLE = pd.read_csv(INPUT_DIR + "node_table.csv", header=0) | ||
class TestEvaluate: | ||
@classmethod | ||
def setup_class(cls): | ||
""" | ||
Create the expected output directory | ||
""" | ||
Path(OUT_DIR).mkdir(parents=True, exist_ok=True) | ||
|
||
def test_precision_recall_per_pathway(self): | ||
file_paths = [INPUT_DIR + "data-test-params-123/pathway.txt", INPUT_DIR + "data-test-params-456/pathway.txt", INPUT_DIR + "data-test-params-789/pathway.txt", INPUT_DIR + "data-test-params-empty/pathway.txt"] | ||
algorithms = ["test"] | ||
output_file = OUT_DIR + "test-precision-recall-per-pathway.txt" | ||
output_png = OUT_DIR + "test-precision-recall-per-pathway.png" | ||
|
||
Evaluation.precision_and_recall(file_paths, NODE_TABLE, algorithms, output_file, output_png) | ||
assert filecmp.cmp(output_file, EXPECT_DIR + 'expected-precision-recall-per-pathway.txt', shallow=False) | ||
|
||
def test_precision_recall_per_pathway_empty(self): | ||
|
||
file_paths = [INPUT_DIR + "data-test-params-empty/pathway.txt"] | ||
algorithms = ["test"] | ||
output_file = OUT_DIR +"test-precision-recall-per-pathway-empty.txt" | ||
output_png = OUT_DIR + "test-precision-recall-per-pathway-empty.png" | ||
|
||
Evaluation.precision_and_recall(file_paths, NODE_TABLE, algorithms, output_file, output_png) | ||
assert filecmp.cmp(output_file, EXPECT_DIR + 'expected-precision-recall-per-pathway-empty.txt', shallow=False) | ||
|
||
def test_precision_recall_per_pathway_nothing(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this case should ever happen in the wild, but if it does, something is wrong. |
||
|
||
file_paths = [] | ||
algorithms = [] | ||
output_file = OUT_DIR +"test-precision-recall-per-pathway-nothing.txt" | ||
output_png = OUT_DIR + "test-precision-recall-per-pathway-nothing.png" | ||
|
||
Evaluation.precision_and_recall(file_paths, NODE_TABLE, algorithms, output_file, output_png) | ||
assert filecmp.cmp(output_file, EXPECT_DIR + 'expected-precision-recall-per-pathway-nothing.txt', shallow=False) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this now the behavior you switched to in #212
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this one is slightly different. This will give each precision and recall for each output subnetwork/pathway. The one in 212 will use the frequencies of the nodes from all of the outputs per algorithm and create PR curves using that.