Linux中国  设为主页
 收藏本站
 
当前位置: > 首页 ->编程语言 ->Perl ->LINUX
  相关分类: 
ASP
ViualBasic
UML / Rational Rose
PHP4/PHP5
Perl
JAVA/JSP教程
Delphi
ColdFusion
CGI
C/C++
ASP.NET
XML
  站内搜索: 
热门文章排行
热门文章排行 Perl的基本输入输出(06-05)
Perl文件及目录操作(06-05)
Perl语言全面编译(二)(06-05)
Perl常用系统函数(06-05)
用Perl来分析并生成中文Excel文件(06-05)
精采文章排行
精采文章排行 使用Perl连接Mysql数据库(06-05)
用Perl来分析并生成中文Excel文件(06-05)
受限制环境安装Perl模块方法(06-05)
PerlCookbook2介绍(06-05)
《极限编程》前言及第一章(06-05)
  ·用Perl来分析并生成中文Excel文件·受限制环境安装Perl模块方法·PerlCookbook2介绍·《极限编程》前言及第一章·Perl简单模块指南·如何使用strict和warnings·Perl小技巧:文件操作·构建一个Perl/CGI投票系统·LINUX

LINUX

作者:Webmaster   来源:Linuxdby.com   点击:   日期:2007-06-05 [收藏] [投稿]

  IE是否经常中毒?推荐您

摘要:

生物信息学(Bioinformatics)

生物信息学开始于科学家们将生物学数据以数字格式存放并且用程序来处理这些数据。很长一段时间以来,生物信息学都限制在序列的分析上。然而,随着构建分子的结构模型的重要性开始显现,电子计算机也开始成为理论生物化学的重要工具。每天都不断有关于分子3D信息和数据被采集,人们对基因的认识和研究也从单个的基因研究转变为从整体上或者扩展式的研究。由于生物信息学的发展,现在更容易理解蛋白质之间为何相互之间那样作用、又是如何通过新陈代谢来组织相互的。而且我们现在也越来越清醒的认识到组织好这些数据的重要性。

生物信息学里面至少有两点特征使她变得非常有趣。其一,生物信息学的研究目标是找出各种生命分子的关系;而这个目标恰恰是一个有趣的程序设计问题,因为这就需要我们联合并整合我们得到的那些信息,然后从中得到对生命活动的一些整体的和有效的一些认识。我们还发现,将计算机科学中的不同领域的知识结合起来是非常必要的,比如数据的管理和整合、高效可靠的算法和强劲的硬件--格点技术、多处理器的使用等。

Perl

LarryWall于1986年开始开发Perl。Perl是一种解释型的语言,是处理文本、文件和进程的强大的工具。Perl使得我们能够很快的开发出小程序。可以说,Perl是高级编程语言(例如C)和脚本语言(如bash)的一种有效组合。

Perl程序可以运行在多种操作系统/平台上,尽管Perl是在Unix上诞生并且快速发展的。由于Perl广泛的用于web程序设计,其发展很快便超出了其预想。在Perl之前,人们使用awk,thirstgrep来分析文件并提取信息。

Perl将这些UNIX上广泛使用的工具统一在一个程序里面,并将这些功能扩展和现代化以适应各种需求。

Perl是一种免费/自由的程序语言,可以运行在现代生物实验室里使用的各种操作系统上。在UNIX和MacOSX上,它是预安装好的,在其他系统上,得先安装好Perl。http://www.cpan.org网站上有安装和使用Perl的很多实用信息。

在Linux下,运行Perl程序,是将这个程序的文件名作为perl这个命令的一个参数,然后perl会依次解释执行这个程序里的命令。

另一种常用的方法,不需要运行perl这个命令,为此,我们需要做以下两件事:(a)在程序的文件里加入一行特殊的注释:

#!/usr/bin/envperl
print"Hi\n";

(b)保存此文件并给它加上可执行的属性:

chmod xgreetings.pl

