[Bio] / FigMetagenomeTools / compare_fasta_seqs.pl Repository:
ViewVC logotype

View of /FigMetagenomeTools/compare_fasta_seqs.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Fri Mar 16 20:51:25 2007 UTC (12 years, 9 months ago) by olson
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, mgrast_rel_2008_0806, mgrast_dev_10262011, mgrast_dev_02212011, mgrast_rel_2008_0923, mgrast_release_3_0, mgrast_dev_03252011, mgrast_rel_2008_0924, mgrast_rel_2008_1110_v2, mgrast_rel_2008_0625, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, mgrast_rel_2008_0919, mgrast_rel_2008_1110, myrast_33, mgrast_rel_2008_0917, mgrast_dev_04052011, mgrast_dev_02222011, HEAD
Changes since 1.1: +0 -1 lines
initial tweaks

#!/usr/bin/perl -w

use strict;
use Rob;

my $f1 = shift || die "file1?";
my $f2 = shift || die "file2?";

print STDERR "Reading $f1\n";
my $fa1=Rob->read_fasta($f1);
my $seq1; my $count;
map {$fa1->{$_} =~ s/\s+//g; $count->{uc($fa1->{$_})}++; $seq1->{uc($fa1->{$_})}=$_} keys %$fa1;
print "Duplicates in $f1\n";
map {print  $seq1->{uc($fa1->{$_})}, "\n" if ($count->{$_} > 1)} keys %$count;
undef $count;

print STDERR "Reading $f2\n";
my $fa2=Rob->read_fasta($f2);
my $seq2;
map {$fa2->{$_} =~ s/\s+//g; $seq2->{uc($fa2->{$_})}=$_; $count->{uc($fa2->{$_})}++} keys %$fa2;
print STDERR "THis should be: ", $count->{'ZXD'}, "\n";
print "Duplicates in $f2\n";
map {print  $seq2->{uc($fa2->{$_})}, "\n" if ($count->{$_} > 1)} keys %$count;
undef $count;

print "Sequences in $f1 that are NOT in $f2\n";
map {print $seq1->{$_}, "\n" unless ($seq2->{$_})} keys %$seq1;

print "Sequences in $f2 that are NOT in $f1\n";
map {print $seq2->{$_}, "\n" unless ($seq1->{$_})} keys %$seq2;

print "Keys in $f1 that are not in $f2\n";
map {print $_, "\n" unless ($fa2->{$_})} keys %$fa1;

print "Keys in $f2 that are not in $f1\n";
map {print $_, "\n" unless ($fa1->{$_})} keys %$fa2;




MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3