Insert a sequence into a database, and loads a array of objects
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 | public function parseaswissprotdb(DatabaseInterface $databaseManager) { $databaseManager->recording("humandbSwiss", "SWISSPROT", "basicswiss.txt"); // fetch() returns the parser that read the record, not the Sequence itself $oSequence = $databaseManager->fetch("1375", "data/")->getSequence(); // New in biophp 1.1: wrap the parsed record into a validated amino acid value object $oMolecularSequence = MolecularSequenceFactory::fromEntity($oSequence); $bHasUnknownResidue = $oMolecularSequence->hasUnknownResidue(); return $this->render('default/parseswissprotdb.html.twig', ["sequence" => $oSequence, "hasUnknownResidue" => $bHasUnknownResidue] ); } |
2
Result
Result returned by BioPHP for the demonstration data.
Parsed record
| Primary accession | P01375 |
|---|---|
| Entry name | TNFA |
| Length | 233 |
| Start / End | / |
| Molecule type | PRT; |
| Date | 21-JUL-1986 |
| Source | HOMO SAPIENS (HUMAN) |
| Description | TUMOR NECROSIS FACTOR PRECURSOR (TNF-ALPHA) (CACHECTIN). |
| Organism |
|
| Fragment | 0 |
| Sequence | MSTESMIRDVELAEEALPKKTGGPQGSRRCLFLSLFSFLIVAGATTLFCLLHFGVIGPQREEFPRDLSLISPLAQAVRSSSRTPSDKPVAHVVANPQAEGQLQWLNRRANALLANGVELRDNQLVVPSEGLYLIYSQVLFKGQGCPSTHVLLTHTISRIAVSYQTKVNLLSAIKSPCQRETPEGAEAKPWYEPIYLGGVFQLEKGDRLSAEINRPDYLDFAESGQVYFGIIAL |
New in biophp 1.1: does it hold an unknown residue, computed by wrapping the record into an AminoAcidSequence value object ?
No
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.