Skip to content
Merged
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
9 changes: 2 additions & 7 deletions content/results_abundance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Abundance (ProteomicsLFQ) Results Page."""
import streamlit as st
import pandas as pd
import numpy as np
from pathlib import Path
from src.common.common import page_setup
from src.common.results_helpers import get_workflow_dir, get_abundance_data
Expand Down Expand Up @@ -71,10 +70,7 @@
# Get sample columns (between stats and PeptideSequence)
sample_cols = [c for c in pivot_df.columns if c not in ["ProteinName", "log2FC", "p-value", "PeptideSequence"]]

# Create bar chart column with log2-transformed values
pivot_df["Intensity"] = pivot_df[sample_cols].apply(
lambda row: [np.log2(v + 1) for v in row], axis=1
)
pivot_df["Intensity"] = pivot_df[sample_cols].apply(list, axis=1)

# Reorder columns: place Intensity after p-value
display_cols = ["ProteinName", "log2FC", "p-value", "Intensity"] + sample_cols + ["PeptideSequence"]
Expand All @@ -85,9 +81,8 @@
column_config={
"Intensity": st.column_config.BarChartColumn(
"Intensity",
help="Sample intensities (log2 scale)",
help="Raw sample intensities",
width="small",
y_min=0,
),
},
use_container_width=True,
Expand Down
Loading