Skip to content

path

pdb_db module-attribute

pdb_db = join(database, 'pdbDB')

Local copy of the PDB database

pisa_db module-attribute

pisa_db = join(database, 'pisaDB')

Local copy of the PISA database

get_uniclust_db

get_uniclust_db() -> str

Get the newest UniClust file by sorting alphanumerically

Source code in symdesign/utils/path.py
192
193
194
195
196
197
198
199
def get_uniclust_db() -> str:
    """Get the newest UniClust file by sorting alphanumerically"""
    try:  # To get database files and remove any extra characters from filename
        md5sums = '.md5sums'
        return sorted(glob(os.path.join(hhsuite_db_dir, f'*{md5sums}')), reverse=True)[0].replace(md5sums, '')
        # return sorted(os.listdir(hhsuite_db_dir), reverse=True)[0].replace(uniclust_hhsuite_file_identifier, '')
    except IndexError:
        return ''

make_path

make_path(path: AnyStr, condition: bool = True)

Make all required directories in specified path if it doesn't exist, and optional condition is True

Parameters:

  • path (AnyStr) –

    The path to create

  • condition (bool, default: True ) –

    A condition to check before the path production is executed

Source code in symdesign/utils/path.py
309
310
311
312
313
314
315
316
317
def make_path(path: AnyStr, condition: bool = True):
    """Make all required directories in specified path if it doesn't exist, and optional condition is True

    Args:
        path: The path to create
        condition: A condition to check before the path production is executed
    """
    if condition:
        os.makedirs(path, exist_ok=True)

ex_path

ex_path(*directories: Sequence[str]) -> AnyStr

Create an example path prepended with /path/to/provided/directories

Parameters:

  • directories (Sequence[str], default: () ) –

    Example: ('provided', 'directories')

Source code in symdesign/utils/path.py
320
321
322
323
324
325
326
def ex_path(*directories: Sequence[str]) -> AnyStr:
    """Create an example path prepended with /path/to/provided/directories

    Args:
        directories: Example: ('provided', 'directories')
    """
    return os.path.join('path', 'to', *directories)