Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of codebase #16

Closed
jcharkow opened this issue Nov 2, 2023 · 2 comments
Closed

Refactor of codebase #16

jcharkow opened this issue Nov 2, 2023 · 2 comments

Comments

@jcharkow
Copy link
Collaborator

jcharkow commented Nov 2, 2023

Make codebase more "class based" including abstract class based so that it can be more easily extendable. Also this should allow for a friendlier UI for those working directly with the python package.

Several Classes will add include:

Chromatogram - store np arrays of rt and im as well as meta information (e.g. label)

TransitionGroup - an object contaning both the MS1 and the MS2 chromatograms
- possibly some meta information as well

 - getMedian() - returns a median chromatogram object 

GenericPeakPicker - abstract class containing functions which all peakPickers should implement
- contains pick() function which requires a transition group and returns a list of PeakFeatures

- Current Classes Inhereting from this include:
      - pyMRMPeakPicker - Justin's python implementation of MRMPeakPicker
      - MRMPeakPicker - Official OpenMS implementation of MRMPeakPicker (from pyopenms)
      - Leon's PeakPicker  

PeakFeatures - metainformation about a peak feature including rt apex intensity, left width, right width, area intensity etc. These objects created by all peak pickers

ExternalFileLoader - abstract class containing functions to load chromatogram objects
- loadChromatogram() function which takes a peptide sequence as a string and returns a List of TransitionGroup objects (each run)
- loadFeatures() which takes a peptide and loads the features of that peptide into a list of PeakFeatues
- Classes inhereting from this include:
SQMassLoader - inherits from ExternalFileLoader requires osw and list of sqMass files

MzMLLoader - inherits from ExternalFileLoader requires osw/diann results and mzML file 

timsLoader - inherits from ExternalFileLoader requires osw/diann results and mzML file

Plotter abstract class for plotting chromatograms
plotTransitionGroup() requires transition group outputs plot
plotPeakFeatures() requires list of peak features and places them on plot

Current Classes Inhereting from this include:
    StaticPlot()
    InteractivePlot()

streamlit functions hopefully should not change too much.

@singjc Please let me know your thoughts

@jcharkow
Copy link
Collaborator Author

jcharkow commented Nov 2, 2023

Update GenericFileLoader

load(peptide sequence, charge) -> TransitionGroup)

ChromatogramLoader nherit from (SQMassFile, OSWFile)
SQMassLoader inherit from (SQMassFile, PQPFile)

ExperimentLoader inherit from ( MZML, OSW)
MZMLLoader inherit from ( MzML, tsv file)

charge, rt, im needed in

@jcharkow jcharkow linked a pull request Nov 21, 2023 that will close this issue
@singjc
Copy link
Collaborator

singjc commented Jan 8, 2024

This has been accomplished with #50 , but was rebased as dev, and old dev was moved to legacy.

@singjc singjc closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants