Documentation

GenbankPlasmidMapper implements GenbankPlasmidMapperInterface

`ParseGenbankManager` emits one `Feature` row per `/qualifier=value` line, several rows sharing the same key/coordinates/strand for a single GenBank feature ; this class groups them back into one PlasmidFeature each. Coordinates from `Feature::getFtFrom()/getFtTo()` are already 1-based inclusive, GenBank's own convention, and a single-segment `complement(4900..100)` wrap already comes through as `from > to`, matching PlasmidFeature's own origin-crossing convention : both pass straight through with no conversion.

A join() crossing the origin (join(4900..5000,1..100), or its complement) of a record whose LOCUS line says "circular" comes through as from > to as well : ParseDbAbstractManager::parseLocationBounds() follows the order in which the segments are transcribed. GenbankWriter writes such a feature back as that join(). A plain range is read on the direct strand, as INSDC defines it, unless it carries /biophp_strand="none", GenbankWriter's mark of a Strand::NONE feature ; a location lying on both strands is Strand::NONE as well. Any feature that comes through with missing or non-representable coordinates (e.g. a location made only of segments of another entry) is skipped and reported in GenbankImportResult::getWarnings(), never silently dropped or truncated. Class GenbankPlasmidMapper

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Interfaces

GenbankPlasmidMapperInterface
Interface GenbankPlasmidMapperInterface - transforms an already-parsed GenBank record into a Plasmid, controlled and reversible, never touching the parser itself.

Constants

CIRCULAR_TOPOLOGY  : mixed = "CIRCULAR"
FEATURE_TYPE_BY_GENBANK_KEY  : array<string, string> = ["CDS" => \Amelaye\BioPHP\Domain\Cloning\ValueO...
GenBank feature keys that map unambiguously onto a FeatureType. Anything else (including "gene", which names a broader region than any single FeatureType here) falls back to FeatureType::MISC_FEATURE, with the original key preserved in metadata rather than guessed at.
FEATURE_TYPE_BY_REGULATORY_CLASS  : array<string, string> = ["promoter" => \Amelaye\BioPHP\Domain\Cloning\V...
Since 15-DEC-2014 INSDC annotates a promoter or a terminator as a "regulatory" feature with a /regulatory_class qualifier, the old "promoter"/"terminator" keys being deprecated ; any other class (enhancer, ribosome_binding_site...) has no FeatureType here and stays a MISC_FEATURE.
SINGLE_VALUED_QUALIFIERS  : array<string|int, string> = ["gene", "label", "locus_tag", "codon_start", "...
Qualifiers a feature holds once at most (INSDC Feature Table Definition) : seen again among rows sharing a location, they open the next feature.
SKIPPED_GENBANK_KEYS  : array<string|int, string> = ["source"]
"source" describes the whole input molecule, not a plasmid annotation worth its own feature.

Methods

map()  : GenbankImportResult
groupFeatures()  : array<string|int, mixed>
Groups the flat, one-row-per-qualifier Feature list back into one entry per GenBank feature.
isSplitLocation()  : bool
Tells whether a location joins segments with a gap between them (the exons of a spliced CDS), which a PlasmidFeature, one start and one end, cannot hold : only a join() crossing the origin, its two segments meeting there, can be represented.
mapFeature()  : PlasmidFeature

Constants

FEATURE_TYPE_BY_GENBANK_KEY

GenBank feature keys that map unambiguously onto a FeatureType. Anything else (including "gene", which names a broader region than any single FeatureType here) falls back to FeatureType::MISC_FEATURE, with the original key preserved in metadata rather than guessed at.

private array<string, string> FEATURE_TYPE_BY_GENBANK_KEY = ["CDS" => \Amelaye\BioPHP\Domain\Cloning\ValueObject\FeatureType::CDS, "promoter" => \Amelaye\BioPHP\Domain\Cloning\ValueObject\FeatureType::PROMOTER, "terminator" => \Amelaye\BioPHP\Domain\Cloning\ValueObject\FeatureType::TERMINATOR, "rep_origin" => \Amelaye\BioPHP\Domain\Cloning\ValueObject\FeatureType::ORIGIN_OF_REPLICATION, "misc_feature" => \Amelaye\BioPHP\Domain\Cloning\ValueObject\FeatureType::MISC_FEATURE]

"oriT" in particular is the origin of transfer, where conjugative transfer starts, not an origin of replication : it is deliberately left out and stays a MISC_FEATURE.

FEATURE_TYPE_BY_REGULATORY_CLASS

Since 15-DEC-2014 INSDC annotates a promoter or a terminator as a "regulatory" feature with a /regulatory_class qualifier, the old "promoter"/"terminator" keys being deprecated ; any other class (enhancer, ribosome_binding_site...) has no FeatureType here and stays a MISC_FEATURE.

private array<string, string> FEATURE_TYPE_BY_REGULATORY_CLASS = ["promoter" => \Amelaye\BioPHP\Domain\Cloning\ValueObject\FeatureType::PROMOTER, "terminator" => \Amelaye\BioPHP\Domain\Cloning\ValueObject\FeatureType::TERMINATOR]

SINGLE_VALUED_QUALIFIERS

Qualifiers a feature holds once at most (INSDC Feature Table Definition) : seen again among rows sharing a location, they open the next feature.

private array<string|int, string> SINGLE_VALUED_QUALIFIERS = ["gene", "label", "locus_tag", "codon_start", "regulatory_class", \Amelaye\BioPHP\Domain\Cloning\Service\Writer\GenbankWriter::UNSTRANDED_QUALIFIER]

SKIPPED_GENBANK_KEYS

"source" describes the whole input molecule, not a plasmid annotation worth its own feature.

private array<string|int, string> SKIPPED_GENBANK_KEYS = ["source"]

Methods

map()

public map(Sequence $oSequence, GbSequence $oGbSequence, array<string|int, mixed> $aFeatures) : GenbankImportResult
Parameters
$oSequence : Sequence

The parsed record's sequence and metadata

$oGbSequence : GbSequence

The parsed record's GenBank-specific header, whose topology decides whether mapping is even attempted

$aFeatures : array<string|int, mixed>

The parsed record's feature table rows, several per feature (one per qualifier)

Tags
inheritDoc
Return values
GenbankImportResult

groupFeatures()

Groups the flat, one-row-per-qualifier Feature list back into one entry per GenBank feature.

private groupFeatures(array<string|int, Feature> $aFeatures) : array<string|int, mixed>

The parser writes the rows of a feature one after the other, sharing its key, location and strand - there is no other feature-instance identifier - so a group is a run of consecutive rows with the same (ftKey, ftFrom, ftTo, strand, ftLocation). Two features at the same location follow each other : the second one starts where the first qualifier of the group comes again, or where a qualifier a feature holds once at most (SINGLE_VALUED_QUALIFIERS : a second /gene, /label, /codon_start...) does. Every qualifier value of a group is collected.

Parameters
$aFeatures : array<string|int, Feature>
Return values
array<string|int, mixed> —

Each entry: ["key" => string, "from" => ?int, "to" => ?int, "strand" => ?string, "location" => ?string, "qualifiers" => array<string,string[]>]

isSplitLocation()

Tells whether a location joins segments with a gap between them (the exons of a spliced CDS), which a PlasmidFeature, one start and one end, cannot hold : only a join() crossing the origin, its two segments meeting there, can be represented.

private isSplitLocation(string|null $sLocation, int $iLength) : bool
Parameters
$sLocation : string|null

The location as written

$iLength : int

The plasmid length

Return values
bool
On this page

Search results