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

implemented a custom workflow #438

Merged
merged 1 commit into from
Mar 12, 2024
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: 6 additions & 6 deletions protzilla/data_analysis/differential_expression_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def apply_multiple_testing_correction(
p_values: list, method: str, alpha: float
p_values: list, method: str, alpha: float
) -> tuple:
"""
Applies a multiple testing correction method to a list of p-values
Expand Down Expand Up @@ -50,9 +50,9 @@ def _map_log_base(log_base: str) -> int | None:


def log_transformed_check(
intensity_df: pd.DataFrame,
intensity_name: str = None,
value_threshold: int = 1000,
intensity_df: pd.DataFrame,
intensity_name: str = None,
value_threshold: int = 1000,
) -> bool:
"""
This function checks a intensity dataframe for a previous log transformation based on the intensity values.
Expand All @@ -63,7 +63,7 @@ def log_transformed_check(
intensity_name = default_intensity_column(intensity_df)

if (
intensity_df[intensity_name].max() < value_threshold
intensity_df[intensity_name].max() < value_threshold
or intensity_df[intensity_name].min() < 0
):
return True
Expand All @@ -74,7 +74,7 @@ def log_transformed_check(
INVALID_PROTEINGROUP_DATA_MSG = {
"level": logging.WARNING,
"msg": "Due do missing or identical values, the p-values for some protein groups could not be calculated. These groups were omitted from the analysis. "
"To prevent this, please add filtering and imputation steps to your workflow before running the analysis.",
"To prevent this, please add filtering and imputation steps to your workflow before running the analysis.",
}
LOG_TRANSFORMATION_MESSAGE_MSG = {
"level": logging.INFO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from protzilla.data_preprocessing.transformation import by_log
from protzilla.utilities import default_intensity_column, exists_message

from .differential_expression_helper import (
BAD_LOG_BASE_INPUT_MSG,
INVALID_PROTEINGROUP_DATA_MSG,
Expand Down
1 change: 1 addition & 0 deletions protzilla/data_analysis/differential_expression_t_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from protzilla.data_preprocessing.transformation import by_log
from protzilla.utilities import default_intensity_column, exists_message

from .differential_expression_helper import (
BAD_LOG_BASE_INPUT_MSG,
INVALID_PROTEINGROUP_DATA_MSG,
Expand Down
3 changes: 1 addition & 2 deletions protzilla/run_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def log_message(level: int = 40, msg: str = "", trace: str | list[str] = ""):
log_function(f"{msg}{trace}")



def log_messages(messages: list[dict] = None):
"""
Logs a list of messages to the console.
Expand All @@ -181,4 +180,4 @@ def log_messages(messages: list[dict] = None):
message["level"],
message["msg"],
message["trace"] if "trace" in message else "",
)
)
2 changes: 1 addition & 1 deletion ui/runs/utilities/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def build_trace_alert(trace):
aria-expanded="false" aria-controls="flush-collapseOne">\
Trace</button></h2><div id="flush-collapseOne" class="accordion-collapse collapse" \
aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">\
<div class="accordion-body bg-white"><pre>{trace}</pre></div></div></div></div>'
<div class="accordion-body bg-white"><pre>{trace}</pre></div></div></div></div>'
7 changes: 1 addition & 6 deletions ui/runs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@
make_plot_fields,
make_sidebar,
)
from ui.runs.views_helper import (
clear_messages,
parameters_from_post,
display_messages,
display_message,
)
from ui.runs.views_helper import display_messages, parameters_from_post

active_runs = {}

Expand Down
33 changes: 33 additions & 0 deletions user_data/workflows/custom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"analysis_level": "protein",
"sections": {
"importing": {
"steps": [
{
"name": "ms_data_import",
"method": "max_quant_import",
"parameters": {
"intensity_name": "iBAQ"
}
},
{
"name": "metadata_import",
"method": "metadata_import_method",
"parameters": {
"feature_orientation": "Columns (samples in rows, features in columns)"
}
}
]
},
"data_preprocessing": {
"steps": []
},
"data_analysis": {
"steps": []
},
"data_integration": {
"steps": []
}
}
}

Loading