diff nibls.pl @ 19:e0884a4b996b draft

Uploaded
author big-tiandm
date Wed, 05 Nov 2014 01:17:26 -0500
parents 07745c0958dd
children
line wrap: on
line diff
--- a/nibls.pl	Thu Oct 30 21:31:55 2014 -0400
+++ b/nibls.pl	Wed Nov 05 01:17:26 2014 -0500
@@ -80,8 +80,8 @@
 #		$length1=40;
 #	}
 	my $total;
-	foreach (0..$#data) {
-		$total+=$_;
+	for (my $s=0;$s<@data ;$s++) {
+		$total+=$data[$s];
 	}
 	push @data,$total;
 #	push @data,$length1;
@@ -258,10 +258,10 @@
 		my $c=$1;
 		my $s=$2;
 		my $e=$3;
-		my @data;
+	#	my @data;
 		foreach my $str (keys %{$molecules{$c}{$s}{$e}}) {
-			push @tag,($s.",".$e.",".$str);
-			@data=split(/;/,$molecules{$c}{$s}{$e}{$str});
+			my @data=split(/;/,$molecules{$c}{$s}{$e}{$str});
+			push @tag,($s.",".$e.",".$str.",".$data[-1]);
 #			for (my $i=0;$i<$#old_data ;$i++) {
 #				$data[$i]+=$old_data[$i];
 #			}
@@ -279,14 +279,14 @@
 		$end = $e if $e > $end;
 	}
 	my $tag=join";",@tag;
-	
+	my $tag_number=@tag;
 	my ($max_length,$max_p,@cluster_exp)=Max_length(\@sample);
 	if ($max_length==40) {
 		$max_length="\>30";
 	}
 	my $cluster_exp=join"\t",@cluster_exp;
 	my $gff = $chr."\:$start\-$end\t".$max_length."nt\t".$max_p."\t" . $cluster_exp;
-	print CLUSTER "$chr\:$start\-$end\t$max_length"."nt\t$max_p\t$tag\n";
+	print CLUSTER "$chr\:$start\-$end\t$max_length"."nt\t$max_p\t$tag_number\t$tag\n";
 	print OUT $gff, "\n";  
 }