Skip to content

Instantly share code, notes, and snippets.

@maasha
Forked from anonymous/gist:5311628
Created April 4, 2013 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maasha/5311657 to your computer and use it in GitHub Desktop.
Save maasha/5311657 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
use strict;
# Filenames
my $start10 = 'start10.dat';
my $res10 = 'res10.dat';
# Opening the files
open (START, '<', $start10) or die "Could not read file\n";
open (RES, '<', $res10) or die "Could not read file\n";
# Creating a hash with all start entries
my %start_list = ();
while (defined (my $line = <START>)) {
chomp $line;
$start_list{$line} = undef;
}
# Creating an array with all accession numbers in the result file
my %res_list = ();
while (defined (my $line = <RES>)) {
chomp $line;
$res_list{$1} = undef if $line =~ m/\b(\w+.CDS.1)\b/;
}
# Printing a list of accsseion numbers not detected in the result file
print "Following list cotains accession numbers present in '$start10' but not in '$res10'\n";
foreach my $entry (keys %start_list) {
if (!exists $res_list{$entry}) {
print "$entry\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment