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

ADD: export before scoring with MS1MS2 scores #87

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pyprophet/data_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
def profile(fun):
return fun

# selection of scores with low cross-correlation for metabolomics scoring
def use_metabolomics_scores():
return [
"var_ms1_isotope_overlap_score",
Expand All @@ -29,6 +30,17 @@ def use_metabolomics_scores():
"var_norm_rt_score"
]

# extracts the scores and writes it into an SQL command
# in some cases some post processing has to be performed depending on which
# position the statement should be inserted (e.g. export_compounds.py)
def write_scores_sql_command(con, score_sql, feature_name, var_replacement):
feature = pd.read_sql_query("""PRAGMA table_info(%s)""" % feature_name, con)
score_names_sql = [name for name in feature["name"].tolist() if name.startswith("VAR")]
score_names_lower = [name.lower().replace("var_", var_replacement) for name in score_names_sql]
for i in range(0,len(score_names_sql)):
score_sql = score_sql + str(feature_name + "." + score_names_sql[i] + " AS " + score_names_lower[i] + ", ")
return score_sql

# Parameter transformation functions
def transform_pi0_lambda(ctx, param, value):
if value[1] == 0 and value[2] == 0:
Expand Down
Loading