Plasmid from GenBank: pUC19

The GenBank record L09137 (pUC19, circular) becomes a Plasmid. The record only annotates its source: the polylinker, lacZ-alpha and the beta-lactamase are added as features, at the positions its COMMENT gives.

1

Starting code

This is the PHP code used by this example.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
private function loadPuc19(GenbankPlasmidMapperInterface $genbankPlasmidMapper): Plasmid
{
    $parser = DatabaseParserFactory::createParser("GENBANK");
    $parser->parseDataFile(file($this->getParameter('kernel.project_dir') . '/public/data/pUC19.gb'));
 
    // A circular GenBank record becomes a Plasmid
    $oPlasmid = $genbankPlasmidMapper
        ->map($parser->getSequence(), $parser->getGbSequence(), $parser->getFeatures())
        ->getPlasmid();
 
    // L09137 only annotates its source: add the features its COMMENT describes
    return $oPlasmid
        ->withFeature(new PlasmidFeature("lacZ-alpha", FeatureType::CDS, 146, 469, Strand::REVERSE, "#2E86C1", null, null, null, 0))
        ->withFeature(new PlasmidFeature("MCS", FeatureType::MISC_FEATURE, 396, 452, Strand::NONE, "#F39C12",
            "HindIII-SphI-PstI-SalI-XbaI-BamHI-SmaI-KpnI-SacI-EcoRI"))
        ->withFeature(new PlasmidFeature("bla", FeatureType::CDS, 1626, 2486, Strand::REVERSE, "#C0392B",
            "Ampicillin resistance, beta-lactamase TEM-1", null, null, 0));
}
 
public function plasmid(
    GenbankPlasmidMapperInterface $genbankPlasmidMapper,
    FeatureOverlapInterface $featureOverlapManager,
    AlternateGeneticCodeTranslatorInterface $geneticCodeTranslator
) {
    $oPlasmid = $this->loadPuc19($genbankPlasmidMapper);
 
    // Translate the beta-lactamase with the bacterial genetic code (NCBI table 11)
    $oBla = $oPlasmid->getFeaturesByType(FeatureType::CDS)[1];
    $sBlaDna = $oPlasmid->extractFeatureSequence($oBla)->getValue(); // reverse complemented
    $sBlaProtein = "";
    foreach (str_split($sBlaDna, 3) as $sCodon) {
        $sBlaProtein .= $geneticCodeTranslator->translateCodon($sCodon, 11);
    }
 
    // Which features cover the EcoRI site (396), and which ones overlap each other?
    $aAtEcoRI = $featureOverlapManager->findFeaturesAtPosition($oPlasmid, 396);
    $aOverlaps = $featureOverlapManager->findOverlappingPairs($oPlasmid);
 
    // Move the origin into bla: the feature now crosses it, and keeps its sequence
    $oRotated = $oPlasmid->rotateToOrigin(2000);
 
    return $this->render('default/cloningPlasmid.html.twig', [
        'plasmid'     => $oPlasmid,
        'blaProtein'  => $sBlaProtein,
        'atEcoRI'     => $aAtEcoRI,
        'overlaps'    => $aOverlaps,
        'rotated'     => $oRotated,
    ]);
}
2

Result

Result returned by BioPHP for the demonstration data.

Plasmid
NameL09137
DescriptionCloning vector pUC19c, complete sequence.
Length2686 bp
G+C content50.63 %
Features
Name Type Start / End Strand Length Note
■ lacZ-alpha CDS 146 / 469 REVERSE 324 bp
■ MCS MISC_FEATURE 396 / 452 NONE 57 bp HindIII-SphI-PstI-SalI-XbaI-BamHI-SmaI-KpnI-SacI-EcoRI
■ bla CDS 1626 / 2486 REVERSE 861 bp Ampicillin resistance, beta-lactamase TEM-1
Beta-lactamase, translated with the bacterial genetic code (NCBI table 11)

286 amino acids, read on the complementary strand

MSIQHFRVALIPFFAAFCLPVFAHPETLVKVKDAEDQLGARVGYIELDLNSGKILESFRPEERFPMMSTFKVLLCGAVLSRIDAGQEQLGRRIHYSQNDLVEYSPVTEKHLTDGMTVRELCSAAITMSDNTAANLLLTTIGGPKELTAFLHNMGDHVTRLDRWEPELNEAIPNDERDTTMPVAMATTLRKLLTGELLTLASRQQLIDWMEADKVAGPLLRSALPAGWFIADKSGAGERGSRGIIAALGPDGKPSRIVVIYTTGSQATMDERNRQIAEIGASLIKHW*
Feature overlaps
Features covering the EcoRI site (396) lacZ-alpha, MCS
Overlapping features lacZ-alpha ↔ MCS
Origin moved to position 2000
Name Start / End Crosses the origin Same sequence as before
lacZ-alpha 833 / 1156 No Yes
MCS 1083 / 1139 No Yes
bla 2313 / 487 Yes Yes

The code above is the one actually executed by this page. Find the other examples in the left-hand column, or the tools in BioTools.