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

init mp calculate 1 #66

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Alexanderlacuna
Copy link
Contributor

implementation Parallel correlation calculation of big numpy arrays or pandas dataframes with NaNs and infs
for gn3

Credit:https://github.com/bukson/nancorrmp

Copy link
Collaborator

@BonfaceKilz BonfaceKilz left a comment

Choose a reason for hiding this comment

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

@Alexanderlacuna I've added some comments for you to work on-- shouldn't be alot of work; and then I'll have this merged ASAIC.

Comment on lines +428 to +430
def compute_correlation_2(corr_inputs):

(this_trait_samples, target_trait) = corr_inputs
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue: pass in samples and target_traits as params; instead of a single set. The resulting function should look like:

Suggested change
def compute_correlation_2(corr_inputs):
(this_trait_samples, target_trait) = corr_inputs
def compute_correlation_2(samples, target_trait):

(corr_coeff, p_val) = scipy.stats.pearsonr(
x_vals[~nans_values], y_vals[~nans_values])

# print(corr_coeff, p_val)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: Remove this dead comment.

credit:https://github.com/bukson/nancorrmp

"""
this_trait_samples = this_trait["trait_sample_data"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: You should really work on how you name your variables. Stop inheriting this naming scheme from gn2. Try to use variables that are easy to understand when scheming code.

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.

None yet

2 participants