这样,我们就可以直接通过文件名来运行这个程序:

./greetings.pl

用Perl来文件管理:

当我们有了文本格式的分子序列,我们可以用Perl写一个序列搜索工具。下面的例子我们可以看到如何在SWISS-PROT(db_human_swissprot)格式的数据库中用id码来查找蛋白质序列。

#!/usr/bin/perl
#Lookforaminoacidsequenceinadatabase
#SWISS-PROTformated,withagivenidcode
#AskforthecodeintheIDfield
#anditassignsitfromtheinput(STDIN)toavariable
print"EntertheIDtosearch:";$id_query=<STDIN>;chomp$id_query;#Weopenthedatabasefile
#butifitisn'tpossibletheprogramends
open(db,"human_kinases_swissprot.txt")||die"problemopeningthefilehuman_kinases_swissprot.txt\n";#Looklinebylineinthedatabase
while(<db>){chomp$_;#CheckifweareintheIDfieldif($_=~/^ID/){#Ifitispossitivewegathertheinformation
#breakingthelinebyspaces
($a1,$id_db)=split(/\s /,$_);#butifthereisnocoincidenceofIDwecontinuetothefollowing
nextif($id_dbne$id_query);#Whentheycoincide,weputamark
$signal_good=1;#Thenwecheckthesequencefield
#andifthemarkis1(chosensequence)#Ifpossitive,wechangethemarkto2,tocollectthesequence
}elsif(($_=~/^SQ/)&&($signal_good==1)){$signal_good=2;#Finally,ifthemarkis2,wepresenteachline
#ofthesequence,untilthelinebeginswith//#issuchcasewebrokethewhile}elsif($signal_good==2){lastif($_=~/^\/\//);print"$_\n";}}#Whenweleftthewhileinstructionwecheckthemark
#ifnegativethatmeansthatwedon'tfindthechosensequence
#thatwillgiveusanerror
if(!$signal_good){print"ERROR:"."Sequencenotfound\n";}#Finally,weclosethefile#thatstillsiopen
close(db);exit;


查找氨基酸的模式(Searchforaminoacidpatterns)

#!/usr/bin/perl#Searcherforaminoacidpatterns#Asktheuserthepatternsforsearchprint"Please,introducethepatterntosearchinquery.seq:";$patron=<STDIN>;chomp$patron;#Openthedatabasefile#butifitcan'titendstheprogramopen(query,"query_seq.txt")||die"problemopeningthefilequery_seq.txt\n";#LooklinebylinetheSWISS-PROTsequencewhile(<query>){chomp$_;#WhenarrivestotheSQfield,putthemarkin1
if($_=~/^SQ/){
$signal_seq=1;#Whenarrivetotheendofsequence,leavethecurl
#Checkthatthisexpressionisputbeforetocheck
#themark=1,becausethislinedoesn'tbelongtotheaminoacidsequence
}elsif($_=~/^\/\//){
last;#Checkthemarkifitisequalto1,ifpossitive
#eliminatetheblankspacesinthesequenceline
#andjoineverylineinanewvariable
#Toconcatenate,wealsocando:
#$secuencia_total.=$_;
}elsif($signal_seq==1){
$_=~s///g;
$secuencia_total=$secuencia_total.$_;
}
}#Nowcheckthesequence,collectedinitsentirety,
#forthegivenpattern
if($secuencia_total=~/$patron/){
print"Thesequencequery.seqcontainsthepattern$patron\n";
}else{
print"Thesequencequery.seqdoesn'tcontainsthepattern$patron\n";
}#Finallyweclosethefile
#andleavetheprogram
close(query);

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<

上一页12 3 下一页

上一篇:ADODB与PearDB的兼容部分   下一篇:构建一个Perl/CGI投票系统
文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论

   相关文章:
·使用Perl连接Mysql数据库

   文章评论:(1条)
  
 请留名: 匿名评论   点击查看所有评论 论坛讨论
 

 声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。