Skip to content

Commit 46bf208

Browse files
t0mdavid-mclaude
andauthored
fix(abundance): show raw intensities in bar chart column (#25)
Drop the log2 transform and y_min=0 from the BarChartColumn. With absolute log2 values around 30, a real log2FC of 3 only translated to ~10% bar-height difference, making bars look indistinguishable across samples. Plotting raw intensities (with per-row auto-scaling) lets fold changes show up visually. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4c6d9ee commit 46bf208

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

‎content/results_abundance.py‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Abundance (ProteomicsLFQ) Results Page."""
22
import streamlit as st
33
import pandas as pd
4-
import numpy as np
54
from pathlib import Path
65
from src.common.common import page_setup
76
from src.common.results_helpers import get_workflow_dir, get_abundance_data
@@ -71,10 +70,7 @@
7170
# Get sample columns (between stats and PeptideSequence)
7271
sample_cols = [c for c in pivot_df.columns if c not in ["ProteinName", "log2FC", "p-value", "PeptideSequence"]]
7372

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

7975
# Reorder columns: place Intensity after p-value
8076
display_cols = ["ProteinName", "log2FC", "p-value", "Intensity"] + sample_cols + ["PeptideSequence"]
@@ -85,9 +81,8 @@
8581
column_config={
8682
"Intensity": st.column_config.BarChartColumn(
8783
"Intensity",
88-
help="Sample intensities (log2 scale)",
84+
help="Raw sample intensities",
8985
width="small",
90-
y_min=0,
9186
),
9287
},
9388
use_container_width=True,

0 commit comments

Comments
 (0)