File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1118,18 +1118,26 @@ def known_columns(self) -> List[str]:
11181118 def _configClass (self ):
11191119 return PeakMapConfig
11201120
1121+ import pandas as pd
1122+
11211123 def __init__ (self , data , z_log_scale = False , ** kwargs ) -> None :
11221124 super ().__init__ (data , ** kwargs )
11231125 self .z_log_scale = z_log_scale
11241126
1125- # ✅ Store original intensity values before applying log transformation
1126- if hasattr (self , "z" ):
1127- self .z_original = self .z .copy () # Preserve raw intensities for marginal histograms
1127+ # ✅ Store original intensity values before applying log transformation
1128+ if hasattr (self , "z" ) and isinstance (self .z , str ):
1129+ if isinstance (self .data , pd .DataFrame ) and self .z in self .data .columns :
1130+ self .z_original = self .data [self .z ].copy () # Ensure it's a Series before copying
1131+ else :
1132+ self .z_original = None # Handle cases where z is not a valid column
1133+ else :
1134+ self .z_original = None # Handle unexpected cases
11281135
11291136 self ._check_and_aggregate_duplicates ()
11301137 self .prepare_data ()
11311138 self .plot ()
11321139
1140+
11331141 def prepare_data (self ):
11341142 """
11351143 Prepares the dataset for plotting.
You can’t perform that action at this time.
0 commit comments