[Bioperl-l] Bio::Tools::Run::RepeatMasker issues

Roy Chaudhuri roy.chaudhuri at gmail.com
Wed Apr 27 11:45:17 UTC 2011


Hi Graham,

Sorry, I don't know much about RepeatMasker, but maybe you could try 
wrapping the run in an eval?:

eval {$factory->run($seq)}
if ($@) {warn $@} else {print $factory->masked_seq->seq}

Cheers,
Roy.

On 27/04/2011 11:43, Graham Hamilton wrote:
> Dear All
>
> I am writing a script to run RepeatMasker on several hundred thousand
> sequences of ~100 bp. I have installed RepeatMasker and have a script
> that will read in a single fasta sequence file and print out the
> masked sequence.
>
> use Bio::Tools::Run::RepeatMasker; use Bio::SeqIO;
>
> my $factory = Bio::Tools::Run::RepeatMasker->new(-species =>
> 'human'); my $in  = Bio::SeqIO->new(-file =>  "test.fa", -format =>
> 'fasta'); my $seq = $in->next_seq(); $factory->run($seq); my
> $masked_seq = $factory->masked_seq; print  $masked_seq->seq;
>
> The script works for sequences that contain repeats. Unfortunately,
> when I use a sequence without repeats I get the following error.
>
> ------------- EXCEPTION: Bio::Root::Exception ------------- MSG:
> Cannot open RepeatMasker outfile for parsing STACK: Error::throw
> STACK: Bio::Root::Root::throw
> /usr/local/lib/perl5/site_perl/5.12.3/Bio/Root/Root.pm:472 STACK:
> Bio::Tools::Run::RepeatMasker::_run
> /usr/local/lib/perl5/site_perl/5.12.3/Bio/Tools/Run/RepeatMasker.pm:308
>
>
STACK: Bio::Tools::Run::RepeatMasker::run 
/usr/local/lib/perl5/site_perl/5.12.3/Bio/Tools/Run/RepeatMasker.pm:260
> STACK: RepeatMaskerTest.pl:22
> -----------------------------------------------------------
>
> As I want to screen a file of many short sequences, most will contain
> repeats but not all. I want to keep the sequences that do not contain
> repeats for further investigation. This is a problem for me as the
> Exception exits the script.
>
> I assume that I am doing something wrong, can anyone give me some
> hints as to how I can get this to work?
>
> Regards
>
> Graham
>
>
> Dr Graham Hamilton The Sir Henry Wellcome Functional Genomics
> Facility Room B3-28 Joseph Black Building Research Institute of
> Molecular, Cell&  Systems Biology College of Medical, Veterinary&
> Life Sciences University of Glasgow Glasgow Scotland G12 8QQ
>
> T: +44 141 330 6212
>
>
> _______________________________________________ Bioperl-l mailing
> list Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list