Skip to content

Commit

Permalink
usecases/Miseq-16S/clstr_2_OTU_table.pl
Browse files Browse the repository at this point in the history
    minor
  • Loading branch information
liwz authored and liwz committed Jun 17, 2017
1 parent dde9399 commit 4b46446
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions usecases/Miseq-16S/clstr_2_OTU_table.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,23 @@
my @sample_ids = sort keys %sample_id;

open(OUT1, "> $output") || die "can not write $output";
print OUT1 "OTU\tAnnotation";
print OUT1 "OTU";
foreach $sample_id (@sample_ids){
print OUT1 "\t$sample_id";
}
print OUT1 "\tTotal\n";
#print OUT1 "\tTotal\n";
print OUT1 "\tAnnotation\n";

for ($i=1; $i<=$OTU; $i++){
$ann = "None";
if ($OTU_2_ann{$i}) {
$ann = $OTU_2_ann{$i};
}
print OUT1 "OTU",$i, "\t$ann";
if ($OTU_2_ann{$i}) { $ann = $OTU_2_ann{$i}; }
print OUT1 "OTU$i";
foreach $sample_id (@sample_ids){
$k = $count{$i}{$sample_id}? $count{$i}{$sample_id} : 0;
print OUT1 "\t$k";
}
print OUT1 "\t$count_t{$i}";
print OUT1 "\n";
#print OUT1 "\t$count_t{$i}";
print OUT1 "\t$ann\n";
}
close(OUT1);

Expand Down

0 comments on commit 4b46446

Please sign in to comment.