免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1352 | 回复: 1
打印 上一主题 下一主题

新手求助:指定行正则匹配问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-03-13 16:10 |只看该作者 |倒序浏览
数据格式如下:
22690. STPG1
Official Symbol: STPG1 and Name: sperm-tail PG-rich repeat containing 1[Homo sapiens]
Other Aliases: RP3-462O23.2, C1orf201, MAPO2
Other Designations: O(6)-methylguanine-induced apoptosis 2; O6-methylguanine-induced apoptosis 2; UPF0490 protein C1orf201; sperm-tail PG-rich repeat-containing protein 1
Chromosome: 1; Location: 1p36.11
Annotation: Chromosome 1NC_000001.10 (24683489..24741587, complement)
ID: 90529

22691. IGHV4-4
Official Symbol: IGHV4-4 and Name: immunoglobulin heavy variable 4-4[Homo sapiens]
Other Aliases: IGHV44, VH
Chromosome: 14; Location: 14q32.33
Annotation: Chromosome 14NC_000014.8 (106478108..106478539, complement)
ID: 28401

22692. U86
interacts with basal transcriptional machinery and cellular transcription factors; specific DNA-binding protein[Human herpesvirus 6A]
Other Aliases: HHV6gp082
Other Designations: regulatory protein IE2
Annotation: NC_001664.2 (125960..130044, complement)
ID: 1487966

22693. U62
protein UL91[Human herpesvirus 6A]
Other Aliases: HHV6gp061
Annotation: NC_001664.2 (98427..101815)
ID: 1487943

22694. OR13C2
Official Symbol: OR13C2 and Name: olfactory receptor, family 13, subfamily C, member 2[Homo sapiens]
Other Aliases: OR37K
Other Designations: olfactory receptor 13C2; olfactory receptor OR9-12
Chromosome: 9; Location: 9q31.1
Annotation: Chromosome 9NC_000009.11 (107366952..107367908, complement)
ID: 392376

以上是基因信息数据,欲提取出物种为Homo sapiens 即人类的基因Official Symbol
具体来说 对于每一基因而言 如果是[Homo sapiens]的就将该基因提取出来放到另一个文件中。

刚开始学习perl,请各位高手不吝赐教呀~~谢谢啦!!!

论坛徽章:
7
戌狗
日期:2013-12-15 20:43:38技术图书徽章
日期:2014-03-05 01:33:12技术图书徽章
日期:2014-03-15 20:31:17未羊
日期:2014-03-25 23:48:20丑牛
日期:2014-04-07 22:37:44巳蛇
日期:2014-04-11 21:58:0915-16赛季CBA联赛之青岛
日期:2016-03-17 20:36:13
2 [报告]
发表于 2013-03-13 16:50 |只看该作者
  1. #!/usr/bin/perl
  2. $/ = "\n\n";
  3. while (<>) {
  4.     print if /\[Homo sapiens\]$/m;
  5. }
复制代码
  1. perl abc.pl data > homo
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP