# HG changeset patch # User big-tiandm # Date 1414570816 14400 # Node ID 0e4b6b0c6e9d6bbc2c6c82d4536b266f7ebabac8 # Parent 36ba71d63988644d0f53ddce029f1036040f473b Uploaded diff -r 36ba71d63988 -r 0e4b6b0c6e9d html.pl --- a/html.pl Wed Oct 29 04:19:59 2014 -0400 +++ b/html.pl Wed Oct 29 04:20:16 2014 -0400 @@ -25,7 +25,11 @@ $genomepath=; chomp $genomepath; $clusterpath=; chomp $clusterpath; $annotatepath=; chomp $annotatepath; -$degpath=; chomp $degpath; +my $deg_tag=1; +if(eof){$deg_tag=0;} +else{ + $degpath=; chomp $degpath; +} close IN; my @tmp=split/\//,$prepath; $predir=$tmp[-1]; @@ -37,8 +41,8 @@ $clusterdir=$tmp[-1]; @tmp=split/\//,$annotatepath; $annotatedir=$tmp[-1]; -@tmp=split/\//,$degpath; -$degdir=$tmp[-1]; +#@tmp=split/\//,$degpath; +#$degdir=$tmp[-1]; my $dir=dirname($opts{'o'}); @@ -479,12 +483,19 @@ $repeat[$j]=0; $nat[$j]=0; } + +my $class_anno=6; open ANNO,"<$annotate"; while (my $aline=) { - next if($aline=~/^\#/); chomp $aline; my @temp=split/\t/,$aline; - for (my $i=3+@marks+6;$i<@temp;$i++) { + if($aline=~/^\#/){ + if (@temp != 10+@marks) { + $class_anno=0; + } + next; + } + for (my $i=3+@marks+$class_anno;$i<@temp;$i++) { my @posit=split/\;/,$temp[$i]; for (my $j=0;$j<@marks ;$j++) { if ($temp[3+$j]>0) { @@ -497,28 +508,30 @@ } } } - for (my $j=0;$j<@marks ;$j++) { - if ($temp[3+$j]>0) { - if ($temp[6] eq "phase") { - $phase[$j]++; - } - if ($temp[7] eq "long") { - $long[$j]++; - } - if ($temp[8] ne "\/") { - $repeat[$j]++; - my @rr=split/\;/,$temp[8]; - foreach (@rr) { - $repeat{$_}[$j]++; + if ($class_anno) { + for (my $j=0;$j<@marks ;$j++) { + if ($temp[3+$j]>0) { + if ($temp[6] eq "phase") { + $phase[$j]++; + } + if ($temp[7] eq "long") { + $long[$j]++; } - } - if ($temp[9] ne "\/") { - $nat[$j]++; - my @nn1=split/\;/,$temp[9]; - my @nn2=split/\;/,$temp[10]; - for (my $k=0;$k<@nn1 ;$k++) { - $nat1{$nn1[$k]}[$j]++; - $nat2{$nn2[$k]}[$j]++; + if ($temp[8] ne "\/") { + $repeat[$j]++; + my @rr=split/\;/,$temp[8]; + foreach (@rr) { + $repeat{$_}[$j]++; + } + } + if ($temp[9] ne "\/") { + $nat[$j]++; + my @nn1=split/\;/,$temp[9]; + my @nn2=split/\;/,$temp[10]; + for (my $k=0;$k<@nn1 ;$k++) { + $nat1{$nn1[$k]}[$j]++; + $nat2{$nn2[$k]}[$j]++; + } } } } @@ -551,176 +564,188 @@ One cluster mybe annotate to multiple genes
"; -print OUT "

5.2 Cluster source mechanism annotate

- - -\n -"; +if ($class_anno) { + print OUT "

5.2 Cluster source mechanism annotate

+
clusters number
+ + \n + "; -foreach (@marks) { - print OUT "\n"; -} -print OUT " - -\n -"; -foreach (@phase) { - print OUT "\n"; -} + foreach (@marks) { + print OUT "\n"; + } + print OUT " + + \n + "; + foreach (@phase) { + print OUT "\n"; + } -print OUT " - -\n -"; -foreach (@long) { - print OUT "\n"; -} + print OUT " + + \n + "; + foreach (@long) { + print OUT "\n"; + } -print OUT " - -\n -"; -foreach (@repeat) { - print OUT "\n"; -} + print OUT " + + \n + "; + foreach (@repeat) { + print OUT "\n"; + } -print OUT " - -\n -"; -foreach (@nat) { - print OUT "\n"; -} -print OUT "\n
clusters number $_
Phase $_ $_
Phase $_
Long $_
Long $_
Repeat $_
Repeat $_
Nat $_
"; + print OUT " + + Nat\n + "; + foreach (@nat) { + print OUT " $_ \n"; + } + print OUT "\n"; -print OUT "

-Repeat subclass annotate: -"; + print OUT "

+ Repeat subclass annotate: + "; -print OUT " - -\n -"; -foreach (@marks) { - print OUT "\n"; -} + print OUT "
Repeat subclass $_
+ + \n + "; + foreach (@marks) { + print OUT "\n"; + } -foreach my $key (sort keys %repeat) { - print OUT " - - - "; - for (my $i=0;$i<@marks ;$i++) { - if (defined($repeat{$key}[$i])) { - print OUT "\n"; + foreach my $key (sort keys %repeat) { + print OUT " + + + "; + for (my $i=0;$i<@marks ;$i++) { + if (defined($repeat{$key}[$i])) { + print OUT "\n"; + } + else{print OUT "\n";} } - else{print OUT "\n";} } -} -print OUT "\n
Repeat subclass $_
$key $repeat{$key}[$i]
$key $repeat{$key}[$i] 0 0
"; + print OUT "\n"; -print OUT "

-Nat subclass1 annotate: -"; + print OUT "

+ Nat subclass1 annotate: + "; -print OUT " - -\n -"; -foreach (@marks) { - print OUT "\n"; -} -foreach my $key (sort keys %nat1) { - print OUT " - - + print OUT "
Nat subclass1 $_
$key
+ + \n "; - for (my $i=0;$i<@marks ;$i++) { - if (defined($nat1{$key}[$i])) { - print OUT "\n"; + foreach (@marks) { + print OUT "\n"; + } + foreach my $key (sort keys %nat1) { + print OUT " + + + "; + for (my $i=0;$i<@marks ;$i++) { + if (defined($nat1{$key}[$i])) { + print OUT "\n"; + } + else{print OUT "\n";} } - else{print OUT "\n";} } -} -print OUT "\n
Nat subclass1 $nat1{$key}[$i] $_
$key $nat1{$key}[$i] 0 0
"; + print OUT "\n"; + + print OUT "

+ Nat subclass2 annotate: + "; -print OUT "

-Nat subclass2 annotate: -"; - -print OUT " - -\n -"; -foreach (@marks) { - print OUT "\n"; + print OUT "
Nat subclass2 $_
+ + \n + "; + foreach (@marks) { + print OUT "\n"; + } + foreach my $key (sort keys %nat2) { + print OUT " + + + "; + for (my $i=0;$i<@marks ;$i++) { + if (defined($nat2{$key}[$i])) { + print OUT "\n"; + } + else{print OUT "\n";} + } + } + print OUT "\n
Nat subclass2 $_
$key $nat2{$key}[$i] 0
"; + print OUT "

+ Note:
+ One cluster mybe annotate to multiple repeats or nats
+ "; } -foreach my $key (sort keys %nat2) { - print OUT " - - $key - "; - for (my $i=0;$i<@marks ;$i++) { - if (defined($nat2{$key}[$i])) { - print OUT " $nat2{$key}[$i] \n"; - } - else{print OUT " 0 \n";} - } +else { + print OUT "

5.2 Cluster source mechanism annotate

+
Do not do source mechanism annotate
"; + } -print OUT "\n"; -print OUT "

-Note:
-One cluster mybe annotate to multiple repeats or nats
-"; -my $deg_file=`ls $degpath`; -chomp $deg_file; -my @deg_file=split/\n/,$deg_file; -my %deg; -foreach (@deg_file) { - my $output="$degpath/$_/output_score.txt"; - open IN,"<$output"; - $deg{$_}[0]=0; - $deg{$_}[1]=0; - $deg{$_}[2]=0; - while (my $aline=) { - next if ($aline=~/^\"/); - chomp $aline; - my @temp=split/\t/,$aline; - if ($temp[9] eq "TRUE") { - $deg{$_}[0]++; - if ($temp[4] >0) { - $deg{$_}[1]++; - } - if ($temp[4] <0) { - $deg{$_}[2]++; +if ($deg_tag) { + my $deg_file=`ls $degpath`; + chomp $deg_file; + my @deg_file=split/\n/,$deg_file; + my %deg; + foreach (@deg_file) { + my $output="$degpath/$_/output_score.txt"; + open IN,"<$output"; + $deg{$_}[0]=0; + $deg{$_}[1]=0; + $deg{$_}[2]=0; + while (my $aline=) { + next if ($aline=~/^\"/); + chomp $aline; + my @temp=split/\t/,$aline; + if ($temp[9] eq "TRUE") { + $deg{$_}[0]++; + if ($temp[4] >0) { + $deg{$_}[1]++; + } + if ($temp[4] <0) { + $deg{$_}[2]++; + } } } + close IN; } - close IN; -} + print OUT "

6. DEG

+ + + \n + \n + \n + \n + "; -print OUT "

6. DEG

-
Genes number DEG UP DOWN
- -\n -\n -\n -\n -"; - -foreach my $key (sort keys %deg) { - print OUT " - - - "; - for (my $i=0;$i<@{$deg{$key}} ;$i++) { - print OUT "\n"; + foreach my $key (sort keys %deg) { + print OUT " + + + "; + for (my $i=0;$i<@{$deg{$key}} ;$i++) { + print OUT "\n"; + } } + print OUT "\n
Genes number DEG UP DOWN
$key $deg{$key}[$i]
$key $deg{$key}[$i]
"; } -print OUT "\n"; +else{ + print OUT "

6. DEG

+
Do not do DE clusters
"; +} print OUT "