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

function(pos){} from ExtractCore.R: What value is 'pos'? #21

Open
B-Kristy opened this issue Mar 6, 2025 · 0 comments
Open

function(pos){} from ExtractCore.R: What value is 'pos'? #21

B-Kristy opened this issue Mar 6, 2025 · 0 comments
Assignees
Labels
bug Something isn't working discussion Ideas or SOPs to guide development

Comments

@B-Kristy
Copy link
Collaborator

B-Kristy commented Mar 6, 2025

One of the methods for selecting OTU's from the ranked BC matrix is the 'elbow' method.

According to the Shade and Stopnisiek paper: The method to find the ‘elbow’ of a graph is based on the first-order difference (from numerical differentiation). In this method, a score is assigned to each cutoff point by separating the curve into two parts and calculating the difference in the average rates of change for both of these parts. Then, the elbow point is selected to be the cutoff point that maximizes this score.

In the ExtractCore.R function, this first-order differentiation is supposedly calculated in

function(pos){ left <- (BC_ranked[pos, 2] - BC_ranked[1, 2]) / pos right <- (BC_ranked[nrow(BC_ranked), 2] - BC_ranked[pos, 2]) / (nrow(BC_ranked) - pos) core_otus <- otu_ranked$otu[1:elbow]}

I'm unsure what the 'pos' value is supposed to be. As well as the 1:elbow used to extract core_otus. The function DOES run when method 'elbow' is specified... but it does not run line-by-line because 'pos' is an undefined variable.

We aren't currently using the 'elbow' method, and it is supposedly more stringent than the 'increase' method. But I do not think that this function is likely running the way it is intended.

@B-Kristy B-Kristy added bug Something isn't working discussion Ideas or SOPs to guide development labels Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion Ideas or SOPs to guide development
Projects
None yet
Development

No branches or pull requests

2 participants