Taxon

public struct Taxon : TaxonRepresenting

The Taxon struct represents a record downloaded from the NCBI’s Taxonomy database.

  • The internal NCBI identifier for the record.

    Declaration

    Swift

    public let identifier: TaxonID
  • The internal NCBI identifier for the record’s closest ancestor.

    Since

    TaxonomyKit 1.9.

    Declaration

    Swift

    public var parentIdentifier: TaxonID?
  • The scientific name of the record.

    Declaration

    Swift

    public let name: String
  • The rank of the record or nil if the record has no rank.

    Declaration

    Swift

    public let rank: TaxonomicRank?
  • The common names defined for the record, sorted as parsed.

    Since

    TaxonomyKit 1.2.

    Declaration

    Swift

    public var commonNames: [String]
  • The Genbank common name of the record or nil if not set.

    Since

    TaxonomyKit 1.2.

    Declaration

    Swift

    public var genbankCommonName: String?
  • The synonyms defined for this taxon, sorted as parsed.

    Since

    TaxonomyKit 1.2.

    Declaration

    Swift

    public var synonyms: [String]
  • The name of the main genetic code used by this record and its descendants.

    Declaration

    Swift

    public let geneticCode: String
  • The name of the mitochondrial genetic code used by this record and its descendants, or nil if the record has no mitochondrial code.

    Declaration

    Swift

    public let mitochondrialCode: String?
  • The lineage elements for the record.

    Declaration

    Swift

    public var lineageItems: [TaxonLineageItem]
  • Initializes a new Taxon using its defining parameters. Common name and lineage items may be specified later.

    Declaration

    Swift

    public init(identifier: TaxonID, name: String, rank: TaxonomicRank?,
                geneticCode: String, mitochondrialCode: String)

    Parameters

    identifier

    The internal NCBI identifier for the record.

    name

    The scientific name of the record.

    rank

    The rank of the record. If you pass a ‘no rank’ string, the rank property will be set to nil.

    geneticCode

    The name of the main genetic code used by the record.

    mitochondrialCode

    The name of the mitochondrial code used by the record. If you pass a ‘Unspecified’ string, the mitochondrialCode property will be set to nil.

    Return Value

    The initialized Taxon struct.

  • Returns true if the rank property is set. If rank is nil, this will return false instead.

    Declaration

    Swift

    public var hasRank: Bool { get }
  • url

    The HTTPS URL where the record can be found.

    Declaration

    Swift

    public var url: URL { get }