snijderlab / rustyms

A rust library for parsing Pro Forma peptides and matching them against MS spectra
Apache License 2.0
16 stars 6 forks source link

'LinearPeptide' object cannot be converted to 'CompoundPeptidoform' error #48

Closed ArthurDeclercq closed 3 days ago

ArthurDeclercq commented 1 week ago

Dear @douweschulte,

I have been trying out the version 0.9.0a1 you made previously for the panicked thread error, but I ran into an error when trying to annotate a spectrum with a proforma peptide.

TypeError: argument 'peptide': 'LinearPeptide' object cannot be converted to 'CompoundPeptidoform'

This happens when I annotate a RawSpectrum object with a LinearPeptide object and proforma string (all with the python bindings). Do you have any idea what causes this?

Kind regards, Arthur

douweschulte commented 1 week ago

With the new alpha update annotation needs a CompoundPeptidoform. This because the peptide model is extended to allow for cross-linked peptides. I could not find any convenient conversion methods so I added some and will be releasing a new alpha version right now.

douweschulte commented 1 week ago

The automated release to PyPy seems broken. @RalfG do you know these errors? "rustc-LLVM ERROR: out of memory" but only on linux all other platforms work fine. I tried some stuff but honestly do not really know where to start.

ArthurDeclercq commented 1 week ago

Thanks for the fast reply and release, I'll have a look with @RalfG if we have a clue to what causes to out of memory error.

RalfG commented 1 week ago

I'm afraid the build is actually just running out of memory. Most likely, the other platforms have more RAM available, or their compilers/linkers consume less. Can you reduce the memory usage through any compilation options?

douweschulte commented 1 week ago

The linux runners have as much of not more RAM allowance so that puzzled me: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources. Also I do not know how it uses 16 gb during compilation, I have never seen it reach that high on my pcs (both on windows and linux).

paretje commented 3 days ago

I had a look at this. Locally, I indeed don't see any issue with RAM consumption. I've been trying to reproduce the issue with act, but I didn't get it running yet, I'll have another look later on. But as a temporary workaround, I wonder if adding --jobs 1 to the maturin args would have any effect?

douweschulte commented 3 days ago

Thanks for the suggestion, above is the regrettably negative result. One thing this highlights however is that it is only the x86 that failed. I would assume that this runs in a 32 bit system image and as such cannot use more than 4Gb ram. With all runs before it only crashed on this one and cancelled the other two midrun.

paretje commented 3 days ago

In that case, doesn't it make sense to just disable the 32-bit build? I wouldn't think a lot of people dust of their 90's or very early 2000's PCs for scientific computing, and especially on Linux, the transition to 64 bit OS was made a while ago, with quite a few distros no longer supporting 32-bit. I'm not sure if it makes sense to invest time into it then. Although from what I observed locally in terms of memory consumption, it's even surprising it ran out of memory on a 32-bit system, assuming a PAE kernel.

douweschulte commented 3 days ago

That is a very sensible solution. I updated the workflow, which worked. So now I redid the release and lets hope it will work this time.

douweschulte commented 3 days ago

It took some more wrangling but it worked in the end, v0.9.0-alpha3 is live on pypi as well.

ArthurDeclercq commented 2 days ago

Thanks @douweschulte!