Spaces:
Sleeping
Sleeping
Update src/app.py
Browse files225 unmodified lines2262272282292302312322333 unmodified lines23723823924024124277 unmodified lines320321322323324325326141 unmodified lines468469470471472473474475476477478479480481482483225 unmodified lineskey="download_binary_txt")# --- Output 2: Grouped Binary Matrix ---st.markdown("### Output 2 – Grouped Binary Matrix")groups = []for i in range(0, len(binary_labels), group_size):group = binary_labels[i:i + group_size]3 unmodified linescolumns = [f"Position {i+1}" for i in range(group_size)]df = pd.DataFrame(groups, columns=columns)st.dataframe(df, use_container_width=True)st.download_button(77 unmodified linesUpload your sample file (Excel, CSV, or TXT) containing binary mutation data.The app will:- Auto-detect or create `Sample`, `Position#`, `Total edited`, and `Volume per "1"` columns- Let you set the **Desired total volume per sample (µL)** used to compute `Volume per "1"`- Calculate total demand per input and suggest a **uniform layout** (same # consecutive wells per input)- **Preview** the layout on a plate map (with tooltips)- After confirmation, generate pipetting commands and a source volume summary141 unmodified linesst.markdown("#### ⚙️ Volume Calculation Settings")default_total_vol = st.number_input("Desired total volume per sample (µL)",min_value=1.0, max_value=10000.0, value=64.0, step=1.0,help="Used to compute Volume per '1' as (Desired total volume / Total edited) when not provided.")vol_candidates = [c for c in df.columns if "volume per" in c.lower()]if not vol_candidates:df['Volume per "1"'] = default_total_vol / df["Total edited"].replace(0, np.nan)df['Volume per "1"'] = df['Volume per "1"'].fillna(0)st.info(f'`Volume per "1"` column missing — calculated automatically as {default_total_vol:.0f} µL / Total edited.')volume_col = 'Volume per "1"'else:volume_col = vol_candidates[0]225 unmodified lines2262272282292302312322333 unmodified lines23723823924024124224377 unmodified lines321322323324325326327141 unmodified lines469470471472473474475476477478479480481482483484225 unmodified lineskey="download_binary_txt")# --- Output 2: Binary matrix split into reactions grouped by target position ---st.markdown("### Output 2 – Binary matrix split into reactions grouped by target position")groups = []for i in range(0, len(binary_labels), group_size):group = binary_labels[i:i + group_size]3 unmodified linescolumns = [f"Position {i+1}" for i in range(group_size)]df = pd.DataFrame(groups, columns=columns)df.insert(0, "Sample", range(1, len(df) + 1))st.dataframe(df, use_container_width=True)st.download_button(77 unmodified linesUpload your sample file (Excel, CSV, or TXT) containing binary mutation data.The app will:- Auto-detect or create `Sample`, `Position#`, `Total edited`, and `Volume per "1"` columns- Let you set the **Maximum volume per input well (µL)** used to compute `Volume per "1"`- Calculate total demand per input and suggest a **uniform layout** (same # consecutive wells per input)- **Preview** the layout on a plate map (with tooltips)- After confirmation, generate pipetting commands and a source volume summary141 unmodified linesst.markdown("#### ⚙️ Volume Calculation Settings")default_total_vol = st.number_input("Maximum volume per input well (µL)",min_value=1.0, max_value=10000.0, value=64.0, step=1.0,help="Used to compute Volume per '1' as (Maximum volume per input well / Total edited) when not provided.")vol_candidates = [c for c in df.columns if "volume per" in c.lower()]if not vol_candidates:df['Volume per "1"'] = default_total_vol / df["Total edited"].replace(0, np.nan)df['Volume per "1"'] = df['Volume per "1"'].fillna(0)st.info(f'`Volume per "1"` column missing — calculated automatically as {default_total_vol:.0f} µL (max per input well) / Total edited.')volume_col = 'Volume per "1"'else:volume_col = vol_candidates[0]
src/app.py+7-6