« PIFdb --> SRS (1) | 首页 | 2004/05/04 »

May 01, 2004

PIFdb --> SRS (2)


xigua
23:02 PM


本以为51没得玩了,想不到,花了一天,竟然完成了,现在SRS上的PIFdb数据库已经可以正常使用了。哈哈哈,数据库也不过如此嘛,还以为有多高深呢。不过,我也付出了代价,晚饭也没有吃。

最终写成了这样三个文件:
pif.is

以下内容为程序代码:
#!/bin/env icarus
$rules={
# the entry
entry: ~ {$In:[file:text] $Out pre $Skip:0}
('ID' {$Not} ln)*
('ID' {$entryFip=$Fip $Wrt} ln {$App}
('ID' {$Not} ln {$App})*)?
~
ln: ~ /[^\n]*\n/ ~
# the datafields
fields:~ {$In:entry $Out $Skip:1}
f_id f_xx* f_de?
~
f_id: ~ {$Wrt:id} 'ID' ln ~
f_xx: ~ {$Wrt:xx} 'XX' ln ('XX' ln)* ~
f_de: ~ {$Wrt:de} 'DE' ln ('DE' ln)* ~
f_ac: ~ {$Wrt:ac} 'AC' ln ~
f_dt: ~ {$Wrt:dt} 'DT' ln ('DT' ln)* ~
f_os: ~ {$Wrt:os} 'OS' ln ~
f_oc: ~ {$Wrt:oc} 'OC' ln ('OC' ln)* ~
f_dr: ~ {$Wrt:dr} 'DR' ln ~ #EMBL Number
f_fl: ~ {$Wrt:fl} 'FL' ln ~
f_if: ~ {$Wrt:if} 'IF' ln ('IF' ln)* ~
f_ad: ~ {$Wrt:ad} 'AD' ln ~
f_sq: ~ {$Wrt:sq} 'SQ' ln (' ' ln)* ~
# indexing
tag: ~ /../ ~
word: ~ /[a-zA-Z0-9_]+/ ~
noword: ~ /[^a-zA-Z0-9_]+/ ~
i_id: ~ {$In:[fields c:id] $Out:id}
tag word {$Wrt} ~
i_de: ~ {$In:[fields c:de] $Out:de}
tag (word {$Wrt}|noword)* ~
i_ac: ~ {$In:[fields c:ac] $Out:ac}
tag word {$Wrt} ~
i_dt: ~ {$In:[fields c:dt] $Out:dt}
tag (word {$Wrt}|noword)* '\n'
(tag (word {$Wrt}|noword)* '\n'[img]/images/wink.gif[/img]* ~
i_os: ~ {$In:[fields c:os] $Out:os}
tag (word {$Wrt}|noword)* '\n'
(tag (word {$Wrt}|noword)* '\n'[img]/images/wink.gif[/img]* ~
i_oc: ~ {$In:[fields c:oc] $Out:oc}
tag (word {$Wrt}|noword)* '\n'
(tag (word {$Wrt}|noword)* '\n'[img]/images/wink.gif[/img]* ~
i_dr: ~ {$In:[fields c:dr] $Out:dr}
tag 'EMBL;' word{$Wrt} ~
i_fl: ~ {$In:[fields c:fl] $Out:fl}
tag word{$Wrt} ~
i_ad: ~ {$In:[fields c:ad] $Out:ad}
tag /\S*/ {$Wrt} ~
}
# testing
if: $TestMode {
$job = $Job:[prod:$rules
skip:' \t'
fileName:"/home/database/pif/os.pif"]
while:$job.hasInput {
#$job.tokens:[entry print:y]
#$job.tokens:[fields print:y]
$job.tokens:[de print:y]
$job.tokens:[ad print:y]
$job.reset
}
}
job.reset
}
}

pif.i


以下内容为程序代码:
$PIF_DB=$Library:[PIFDB group:$PIF_LIBS
res:$PIF_RES
format:$PIF_FORMAT maxNameLen:30
searchName:'*.pif'
# files:{
# $LibFile:os
# }
]
$PIF_FORMAT=$LibFormat:[fileType:$PIF_FILE syntax:$PIF_SYNTAX
fields:{
$Field:[$DF_ALL]
$Field:[$DF_ID code:id index:id indexToken:id]
$Field:[$DF_Description code:de index:str indexToken:de]
$Field:[$DF_PIF_ACC code:ac index:str indexToken:ac]
$Field:[$DF_Date code:dt index:str indexToken:dt]
$Field:[$DF_Organism code:os index:str indexToken:os]
$Field:[$DF_OC code:oc index:str indexToken:oc]
$Field:[$DF_EMBL_ACC code:dr index:str indexToken:dr]
$Field:[$DF_FL code:fl index:str indexToken:fl]
$Field:[$DF_AD code:ad index:str indexToken:ad]
}
]

$PIF_SYNTAX=$Syntax:[file:"SRSDB[img]/images/tongue.gif[/img]if.is" ignore:' \t']

$PIF_FILE=$FileType:[text maxline:100
]


pif.it


以下内容为程序代码:
$PIF_RES=$Resource:[
description:
|PIFdb ( A Database of Potential Transcription Initiation Frequency [img]/images/wink.gif[/img]

| Current Release 1

|PIFdb is a database of potential transcription initiation frequency develop |ed and maintained by the Institute of Bioinformatics (IBI-ZJU), Zhejiang University, China.
www:
|The homepage of PIFdb ( http://ibi.zju.edu.cn/bioinplant/pif/pif_homepage.htm [img]/images/wink.gif[/img]
]

Posted by 西瓜 at May 1, 2004 11:02 PM

Comments

Post a comment




Remember Me?