mwang87 / MetabolomicsSpectrumResolver

Metabolomics Spectrum Resolver/Displayer
https://metabolomics-usi.ucsd.edu/
MIT License
9 stars 1 forks source link

Add feature to allow for peak passing directly into mirror plots #177

Closed benpullman closed 2 years ago

benpullman commented 2 years ago

This feature will allow for the input of spectrum peaks instead of USIs for mirror plots for mirror plot end points (but not the UI yet).

I added a new method which allows for the input of a USI or a spectrum, reads the USI first, but if the USI is empty, reads the spectrum peaks input as a JSON.

Please let me know if there's a different approach that should be taken for this.

benpullman commented 2 years ago

Just a note that some tests fail, but I think its not a result of the updates that I made here.

benpullman commented 2 years ago

@mwang87 @bittremieux I switched the input type to PROXI - I was pretty lenient with what terms could be use for precursor m/z and modified peptide as seen here - not sure exactly how broad a net we want to cast for what terms are allowed for what.


        # isolation window target m/z
        if attribute["accession"] == "MS:1000827":
            precursor_mz = float(attribute["value"])
        # selected ion m/z
        elif attribute["accession"] == "MS:1000744":
            precursor_mz = float(attribute["value"])
        # charge state
        elif attribute["accession"] == "MS:1000041":
            charge = int(attribute["value"])
        # spectrum name (peptidoform?)
        elif attribute["accession"] == "MS:1003061":
            peptide = attribute["value"].split("/")[0]
        # peptidoform
        elif attribute["accession"] == "MS:1003049":
            peptide = attribute["value"]
        # unmodified peptide sequence
        elif attribute["accession"] == "MS:1000888":
            peptide_clean = attribute["value"]
benpullman commented 2 years ago

@bittremieux Thanks for the comments, they made a ton of sense and I addressed everything except the caching. I wasn't completely sure how to handle the caching though.

bittremieux commented 2 years ago

Great, thanks. Yeah, we can leave the caching in right now and revisit it in the near future.

Fiehn also emailed back that they're aware of the SSL issues, but that it's challenging to fix. So we can ignore those failed unit tests for now.