levitsky / pyteomics

Pyteomics is a collection of lightweight and handy tools for Python that help to handle various sorts of proteomics data. Pyteomics provides a growing set of modules to facilitate the most common tasks in proteomics data analysis.
http://pyteomics.readthedocs.io
Apache License 2.0
105 stars 34 forks source link

AttributeError: module 'pyteomics.auxiliary' has no attribute 'PytemicsError' #124

Closed sjust-seerbio closed 9 months ago

sjust-seerbio commented 9 months ago

We observe this error when attempting to parse a FASTA in version 4.6.2. The error does not occur in version 4.6.

XXXXX/XXXXX.py:XXX: in load_fasta
    for description, sequence in MyUniProt(fastafile):
/usr/local/anaconda3/envs/seerbio/lib/python3.10/site-packages/pyteomics/auxiliary/file_helpers.py:178: in __next__
    return next(self._reader)
/usr/local/anaconda3/envs/seerbio/lib/python3.10/site-packages/pyteomics/fasta.py:232: in _read
    description = self.parser(description)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

instance = <XXXXX.XXXXX.MyUniProt object at 0x11a1760b0>
descr = 'tr|A0A024QYW1|A0A024QYW1_HUMAN Isoform of A6NGB0, Transmembrane protein 191C OS=Homo sapiens OX=9606 GN=TMEM191C PE=4 SV=1'

    def _new_parser(instance, descr):
        parsed = parser(instance, descr)
        if not RAW_HEADER_KEY in parsed:
            parsed[RAW_HEADER_KEY] = descr
        else:
>           raise aux.PytemicsError('Cannot save raw protein header, since the corresponsing'
                                    'key ({}) already exists.'.format(RAW_HEADER_KEY))
E           AttributeError: module 'pyteomics.auxiliary' has no attribute 'PytemicsError'. Did you mean: 'PyteomicsError'?

/usr/local/anaconda3/envs/seerbio/lib/python3.10/site-packages/pyteomics/fasta.py:144: AttributeError

This error appears to have been introduced in commit 2700249.

levitsky commented 9 months ago

Ouch, very sorry about that and thank you for reporting. Were you going to make a PR or should I just patch it myself?

sjust-seerbio commented 9 months ago

No worries, it's not a critical issue. I was going to make a PR but I'm still unable to reproduce the problem in a unit test. I'll just put up my branch as a PR without the test for now.

levitsky commented 9 months ago

Yes, it should be fine like this, thank you.