[TIPS] adding hypertext links

Heikki Lehvaslaiho heikki at ebi.ac.uk
Sat Jul 18 14:31:19 EST 1998

A couple of tips for you writing parsers.


Hypertext links are usually added into documents by writing a $href into
srsdb.i file and invoked from icarus productions using the $Rep
function. Instead of writing a new $href for every a new database link
and cluttering the srsdb.i file, you could use a generic one which is
already defined (in v. 5.1.0.):

$href:[entryR       link:"<A HREF=wgetz?-e+[%s-%s:%s]>%s</A>"]

and call that from SRS e.g.

  h_pt:     ~ {$In:[fields c:pt t:html]}
              'PT'  (word {$Rep:{$ParStr:entryR 'rebase' 'id' $Ct $Ct}}
                     |noword)* ~

to parse line like

PT   HindIII


Whenever you have a literature reference containing the name or
standardized abbreviation of the journal, volume and first page of the
article, you can create a link PubMed using a predefined link.

$href:[pubmedR      link: |<A

  h_ref:     ~  {$In:[fields c:rl t:html] $Out } 
                #           journal  vol       first page
                /..[ ]+/ (/([^0-9]+)([0-9]+): ?([0-9]+)[^\n]+/
                {$j=$StrRep:[$1 from:'.' to:'+']
                 $j=$StrRep:[$j from:'&' to:'']
                 $j=$StrRep:[$j from:' ' to:'+']
                 $j=$StrRep:[$j from:'++' to:'+']
                 $j=$Trim:[$j skip:'+']
                 $Rep:{$ParStr:pubmedR $j $2 $3 $Ct}} |/./)*

to add hypertext link to a line like:

RL   J. Mol. Biol. 132:133-139(1979).

More information and other options of the NCBI Citation Matcher page at

Have fun, 

______ _/      _/_____________________________________________________
      _/      _/                      http://www2.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho          heikki at ebi.ac.uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________

More information about the Bio-srs mailing list

Send comments to us at biosci-help [At] net.bio.net