Skip to content

Commit

Permalink
Renamed root package for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
mobiusklein committed Jun 17, 2024
1 parent 6cc1611 commit ef30daa
Show file tree
Hide file tree
Showing 69 changed files with 267 additions and 155 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ For development, run:
pip install --editable .
```

Or from the root of this repository:
```sh
pip install --editable implementations/python
```

Test with
```
pytest
Expand Down
4 changes: 2 additions & 2 deletions bench/nist_msp_ftp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from urllib.request import urlopen

from mzlib.backends import msp
from mzlib import annotation
from mzspeclib.backends import msp
from mzspeclib import annotation


urls = [
Expand Down
4 changes: 2 additions & 2 deletions examples/draw_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from matplotlib import pyplot as plt

from mzlib.spectrum_library import SpectrumLibrary
from mzlib.draw import draw_spectrum
from mzspeclib.spectrum_library import SpectrumLibrary
from mzspeclib.draw import draw_spectrum


def main(path, spectrum_key):
Expand Down
10 changes: 5 additions & 5 deletions examples/first_n_entries.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import click

from mzlib import SpectrumLibrary
from mzlib.backends import SpectralLibraryBackendBase, FormatInferenceFailure, TextSpectralLibraryWriter
from mzlib.cluster import SpectrumCluster
from mzlib.index import MemoryIndex, SQLIndex
from mzlib.spectrum import Spectrum
from mzspeclib import SpectrumLibrary
from mzspeclib.backends import SpectralLibraryBackendBase, FormatInferenceFailure, TextSpectralLibraryWriter
from mzspeclib.cluster import SpectrumCluster
from mzspeclib.index import MemoryIndex, SQLIndex
from mzspeclib.spectrum import Spectrum

@click.command('first_n_entries')
@click.argument('inpath', type=click.Path(exists=True))
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test:
pytest -r a -v tests --cov mzlib --cov-report=html --cov-report term
pytest -r a -v tests --cov mzspeclib --cov-report=html --cov-report term

retest:
py.test -v tests --lf --pdb
Expand Down
11 changes: 0 additions & 11 deletions mzlib/__init__.py

This file was deleted.

11 changes: 11 additions & 0 deletions mzspeclib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""HUPO-PSI Spectral library format."""

from mzspeclib.spectrum import Spectrum
from mzspeclib.analyte import Analyte, Interpretation

from mzspeclib.index import MemoryIndex, SQLIndex

from mzspeclib.spectrum_library import SpectrumLibrary
from mzspeclib.spectrum_library_index import SpectrumLibraryIndex
from mzspeclib.spectrum_library_collection import SpectrumLibraryCollection
from mzspeclib.universal_spectrum_identifier import UniversalSpectrumIdentifier
2 changes: 1 addition & 1 deletion mzlib/analyte.py → mzspeclib/analyte.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pyteomics import proforma

from mzlib.attributes import AttributedEntity, IdentifiedAttributeManager, AttributeManagedProperty, AttributeProxy, AttributeGroupFacet
from mzspeclib.attributes import AttributedEntity, IdentifiedAttributeManager, AttributeManagedProperty, AttributeProxy, AttributeGroupFacet


FIRST_ANALYTE_KEY = '1'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions mzlib/backends/base.py → mzspeclib/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
from psims.controlled_vocabulary import Entity
from psims.controlled_vocabulary.controlled_vocabulary import (
load_uo, load_unimod, load_psims)
from mzlib.cluster import SpectrumCluster
from mzspeclib.cluster import SpectrumCluster

from mzlib.index import MemoryIndex, SQLIndex, IndexBase
from mzlib.spectrum import LIBRARY_SPECTRUM_INDEX, LIBRARY_SPECTRUM_KEY, Spectrum
from mzlib.analyte import Analyte, Interpretation, InterpretationMember, ANALYTE_MIXTURE_TERM
from mzlib.attributes import Attributed, AttributedEntity, AttributeSet, AttributeManagedProperty
from mzlib.ontology import _VocabularyResolverMixin
from mzspeclib.index import MemoryIndex, SQLIndex, IndexBase
from mzspeclib.spectrum import LIBRARY_SPECTRUM_INDEX, LIBRARY_SPECTRUM_KEY, Spectrum
from mzspeclib.analyte import Analyte, Interpretation, InterpretationMember, ANALYTE_MIXTURE_TERM
from mzspeclib.attributes import Attributed, AttributedEntity, AttributeSet, AttributeManagedProperty
from mzspeclib.ontology import _VocabularyResolverMixin

from .utils import open_stream, _LineBuffer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

from pyteomics import proforma

from mzlib import annotation
from mzlib.analyte import FIRST_ANALYTE_KEY, FIRST_INTERPRETATION_KEY, Analyte
from mzlib.spectrum import Spectrum, SPECTRUM_NAME, CHARGE_STATE
from mzlib.attributes import AttributeManager, Attributed
from mzspeclib import annotation
from mzspeclib.analyte import FIRST_ANALYTE_KEY, FIRST_INTERPRETATION_KEY, Analyte
from mzspeclib.spectrum import Spectrum, SPECTRUM_NAME, CHARGE_STATE
from mzspeclib.attributes import AttributeManager, Attributed

from mzlib.backends.base import SpectralLibraryBackendBase, FORMAT_VERSION_TERM, DEFAULT_VERSION
from mzspeclib.backends.base import SpectralLibraryBackendBase, FORMAT_VERSION_TERM, DEFAULT_VERSION

from mzlib.index.base import IndexBase
from mzspeclib.index.base import IndexBase


class BibliospecBase:
Expand Down
8 changes: 4 additions & 4 deletions mzlib/backends/diann.py → mzspeclib/backends/diann.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

from pyteomics import proforma

from mzlib import annotation
from mzlib.backends.base import DEFAULT_VERSION, FORMAT_VERSION_TERM, LIBRARY_NAME_TERM, _CSVSpectralLibraryBackendBase
from mzlib.backends.utils import open_stream, urlify
from mzlib.spectrum import Spectrum, SPECTRUM_NAME
from mzspeclib import annotation
from mzspeclib.backends.base import DEFAULT_VERSION, FORMAT_VERSION_TERM, LIBRARY_NAME_TERM, _CSVSpectralLibraryBackendBase
from mzspeclib.backends.utils import open_stream, urlify
from mzspeclib.spectrum import Spectrum, SPECTRUM_NAME


def _rewrite_unimod_peptide_as_proforma(sequence: str) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

from pyteomics import proforma

from mzlib import annotation
from mzlib.analyte import FIRST_ANALYTE_KEY, FIRST_INTERPRETATION_KEY, Analyte, ProteinDescription
from mzlib.spectrum import Spectrum, SPECTRUM_NAME, CHARGE_STATE
from mzlib.attributes import AttributeManager, Attributed, Attribute
from mzspeclib import annotation
from mzspeclib.analyte import FIRST_ANALYTE_KEY, FIRST_INTERPRETATION_KEY, Analyte, ProteinDescription
from mzspeclib.spectrum import Spectrum, SPECTRUM_NAME, CHARGE_STATE
from mzspeclib.attributes import AttributeManager, Attributed, Attribute

from mzlib.backends.base import SpectralLibraryBackendBase, FORMAT_VERSION_TERM, DEFAULT_VERSION
from mzspeclib.backends.base import SpectralLibraryBackendBase, FORMAT_VERSION_TERM, DEFAULT_VERSION

from mzlib.index.base import IndexBase
from mzspeclib.index.base import IndexBase


DECOY_SPECTRUM = "MS:1003192|decoy spectrum"
Expand Down
12 changes: 6 additions & 6 deletions mzlib/backends/json.py → mzspeclib/backends/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
from typing import Any, Iterable, List, Dict, Mapping, Union

from pathlib import Path
from mzlib.cluster import SpectrumCluster
from mzspeclib.cluster import SpectrumCluster

from mzlib.index import MemoryIndex
from mzlib.attributes import AttributeManager, Attributed, AttributeSet
from mzlib.annotation import parse_annotation, IonAnnotationBase
from mzlib.analyte import Analyte, Interpretation, FIRST_INTERPRETATION_KEY
from mzlib.spectrum import Spectrum
from mzspeclib.index import MemoryIndex
from mzspeclib.attributes import AttributeManager, Attributed, AttributeSet
from mzspeclib.annotation import parse_annotation, IonAnnotationBase
from mzspeclib.analyte import Analyte, Interpretation, FIRST_INTERPRETATION_KEY
from mzspeclib.spectrum import Spectrum

from .base import SpectralLibraryBackendBase, SpectralLibraryWriterBase, FORMAT_VERSION_TERM, AttributeSetTypes
from .utils import open_stream
Expand Down
Loading

0 comments on commit ef30daa

Please sign in to comment.