wags_tails.ncbi#

Provide data fetching for NCBI gene data sources.

class wags_tails.ncbi.NcbiGenomeData(data_dir=None, silent=True)[source]#

Provide access to NCBI genome file.

__init__(data_dir=None, silent=True)[source]#

Set common class parameters.

Parameters:
  • data_dir (Optional[Path]) – direct location to store data files in, if specified. See get_data_dir() in the storage_utils module for further configuration details.

  • silent (bool) – if True, don’t print any info/updates to console

get_latest(from_local=False, force_refresh=False)[source]#

Get path to latest version of data.

Provides logic for both versioned and unversioned data here, rather than in the UnversionedDataSource child class, to support CustomData instances regardless of whether they’re versioned.

Parameters:
  • from_local (bool) – if True, use latest available local file

  • force_refresh (bool) – if True, fetch and return data from remote regardless of whether a local copy is present

Return type:

Tuple[Path, str]

Returns:

Path to location of data, and version value of it

Raises:

ValueError – if both force_refresh and from_local are True

class wags_tails.ncbi.NcbiGenePaths(gene_info: Path, gene_history: Path)[source]#

Container for NCBI Gene file paths.

gene_info: Path[source]#

Alias for field number 0

gene_history: Path[source]#

Alias for field number 1

class wags_tails.ncbi.NcbiGeneData(data_dir=None, silent=True)[source]#

Provide access to NCBI Gene data.

get_latest(from_local=False, force_refresh=False)[source]#

Get path to latest version of data, and its version value

Parameters:
  • from_local (bool) – if True, use latest available local file

  • force_refresh (bool) – if True, fetch and return data from remote regardless of whether a local copy is present

Return type:

Tuple[NcbiGenePaths, str]

Returns:

Paths to data, and version value of it

Raises:

ValueError – if both force_refresh and from_local are True

__init__(data_dir=None, silent=True)[source]#

Set common class parameters.

Parameters:
  • data_dir (Optional[Path]) – direct location to store data files in, if specified. See get_data_dir() in the storage_utils module for further configuration details.

  • silent (bool) – if True, don’t print any info/updates to console