-
Notifications
You must be signed in to change notification settings - Fork 11
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
Question about the MATLAB style correlation function in genes.py #27
Comments
Hi, you are correct in how you interpret the results, however in the function i return only the elements from |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/alegiac95/Imaging-transcriptomics/blob/46adb1df85c37123c77226d023b6d763edae8aca/imaging_transcriptomics/genes.py#L116C1-L125C36
Hi,
I am wondering if there is some thing wrong with the correlation here.
In this code: "
r1 = correlate(_res.get("x_scores"), scan_data.reshape(scan_data.shape[0], 1))
". The_res.get("x_scores")
is c1 which is the components from the PLS results, and thescan_data.reshape(scan_data.shape[0], 1))
is c2 which is a imaging data column. And then combined the component columns and the single imaging data column into a combined matrix usingnp.hstack
.So the last column in this combined matrix here is imaging data and the rest columns are components. And then using
np.corrcoef
with therowvar=False
we can get a correlation matrix with the element [m, n] represents the correlation coefficient between the column m and column n.As far as I understand, the
r1
represents to the correlation coefficients between the imaging data and different PLS components. However, here in the combined matrix, the imaging data is the last column. And when the code slicing the correlation matrix with the[0, :]
, it returns the correlation coefficients between the first component (the first column from c1) and the rest of the components as well as the imaging data.For example, if there are 2 components, the
r1
here is [coeffience between component 1 and 2, coeffience between component 1 and imaging data ].Is that correct?
The text was updated successfully, but these errors were encountered: