Skip to content

Commit

Permalink
docs: update docs to reflect new behaviour
Browse files Browse the repository at this point in the history
update docs to reflect new behaviour of allowing multiple results in a
loader.
  • Loading branch information
jcharkow committed Oct 7, 2024
1 parent 1dbbefe commit 3a1d292
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 534 deletions.
594 changes: 66 additions & 528 deletions docs/python_docs/Quick Start.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion massdash/loaders/GenericChromatogramLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def plotChromatogram(self,
'''

## TODO allow plotting of multiple chromatograms
if len(self.dataFiles_str) > 1:
if len(self.dataFiles) > 1:
raise NotImplementedError("Only one transition file is supported")

# load the transitionGroup for plotting
Expand Down
19 changes: 15 additions & 4 deletions massdash/loaders/GenericRawDataLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def __init__(self, dataFiles: Union[str, List[str]], **kwargs):
if isinstance(a, OSWDataAccess):
self.libraryAccess = SpectralLibraryLoader(a.filename)
self.libraryAccess.load()
else:
self.libraryAccess = SpectralLibraryLoader(self.libraryAccess)
self.libraryAccess.load()
# I think the comment below was previously added, by mistake if not necessary then remove
#else:
# self.libraryAccess = SpectralLibraryLoader(self.libraryAccess)
# self.libraryAccess.load()

## overwrite run names since we are specifying data files
self.runNames = [Path(f).stem for f in self.dataFiles]
Expand Down Expand Up @@ -97,7 +98,17 @@ def plotChromatogram(self,
plotter = InteractivePlotter(pc)

# Plot the chromatogram data
fig = plotter.plot(transitionGroup, transitionGroupFeatures)
labelBySoftware = not all(f.software for f in transitionGroupFeatures)
if len(transitionGroupFeatures) > 0:
# if multiple software tools used, label by software
if transitionGroupFeatures[0].software is not None and labelBySoftware:
feature_legend_labels = [ f.software for f in transitionGroupFeatures if f.software is not None]
else:
feature_legend_labels = [ f"Feature {i+1}" for i in range(len(transitionGroupFeatures)) ]
else:
feature_legend_labels = []

fig = plotter.plot(transitionGroup, transitionGroupFeatures, feature_legend_labels=feature_legend_labels)

show(fig)

Expand Down
2 changes: 1 addition & 1 deletion massdash/loaders/GenericSpectrumLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def plotChromatogram(self,
'''

## TODO allow plotting of multiple chromatograms
if len(self.dataFiles_str) > 1:
if len(self.dataFiles) > 1:
raise NotImplementedError("Only one transition file is supported")

# specify extraction paramaters
Expand Down

0 comments on commit 3a1d292

Please sign in to comment.