[Bioperl-l] Restriction::Analysis strange error - please help

Garrett Sorensen garrettsorensen at gmail.com
Tue Jan 25 21:12:37 EST 2005


Thanks for the suggestion Rob but still having issues.  I've boiled
the code down to just reading in fasta sequences and digesting the
whole sequences - opposed to digesting a subsequence as done
initially.  It digests a few hundred sequences without issue and then
runs into the same error, but reports different corrdinates of course.

If it is only reading in a fasta sequence and digesting it how is it
calculating wrong start/end coordinates for itself?  And the fact that
it will work great on many sequences but then calculates wrong
coordinates for one seems strange...  Any ideas?

I've tried feeding Restriction::Analysis both a SeqIO object and a
PrimarySeq with the same result.

Here is the code:

use strict;
use Bio::SeqIO;
use Bio::PrimarySeq;
use Bio::Restriction::Analysis;
use Bio::PrimarySeq;
use Data::Dumper;

my $in  = Bio::SeqIO->new(-file => "$file",  -format => 'fasta');
while ( my $seq = $in->next_seq ) {
    my $ra=Bio::Restriction::Analysis->new(-seq=>$seq);
    my @fragments = $ra->fragments('NlaIII');
    print join ("\n\n", @fragments);
    }
exit


Thanks for any help or suggestions, best regards,
Garrett


On Tue, 25 Jan 2005 17:20:47 -0800, Rob Edwards <rob at salmonella.org> wrote:
> It is hard to locate the exact error without more information. The
> error is caused because at some point you are trying to get a sequence
> that starts at position 2002, but the sequence is only 2001 nt long
> (hence the error that 2002 must be < 2001). I would suggest that the
> error is at some point where you are taking the 2kb fragment around the
> site. The most obvious thing to start with is what are the start/end
> coordinates that are called immediately before the error, and do they
> make sense given the length of the sequence?
> 
> Rob
> 
> On Jan 25, 2005, at 9:45 AM, Garrett Sorensen wrote:
> 
> > Hello,  I'm new to the mailing list.  Thanks in advance for any help.
> >
> > I'm really stumped by the following error when running restriction
> > analysis on large numbers of seq objects.  This only occurs sometimes
> > when dealing with large numbers of sequences.
> >
> >
> > ------------- EXCEPTION  -------------
> > MSG: Bad start,end parameters. Start [2002] has to be less than end
> > [2001]
> > STACK Bio::PrimarySeq::subseq
> > /home/garrett/Perl/lib/perl5/site_perl/5.8.5/Bio/PrimarySeq.pm:362
> > STACK Bio::Seq::subseq
> > /home/garrett/Perl/lib/perl5/site_perl/5.8.5/Bio/Seq.pm:636
> > STACK Bio::Restriction::Analysis::fragment_maps
> > /home/garrett/Perl/lib/perl5/site_perl/5.8.5/Bio/Restriction/
> > Analysis.pm:552
> > STACK toplevel Restriction_analyser_multi_CpG_a.pl:182
> >
> >
> > Incase it helps here is what my program is doing:
> > -Reads in multiple fasta sequences (~7kb average size) on at a time
> > and creates a SeqIO object for each.
> > -Restriction sites for a particular enzyme are determined for each
> > SeqIO object and then a fragment 2kb in size is created around that
> > site.
> > -A new Seq object is created using the above fragment using
> > "$upStreamSeqobj = Bio::Seq->new (-seq => $upStreamSeq);"
> > -This new Seq object is fed into Restriction Analysis to generate
> > fragments for another enzyme.
> >
> > Thanks so much for any help, best regards,
> > Garrett
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> >
> 
>


More information about the Bioperl-l mailing list