Skip to content
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
Binary file added .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,8 @@ examples/new_test_examples/*

# Ignore new tools examples
examples/new_tools/


#ignore test output data
output*
*output
7 changes: 4 additions & 3 deletions ProtPeptigram/DataProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ def load_peaks_data(self, file_path: str) -> pd.DataFrame:
try:
self.peaks_data = pd.read_csv(file_path)
console.log(f"Loaded {len(self.peaks_data)} peptide entries from {file_path}", style="bold green")

self.peaks_data = self.peaks_data.rename(columns=lambda x: str(x).capitalize())
# Check required columns
required_cols = ['Peptide', 'Accession']
missing_cols = [col for col in required_cols if col not in self.peaks_data.columns]

if missing_cols:
raise ValueError(f"Missing required columns: {', '.join(missing_cols)}")



# Find intensity columns
self.intensity_cols = [col for col in self.peaks_data.columns if col.startswith(self.sample_prefix)]

Expand Down Expand Up @@ -281,7 +282,7 @@ def filter_and_format_data(self,
formatted_rows = []

# Extract sample names from intensity columns
sample_names = [col.replace(self.sample_prefix, '') for col in self.intensity_cols]
sample_names = [re.sub(r'^[_\-\*]+', '', col.replace(self.sample_prefix, '')) for col in self.intensity_cols]

# Process each peptide
for _, row in data.iterrows():
Expand Down
2 changes: 1 addition & 1 deletion ProtPeptigram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
#controll for __all__ to limit what is imported when using 'from module import *'
# __all__ = ['PeptideDataProcessor', 'ImmunoViz']

__version__ = "1.0.1-dev"
__version__ = "1.1.0-dev"
__author__ = "Sanjay Krishna,Prithvi Munday,Chen Li"
__email__ = "sanjay.sondekoppagopalakrishna@monash.edu"
5 changes: 3 additions & 2 deletions ProtPeptigram/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def run_pipeline(
Intensity threshold for filtering peptides (default: 0.0)
min_samples : int, optional
Minimum number of samples a peptide must be present in (default: 1)

Returns:
--------
tuple: (PeptideDataProcessor, ImmunoViz) - The processor and visualization objects
Expand Down Expand Up @@ -187,11 +186,13 @@ def run_pipeline(
title=f"Peptide-Protein alignment visualisation - {prot}",
color_by_protein_and_intensity=False,
intensity_cmaps=["Blues", "Reds", "Greens", "Purples"],
protein_cmap="Set1",
protein_cmap="Set1",
external_legend=True,
highlight=True,
auto_highlight=True,
highlight_alpha=0.3,
use_sample_color_bars=True,
sample_bar_width=6,
dpi=120
)

Expand Down
261 changes: 203 additions & 58 deletions ProtPeptigram/viz.py

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# import peptigram
# import peptigram
# ProtPeptigram/__init__.py
# import sys
# import os

# # Add the parent directory to the path so we can import main.py from root
# sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))

# try:
# from main import main
# except ImportError:
# # If main.py is not in root, define a placeholder
# def main():
# print("Main function not found")
# return 1

# __all__ = ['main']
2 changes: 1 addition & 1 deletion data/JCI146771_Mouse_peptides_peaks_online.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Peptide,-10lgP,Mass,Length,ppm,m/z,RT,Accession,PTM,AScore,Area Sample 16,Intensity_Hep_B10BR_28-14-8s,Intensity_Hep_B10BR_K9-178,Intensity_178-3 skin graft_28-14-8s,Intensity_178-3 skin graft_K9-178,Intensity_178-3 spleen_K9-178,Intensity_178-3 spleen_Y-3
Peptide,-10lgP,Mass,Length,ppm,m/z,RT,Accession,PTM,AScore,Area Sample 16,Intensity_Hep_B10BR_28-14-8s,intensity_Hep_B10BR_K9-178,Intensity_178-3 skin graft_28-14-8s,Intensity_178-3 skin graft_K9-178,Intensity_178-3 spleen_K9-178,Intensity_178-3 spleen_Y-3
TPVITGAPYEYR,55.75,1365.6929,12,-0.6,683.8533,41.7,i#CONTAM#RT-pepF,,,9.94E+08,6.10E+08,6.70E+08,7.41E+08,7.53E+08,1.26E+09,7.62E+08
YILAGVENSK,49.2,1092.5815,10,0.4,1093.5892,35.74,i#CONTAM#RT-pepD,,,5.77E+08,5.92E+08,5.10E+08,4.62E+08,5.66E+08,9.02E+08,7.54E+08
GTFIIDPGGVIR,50.91,1243.6924,12,0.6,415.5717,57.95,i#CONTAM#RT-pepI,,,4.77E+08,3.35E+08,3.56E+08,4.68E+08,5.75E+08,8.92E+08,3.69E+08
Expand Down
178 changes: 0 additions & 178 deletions main.py

This file was deleted.

Binary file added test_output.zip
Binary file not shown.