File: compare_DBs.pl

package info (click to toggle)
microbiomeutil 20101212%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 49,304 kB
  • sloc: perl: 4,878; ansic: 420; makefile: 98; sh: 27
file content (39 lines) | stat: -rwxr-xr-x 619 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env perl

use strict;
use warnings;

use lib ($ENV{EUK_MODULES});
use Fasta_reader;
use CdbTools;

my $usage = "usage: dbFrom dbTo\n\n";

my $dbFrom = $ARGV[0] or die $usage;
my $dbTo = $ARGV[1] or die $usage;


my $fasta_reader = new Fasta_reader($dbFrom);

while (my $seq_obj = $fasta_reader->next()) {
	
	my $acc = $seq_obj->get_accession();
	
	my $sequence = uc $seq_obj->get_sequence();
	$sequence =~ s/\./-/g;
	
	my $other_seq = uc &cdbyank_linear($acc, $dbTo);
	$other_seq =~ s/\./-/g;

	if ($sequence eq $other_seq) {
		print "$acc\tSAME\n";
	}
	else {
		print "$acc\tDIFFERENT\n";
	}
}


exit(0);