LOR.fetch_codes

LOR.fetch_codes(update=False, dump_dir=None, verbose=False)[source]

Fetches the data of PRIDE/LOR codes.

Parameters:
  • update (bool) – Whether to check for updates to the package data; defaults to False.

  • dump_dir (str | None) – The path to a directory where the data file will be saved; defaults to None.

  • verbose (bool | int) – Whether to print relevant information to the console; defaults to False.

Returns:

A dictionary containing the LOR codes.

Return type:

dict

Examples:

>>> from pyrcs.line_data import LOR  # from pyrcs import LOR
>>> lor = LOR()
>>> lor_codes_dat = lor.fetch_codes()
>>> type(lor_codes_dat)
dict
>>> list(lor_codes_dat.keys())
['LOR', 'Last updated date']
>>> l_codes = lor_codes_dat['LOR']
>>> type(l_codes)
dict
>>> list(l_codes.keys())
['CY', 'EA', 'GW', 'LN', 'MD', 'NW/NZ', 'SC', 'SO', 'SW', 'XR']
>>> cy_codes = l_codes['CY']
>>> type(cy_codes)
dict
>>> list(cy_codes.keys())
['CY', 'Notes', 'Last updated date']
>>> cy_codes['CY']
     Code  ...                       RA Note
0   CY240  ...           Caerwent branch RA4
1  CY1540  ...  Pembroke - Pembroke Dock RA6
[2 rows x 5 columns]
>>> xr_codes = l_codes['XR']
>>> type(xr_codes)
dict
>>> list(xr_codes.keys())
['XR', 'Last updated date']
>>> xr_codes_ = xr_codes['XR']
>>> type(xr_codes_)
dict
>>> list(xr_codes_.keys())
['Current codes', 'Current codes note', 'Past codes', 'Past codes note']
>>> xr_codes_['Past codes'].head()
    Code  ... RA Note
0  XR001  ...
1  XR002  ...
[2 rows x 5 columns]
>>> xr_codes_['Current codes'].head()
    Code  ...                     RA Note
0  XR001  ...  Originally reported as RA4
1  XR002  ...  Originally reported as RA4
[2 rows x 5 columns]