Closed jcharkow closed 10 months ago
What errors are you getting?
I have a working instance of the plotting here path/refactor_ui.
But currently the issue I'm running into is that the transitionGroup
from loadTransitionGroups
only contains the precursor data and not the transition data.
I see, so if a title is not provided, it throws an error about font size, because a title is still passed to the bokeh figure
, object, and since the deafult for title in plotConfig is None, it can't assign text sizing stuff to it.
I can change the way the figure
object is initiated to deal with this case.
AttributeError: 'NoneType' object has no attribute 'text_font_size'
Traceback:
File "/home/justincsing/anaconda3/envs/py39/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
exec(code, module.__dict__)
File "/media/justincsing/ExtraDrive1/Documents2/Roest_Lab/Github/MassSeer/massseer/gui.py", line 76, in <module>
XICExperiment.main()
File "/media/justincsing/ExtraDrive1/Documents2/Roest_Lab/Github/MassSeer/massseer/sever/ExtractedIonChromatogramAnalysisServer.py", line 68, in main
plot_obj = plotter.plot(tr_group)
File "/media/justincsing/ExtraDrive1/Documents2/Roest_Lab/Github/MassSeer/massseer/plotting/InteractivePlotter.py", line 40, in plot
return self.plot_chromatogram(transitionGroup)
File "/media/justincsing/ExtraDrive1/Documents2/Roest_Lab/Github/MassSeer/massseer/plotting/InteractivePlotter.py", line 158, in plot_chromatogram
p.title.text_font_size = "16pt"
What is the error when you do pass a title though? I can't reproduce any errors with that
Ahh okay, right now I attach a targeted_transition_list (pd.Dataframe) to the TransitionGroup object which contains the meta data (precursor_mz, product_mz, product_charge) for the selected precursor (peptide, charge) that you want to draw a plot for.
I have this method filter_for_target_transition_list in the SpectralLibraryLoader class, that gets a filtered transition list with information for only a specific precursor. And then I add it to the TransitionGroup here . Which may not be the best way :shrug:
I could make this optional, if it contains the meta data, include those in the hovertool, otherwise they won't be present in the hovertool. What do you think? Or if we load the meta data directly from the loadTransitionGroups
method
I think that maybe the metadata is not needed? I am learning towards making it optional. I am sure the hovertool gets quite busy with all the metadata so it might not be needed for all purposes. Either option sounds good though
@jcharkow I made a fix #35, can you check to see if it addresses these issues
I am testing out the plotting module and running into difficulty with getting the plotting functions to work.
Here is my code
I am running into several errors regarding the title and if I remove the title also getting errors later on, possibly because the methods are not in use anymore.