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

Update core merge #33

Merged
merged 54 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d3c67ff
Started on AminoAcid class
okkevaneck May 21, 2021
3004562
Added comments in core, still bugs to sort out
okkevaneck Jun 11, 2021
4fe1ef0
Fixed more bugs in the core when adding AminoAcid class
okkevaneck Jul 14, 2021
0d60dd6
Moved part of bind
okkevaneck Jul 14, 2021
dad30d0
Integrated AminoAcid class and fixed Protein tests
okkevaneck Jul 17, 2021
d9bfacb
Mid way testing for new depth-first approach
okkevaneck Jul 22, 2021
374cec8
Added local check script and depth_first works for HPPH
okkevaneck Jul 22, 2021
5771c12
Fixed depth_first search new version
okkevaneck Jul 22, 2021
62d2373
Fixed depth_first_bnb algorithm using new system
okkevaneck Jul 22, 2021
120c998
Fixed small core bugs, working on new logo
okkevaneck Jul 24, 2021
aaf1192
Mid-way of changing bond_value structure
okkevaneck Jul 31, 2021
d46bd8a
Cleaned up bugs from intermediate version. Bumped versions of require…
okkevaneck Sep 7, 2022
aeba497
Bumbed python version in github workflow for matplotlib version depen…
okkevaneck Sep 8, 2022
8e99f67
Bumped workflow python version to 3.9 as numpy 1.23 requires so
okkevaneck Sep 8, 2022
ac84d2c
Removed h_idxs from prune function. Nothing has been tested
okkevaneck Sep 8, 2022
9b1e667
Fixed Protein signature for pybind build
okkevaneck Sep 8, 2022
11db2f6
Setup for debugging current protein issues
okkevaneck Sep 8, 2022
741d57e
Introduced core testing code
okkevaneck Sep 9, 2022
4b2d324
Finished test script for amino acids
okkevaneck Sep 9, 2022
bdcaf82
Started on Protein core tests
okkevaneck Sep 9, 2022
0c00ea6
Fixed protein test compilation
okkevaneck Sep 9, 2022
b81ead6
Fixed first couple protein generation checks
okkevaneck Sep 9, 2022
b07ac00
Added more debug statements for core tests
okkevaneck Sep 9, 2022
2fad7a5
Fixed bugs with bond checks
okkevaneck Sep 9, 2022
d67ef67
Fixed generation of weighted amino maps
okkevaneck Sep 14, 2022
b6326ff
Finished all protein generation test
okkevaneck Sep 14, 2022
627c192
Added debug options in scriptn to run core tests with gdb
okkevaneck Sep 19, 2022
bd03007
Fixed the last_pos indexing error from place_amino. Changed the 'chan…
okkevaneck Sep 19, 2022
959390b
Solved typing issues
okkevaneck Sep 19, 2022
248d6f3
Finished protein movement tests
okkevaneck Sep 19, 2022
a505622
Added removal of amino tests
okkevaneck Sep 19, 2022
542304f
Updated some pytest asserts. Added pytest and core_test asserts for s…
okkevaneck Sep 19, 2022
3cfcbe3
Updated reference for black in pre-commit
okkevaneck Sep 19, 2022
c2aca1d
Fixed score generation of core_test
okkevaneck Sep 19, 2022
6df0226
Fixed score update through removal
okkevaneck Sep 19, 2022
c9d17cb
Try adding core build in github actions pipeline
okkevaneck Sep 19, 2022
5cff880
Started on algorithm code
okkevaneck Sep 19, 2022
a539ecd
Changed signature of depth_first to use pointers. Added testing code …
okkevaneck Sep 20, 2022
263c735
Fixed local algorithm core tests
okkevaneck Sep 23, 2022
516f243
Fixed dfs_bnb
okkevaneck Sep 23, 2022
991e8b4
Fixed pybind11 change to providing protein pointers
okkevaneck Sep 23, 2022
8a91410
Added dynamic_lookup for linking python in case of undefined symbols
okkevaneck Sep 23, 2022
d998040
New way of setting -undefined flag
okkevaneck Sep 23, 2022
7b79d02
Updated the way of passing -undefined setting for macos
okkevaneck Sep 23, 2022
169ef09
Added special compilation case for MacOS
okkevaneck Sep 23, 2022
d53c018
Saving Furo update for issue
okkevaneck Sep 23, 2022
1cc85c0
Changed minimum Python version to 3.9 as 3.11 will release soon
okkevaneck Sep 23, 2022
e948739
Updated versions for wheel deployment
okkevaneck Sep 23, 2022
aea9ba8
Changed always build to only build python 3.9 versions
okkevaneck Sep 26, 2022
0460e7d
Changed CIwheel builds to be specific instead of exlcuding based
okkevaneck Sep 26, 2022
588d411
Leaving documentation as is and adding issue for the future
okkevaneck Sep 28, 2022
368f196
Added more licensing references
okkevaneck Sep 28, 2022
5503043
Added config file for rtfd to set python version to 3.9
okkevaneck Sep 28, 2022
21c1e9d
Removed commented code
okkevaneck Sep 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed h_idxs from prune function. Nothing has been tested
  • Loading branch information
okkevaneck committed Sep 8, 2022
commit ac84d2cce90894227700db04147d3b6affa43e41
Binary file modified archives/prospr_core.tar.gz
Binary file not shown.
Binary file modified archives/prospr_core.zip
Binary file not shown.
17 changes: 7 additions & 10 deletions prospr/core/src/depth_first_bnb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,28 @@
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>


namespace dfs_bnb {
// TODO: Change to use this->max_weights variables correctly instead of h_idxs!
/* Returns true if the branch cannot produce a better score. */
bool prune_branch(Protein protein, int max_length, int no_neighbors,
int move, int best_score) {
protein.place_amino(move);

int cur_len = protein.get_cur_len();
int cur_score = protein.get_score();
std::vector<int> h_idxs = protein.get_h_idxs();
std::vector<int> max_weights = protein.get_max_weights();

/* Compute the number of possible scoring connections for branch. */
std::vector<int>::iterator next_h_idx = std::lower_bound(h_idxs.begin(),
h_idxs.end(),
cur_len - 1);
int h_left = h_idxs.size() - (next_h_idx - h_idxs.begin());
int branch_score = -no_neighbors * h_left;
/* Compute the sum of the remaining possible scoring connections. */
int branch_score = -no_neighbors * \
std::accumulate(max_weights.begin() + cur_len, max_weights.end(), 0);

/* End of amino has 1 more possible way of connecting, update
* branch_score accordingly.
*/
if (cur_len != max_length && h_idxs.back() == max_length - 1)
branch_score--;
if (cur_len != max_length && max_weights.back() != 0)
branch_score -= max_weights.back();

protein.remove_amino();

Expand Down
5 changes: 5 additions & 0 deletions prospr/core/src/protein.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ int Protein::get_weight(std::string aminos) {
}
}

/* Returns the vector with maximum achievable weights per amino acid. */
std::vector<int> Protein::get_max_weights() {
return max_weights;
}

/* Reset all variables of a protein as if it was just initialized. */
void Protein::reset() {
space.clear();
Expand Down
4 changes: 3 additions & 1 deletion prospr/core/src/protein.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class Protein {
/* Returns the weight created between two amino acids. */
int get_weight(std::string aminos);

/* Returns the vector with maximum achievable weights per amino acid. */
std::vector<int> get_max_weights();

/* Reset all variables of a protein as if it was just initialized. */
void reset();

Expand All @@ -76,7 +79,6 @@ class Protein {

private:
std::string sequence;
std::vector<int> h_idxs;
std::map<std::vector<int>, AminoAcid*> space;
int cur_len;
int dim;
Expand Down