Skip to content

Comments

Fix counting statistics with shorter trees#125

Open
ammarcsj wants to merge 2 commits intomainfrom
fix_counting_stats_w_shorter_trees
Open

Fix counting statistics with shorter trees#125
ammarcsj wants to merge 2 commits intomainfrom
fix_counting_stats_w_shorter_trees

Conversation

@ammarcsj
Copy link
Member

@ammarcsj ammarcsj commented Feb 13, 2026

The counting statistics module had an error on fragpipe data, because the tree format was not correctly recognized as reported here #105

Implemented a new function to determine the appropriate level for missing value statistical testing based on the tree structure, which is then used subsequently.

@ammarcsj ammarcsj requested a review from mschwoer February 13, 2026 12:28
@ammarcsj ammarcsj changed the title Fix_counting_stats_w_shorter_trees Fix counting statistics with shorter trees Feb 13, 2026
ion_cols:
- Peptide Key

fragpipe_precursor:
Copy link
Contributor

Choose a reason for hiding this comment

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

just noting: l.1363 was "fragpipe_precursors"

# Check if mod_seq_charge nodes exist (fragment-level data)
mod_seq_charge_nodes = anytree.search.findall(root_node, filter_=lambda node: node.type == "mod_seq_charge")
if len(mod_seq_charge_nodes) > 0:
MISSINGVAL_TEST_LEVEL = "mod_seq_charge"
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit) Comment with # Scenario 1: missing here

MISSINGVAL_TEST_LEVEL = None


def determine_missingval_test_level(root_node):
Copy link
Contributor

Choose a reason for hiding this comment

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

private?


# Set the test level if not already determined
if MISSINGVAL_TEST_LEVEL is None:
determine_missingval_test_level(root_node)
Copy link
Contributor

Choose a reason for hiding this comment

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

could this be
MISSINGVAL_TEST_LEVEL = determine_missingval_test_level(root_node)

then you don't need to have global MISSINGVAL_TEST_LEVEL in determine_missingval_test_level


if MISSINGVAL_TEST_LEVEL == "mod_seq_charge":
return anytree.search.findall(root_node, filter_=lambda node: node.type == "mod_seq_charge")
else: # "base"
Copy link
Contributor

Choose a reason for hiding this comment

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

or seq, mod_seq?

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.

2 participants