austekan / fiscore Goto Github PK
View Code? Open in Web Editor NEWFiscore package development, updates, and the newest version release
License: GNU General Public License v3.0
Fiscore package development, updates, and the newest version release
License: GNU General Public License v3.0
This function can benefit a lot from refactoring:
I will address all these topics below. The refactored code is also available on GitHub:
The refactored main function is in file Proteins.Structure.FiScore.R (this is only a convenience name for my script files; the initial name can be retained).
Are extracted by the helper function features.pdb (see file Proteins.Structure.R). This function can be used on its own and should be exported by the package).
Are computed by separate functions (see file Proteins.Structure.R). These functions can be used on their own as well.
Ugly bug was also corrected:
The refactored code should be faster and more robust. The function names are provisional and may be changed or adapted to better suite various workflows.
The range (min, max) is computed multiple times. It should be computed only once. One of the following conditions also seems redundant: (r[1] == 0) && (r[2] == 0)), as min == max.
Also, inserting a space between "#" and the comments greatly increases readability.
### Helper functions for the analysis
# MIN-MAX normalisation based on the input array
MINMAX_normalisation_func = function(array) {
# input = numeric array;
# returns normalised array values;
# check for cases where all B-factor values are 0;
r = range(array);
if((r[2] - r[1] == 0) && (r[1] == 0) && (r[2] == 0)) { return (0); }
return ((array - r[1]) / (r[2] - r[1]));
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.