Commit a7f5f340 authored by Sebastien Moretti's avatar Sebastien Moretti
Browse files

Add a warning message if input are already nucleotides

parent 3af6fb03
......@@ -34,7 +34,7 @@ $ENV{'PATH'} .= ':/mnt/local/bin/'; # additional path for executable on the serv
my $Version='3.0.1';
my $Version='3.0.2';
my $uct=15; # UpdateCacheThreshold: number of days before update
my $cachedir='/scratch/frt/tcoffee/ProtoGene_Cache'; # Cache directory
##### User settings ####################################
......@@ -169,15 +169,29 @@ while(<MSA>){
}
}
close MSA;
if ($fasta_checker == -1){
if ( $fasta_checker == -1 ){
&failure;
print STDERR "\tThe MSA file does NOT seem to be a protein fasta format\n\n";
exit;
exit(1);
}
elsif ($lim >0 and $fasta_checker > $lim){
elsif ( $lim >0 && $fasta_checker > $lim ){
&failure;
print STDERR "\tThe fasta file is too large, try with less than $lim sequences\n\n";
exit;
exit(1);
}
elsif ( exists( $original_seq[0] ) && $original_seq[0] =~ /[acgtu]/i){
#Check if sequences are amino acids and not nucleotides
my ( $a, $c, $g, $t, $non ) = ( 0, 0, 0, 0, 0 );
$a = ($original_seq[0] =~ s/[aA]//g);
$c = ($original_seq[0] =~ s/[cC]//g);
$g = ($original_seq[0] =~ s/[gG]//g);
$t = ($original_seq[0] =~ s/[tTuU]//g);
$non = ($original_seq[0] =~ s/[^aAcCgGtTuU-]//g);
if ( ($a+$c+$g+$t) >= (($a+$c+$g+$t+$non)*80/100) ){
&failure();
print STDERR "Your sequences seem already to be nucleotides\nthis program purpose is to turn AMINO ACID alignments into CDS nucleotide alignments\n\n";
exit(1);
}
}
undef $fasta_checker;
......@@ -397,10 +411,10 @@ if ( -s "${originalMSA}.cds" or -s "${originalMSA}.out"){
}
else{
&failure;
exit;
exit(1);
}
exit;
exit(0);
=head1 NAME
......@@ -483,9 +497,9 @@ PROTOGENE re-builds the original alignment with nucleotidic information it has g
=over 8
=item version 3.0.1
=item version 3.0.2
=item on Sept 26th, 2006
=item on June 15th, 2007
=back
......@@ -636,12 +650,11 @@ sub checkFastaFile{
$change=1;
}
}
}
else {
&failure;
print STDERR "\tThe file \'$msa\' doesn't not seem to be reachable\n\n";
exit;
exit(1);
}
return($msa,$change);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment