#!/usr/bin/perl -w #unique_cct.pl use strict; use warnings; ##NB: To run this script on the file my_orthomcl_dir/groups.txt, specify it when runniong the script to add it to the @AGRV array die "usage: unique_cct.pl \n" if (@ARGV!=1); print "Processing file $ARGV[0]\n"; ##counting lines/protein groups unique to ppb my $uniqppb=0; my $outfile ="unique_ppb_output.txt"; open (my $out, ">$outfile") or die ("Problem with opening $outfile: $!"); while (my $line = <>){ next unless ($line=~/ppb/); next unless ($line!~/cct/); $uniqppb++; my $count+= ()=($line =~ m/\|/g); print $out "$line \($count proteins\)\n"; } print "There are $uniqppb groups of protein families unique to ppb\n"; close($out) ##output "There are 113 groups of protein families uniqe to ppb"