SeqTutorial
The seq dtd is very simple. This is largely because it is very hard to get two biologists to agree on exactly what a seq dtd should contain. SO we've kept it to the basics. A sequence simply has an optional name, link, and/or residues. Additionally, there are required attributes for length and type (dna, rna or aa).
Note that we are using the bx-link:link dtd here (See the BioXMLTutorial). The first line describes the dtd's location, and the %link; imports it. Now we can put bx-link:link in the bx-seq:seq element:
This dtd's url is http://www.bioxml.org/dtds/current/seq.dtd.
<!ENTITY % link SYSTEM "link.dtd">
<!ELEMENT bx-seq:seq ( bx-seq:name?, bx-link:link?, bx-seq:residues? )>
<!ATTLIST bx-seq:seq
xmlns:bx-seq CDATA #FIXED "http://www.bioxml.org/dtds/seq/v0_1"
bx-seq:id ID #REQUIRED
bx-seq:length CDATA #IMPLIED
bx-seq:type (dna | rna | aa) #REQUIRED
>
%link;
<!ELEMENT bx-seq:name (#PCDATA)>
<!ELEMENT bx-seq:residues (#PCDATA)>
Again, an xml seq follows. Notice that this time instead of using a bx-link:simple_xlink, I've used a (bogus) genbank reference with bx-link:dbxref. You can validate this file with your java xerces (assuming you're running linux/unix) with the command:
- java sax.SAXCount -Nwv http://www.bioxml.org/samples/dna.xml The -v flag means validate. The -w is warmup the parser before timing and -N means turnoff namespaces so that FullyQualified? names don't give weird errors. This program doesn't do anything other than validate, count the tags in, and time the parsing of the document.
<?xml version="1.0"?>
<!DOCTYPE bx-seq:seq SYSTEM "http://www.bioxml.org/dtds/current/seq.dtd">
<bx-seq:seq xmlns:bx-seq="http://www.bioxml.org/dtds/seq/v0_1" bx-seq:id="b45" bx-seq:type="dna" >
<bx-link:link xmlns:bx-link="http://www.bioxml.org/dtds/bx-link/v0_1">
<bx-link:dbxref>
<bx-link:database bx-link:url='http://www.genbank.com'>Genbank</bx-link:database>
<bx-link:id bx-link:field='accession'>ae345</bx-link:id>
</bx-link:dbxref>
</bx-link:link>
<bx-seq:residues>aeiou</bx-seq:residues>
</bx-seq:seq>
Alright. Let's go to the FeatureTutorial.
--BradMarshall
Related pages: Unclassified?
|