Created
July 7, 2016 15:16
-
-
Save andrewjpage/f3ef06826d1244b642ccce4c26846c05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Bio::SeqIO; | |
no warnings 'uninitialized'; | |
my $in = Bio::SeqIO->new(-file => $ARGV[0] , '-format' => 'Fasta'); | |
my $first_size = 0; | |
my $counter = 0; | |
my $error_found =0; | |
while ( my $seq = $in->next_seq() ) { | |
my $cur_size = $seq->length(); | |
if($counter ==0) | |
{ | |
$first_size = $cur_size; | |
} | |
if($first_size == $cur_size) | |
{ | |
} | |
else | |
{ | |
$error_found++; | |
print "Error in sequence ".$seq->display_id().". Size is ".$cur_size." but expected ".$first_size."\n"; | |
} | |
$counter++; | |
} | |
if( $error_found > 0) | |
{ | |
print "Sequences with errors: ".$error_found."\n"; | |
} | |
print "Bases in each alignment: $first_size\n"; | |
print "Number of sequences: ".$counter."\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment