Package Bio :: Package LocusLink :: Module locus_format
[hide private]
[frames] | no frames]

Module locus_format

source code

Martel based parser to read LocusLink flat files.

This is a huge regular expression for LocusLink,
built using the 'regular expressions on steroids' capabilities of
Martel.

A description of the format can be found in the 'ligand.doc' file
from the Ligand distribution, available from:

 http://www.ncbi.nih.gov/LocusLink

Functions [hide private]
 
define_locus_line(entry_tag) source code
 
define_locus_group(entry_name, entry_tag) source code
Variables [hide private]
  INDENT = 12
  blank_spaces = Rep(Str1(" "))
  point = Str1(".")
  white_space = Rep(Any(" "))
  locus_keys = ['LOCUSID', 'LOCUS_CONFIRMED', 'LOCUS_TYPE', 'ORG...
  accnum_block_keys = ['ACCNUM', 'TYPE', 'PROT']
  phenotype = Str1('PHENOTYPE')
  db = Str1('DB')
  accnum_block_key = Str(* accnum_block_keys)
  valid_locus_key = Str(* locus_keys)
  accnum_block = Group('accnum_block', define_locus_line('ACCNUM...
  phenotype_block = Group('phenotype_block', define_locus_line('...
  db_block = Group('db_block', define_locus_line('DB_DESCR')+ de...
  begin_record_line = Str1('>>')+ ToEol()
  locus_line = Group('locus_line', white_space+ AssertNot(accnum...
  locus_record = begin_record_line+ Rep(Alt(locus_line, accnum_b...
Variables Details [hide private]

locus_keys

Value:
['LOCUSID',
 'LOCUS_CONFIRMED',
 'LOCUS_TYPE',
 'ORGANISM',
 'STATUS',
 'NM',
 'NP',
 'CDD',
...

accnum_block

Value:
Group('accnum_block', define_locus_line('ACCNUM')+ define_locus_line('\
TYPE')+ Opt(define_locus_line('PROT')))

phenotype_block

Value:
Group('phenotype_block', define_locus_line('PHENOTYPE')+ Opt(define_lo\
cus_line('PHENOTYPE_ID')))

db_block

Value:
Group('db_block', define_locus_line('DB_DESCR')+ define_locus_line('DB\
_LINK'))

locus_line

Value:
Group('locus_line', white_space+ AssertNot(accnum_block_key)+ AssertNo\
t(phenotype)+ AssertNot(db)+ Word()+ white_space+ Str1(':')+ ToEol())

locus_record

Value:
begin_record_line+ Rep(Alt(locus_line, accnum_block, phenotype_block, \
db_block))