Module: ncbi.datasets.metadata.genome

Utility functions for working and reporting on assembly data descriptors.

Module: ncbi.datasets.metadata.genome

Utility functions for working and reporting on assembly data descriptors.
ncbi.datasets.metadata.genome.print_assembly_warning_or_error(assembly_match: ncbi.datasets.openapi.model.v1_assembly_match.V1AssemblyMatch)

Reports assembly warnings and/or errors per query term

Parameters

assembly_match – A single assembly metadata record returned by the API

Returns

None

Side Effects:

Prints report to stdout.

ncbi.datasets.metadata.genome.assembly_values_by_fields(assembly: ncbi.datasets.openapi.model.v1_assembly_dataset_descriptor.V1AssemblyDatasetDescriptor, fields=typing.List[str])

Filters assembly descriptor for provided fields

Parameters
  • assembly_descriptor – A single assembly descriptor record returned by the API

  • fields – List of top-level fields to allow into returned dict

Returns

dict of supplied fields to their values

Side Effects:

Prints report to stdout.

ncbi.datasets.metadata.genome.print_assembly_metadata_by_fields(assembly_match: ncbi.datasets.openapi.model.v1_assembly_match.V1AssemblyMatch, fields=typing.List[str])

Reports selected fields for a V1AssemblyMatch object to stdout

Warning/Error code will be printed if the supplied assembly object does not contain a assembly field.

Parameters
  • assembly_match – A single assembly metadata record returned by the API

  • fields – A list of top-level field names to display. If set to None, print the entire object.

Returns

None

Side Effects:

Prints report to stdout.

ncbi.datasets.metadata.genome.get_assembly_metadata_by_taxon(taxon: Union[str, int], **kwargs)

Return iterable assembly metadata for a taxon

Warning/Error code will be printed if the supplied taxon has no assembly.

Parameters

taxon

Returns

iterable assemblies

Side Effects:

Prints error to stdout.

ncbi.datasets.metadata.genome.get_assembly_metadata_by_asm_accessions(genome_assembly_accessions: List[str], **kwargs)

Return iterable assembly metadata for a list of assembly accessions

Warning/Error code will be printed if the supplied accessions are invalid.

Parameters

genome_assembly_accessions – A list of NCBI assembly accessions

Returns

iterable assemblies

Side Effects:

Prints error to stdout.

ncbi.datasets.metadata.genome.get_assembly_metadata_by_bioproject_accessions(bioproject_accessions: List[str], **kwargs)

Return iterable assembly metadata for a list of BioProject accessions

Warning/Error code will be printed if the supplied BioProject has no assembly.

Parameters

bioproject_accessions – A list of NCBI bioproject accessions

Returns

iterable assemblies

Side Effects:

Prints error to stdout.

ncbi.datasets.metadata.genome.iterate_reply(genome_api_func, func_arg, **kwargs)
Generated November 19, 2021