摘要: 完整代码:use strict;use warnings;my ($tss, $cluster, $out) = @ARGV;die $! unless (@ARGV ==3);open OUT,">$out";open TSS, $tss;my (%ftss, %rtss);while (<TSS>){ chomp; my ($s, $e, $str) = (split /\s+/, $_)[1,2,3]; if ($str eq "+"){ $ftss{$e} = $s; } elsif ($str eq "-" 阅读全文
posted @ 2012-08-09 22:06 Puriney 阅读(209) 评论(0) 推荐(0) 编辑
摘要: http://bnuzhutao.cn/archives/788全文转载,归http://bnuzhutao.cn/about-me(1)求数组的和:不需要一个一个地累加,直接调用 sum 函数useList::Utilqw/sum/;my@array=(10,20,30,40);my$sum=sum@array;# 得到 100(2)求数组的最大、最小值:不需要逐个比较,直接调用 max 和 min 函数useList::Utilqw/max min/;my@array=(10,-1,6,25,8);my$max=max@array;# 得到 25my$min=min@array;# 得到 阅读全文
posted @ 2012-08-09 13:59 Puriney 阅读(326) 评论(1) 推荐(1) 编辑
摘要: http://hi.baidu.com/jackywdx/blog/item/2664ff16d3638e55f2de3279.htmlgrep函数(如果你是个Perl的新手,你可以先跳过下面的两段,直接到 Grep vs.loops 样例这一部分,放心,在后面你还会遇到它)<pre>grepBLOCKLISTgrepEXPR,LIST</pre>grep 函数会用LIST中的元素对BLOCK或 EXPR 求值,而且会把局部变量 $_ 设置为当前所用的LIST中的元素。BLOCK 块是一个或多个由花括号分隔开的Perl 语句,而 List 则是一有序列表。EXPR 是一 阅读全文
posted @ 2012-08-09 11:36 Puriney 阅读(264) 评论(0) 推荐(0) 编辑
摘要: reads_classifier.pl 1 #!/usr/bin/perl 2 #=============================================================================== 3 # 4 # FILE: reads_classifier.pl 5 # 6 # USAGE: ./reads_classifier.pl 7 # 8 # DESCRIPTION: 9 # 10 # OPTIONS: --- 11 # REQUIREMENTS: --- 12 # ... 阅读全文
posted @ 2012-07-19 19:21 Puriney 阅读(199) 评论(0) 推荐(0) 编辑
摘要: sam2bed.pl 1 #!/usr/bin/perl -w 2 # 3 ######################################## 4 # 5 # File Name: 6 # sam2bed.pl 7 # 8 # Description: 9 # 10 # 11 # Usage:12 # 13 # 14 # Author:15 # Xi Wang, wang-xi05@mails.thu.edu.cn16 # 17 # Date:18 # Mon Nov 2 23:08:26 CST 200919 #20 ##################... 阅读全文
posted @ 2012-07-16 18:43 Puriney 阅读(502) 评论(0) 推荐(0) 编辑
摘要: 本来呢,samtools本来就可以一句话就能提取,只是没得网络没得下载samtools,只能保留自传脚本。输入文件为raw.sam输出为提取uniq reads后的uniq.sam(仍然保留着sam格式)终端里会打印出简单的报告 1 use strict; 2 use warnings; 3 4 my ($in, $out) = @ARGV; 5 die <DATA> unless (@ARGV == 2); 6 open IN, "$in"; 7 open OUT, ">$out"; 8 9 my ($sum, $uniq, $xnd 阅读全文
posted @ 2012-07-16 16:57 Puriney 阅读(741) 评论(0) 推荐(0) 编辑