[Bioperl-l] SeqWords.pm

Heikki Lehvaslaiho heikki at ebi.ac.uk
Mon Nov 10 12:04:33 EST 2003


Derek,

That looks like a good extension. Please submit it to bugzilla. Do you
think you could write a few tests into t/Tools.t. That would be grand.

For backward compatibility I think we will keep count_words() (there
could be an alias count_nonoverlaping_words() but I do not think it is
needed. Too verbose and long.) and add count_overlapping_words().
Internally they should call the same method with different parameters. 
I can do this if you make sure that the code works (and write the tests
to prove it).

Cheers,
	-Heikki

On Mon, 2003-11-10 at 16:25, Derek Gatherer wrote:
> Hi
> 
> Bio::Tools::Seqwords.pm should have two methods, one for counting 
> overlapping words and one for counting non-overlapping words.  The present 
> count_words could/should be renamed count_nonoverlap_words, and an 
> additional count_overlap_words could be created, same code as count_words, 
> but...
> 
> after line 214, you would need
> 
> 	$seqlen = $seqobj->length();			# measure length
> 	for ($frame = 1; $frame<=$word_length; $frame++)# run through frames
> 	{	
> 		my $seqstring = uc($seqobj->subseq($frame,$seqlen));# take the relevant 
> substring
> 	
> 		while($seqstring =~ /((\w){$word_length})/gim)
> 		{
> 			$codon{uc($1)}++;		# keep adding to hash
> 		}
> 	}
> 	return \%codon;
> 
> Should I send this to bugzilla? (it isn't really a bug, just a gap in the 
> functionality of the object.)
> 
> thanks
> Derek
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
-- 
______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho    heikki_at_ebi ac uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________



More information about the Bioperl-l mailing list