[Bioperl-l] small question

Ewan Birney birney@ebi.ac.uk
Sun, 30 Jul 2000 17:48:23 +0100 (GMT)


On Sun, 30 Jul 2000, L.Pollak wrote:

> > Yup. Annotation objects can't "know" about Sequence objects otherwise we
> > have screwed something up (along with nasty memory cycles as well. Lorenz
> > - you should make sure you understand about memory cycles).
> 
> sure, ok i mean i didn't know the word "memory cycle" but i know what
> you
> are talking about. I was thinking about a reference to the parent object
> as used in Ian Korf's BPlite. (no recursive function calls ;) )
> 
> but i have another problem i would like to discuss:
> when reading a comment from a swissprot file there are special
> comment blocks that start with "-!-". The last version of
> Bio::SeqIO::swiss
> would read the whole CC lines and then replace all "-!-"s and "\n"s with
> spaces which is not so good as we now want to write the comment back in
> swissprot format.


Ugh. Fecking swissprot. (apologies to swissprot people on the list).
Whoever came up with "structured comments" I want to shoot now...


Solution (i)

	(a) make a specific Bio::Annotation::SwissComment class derives
from Bio::Annotation::Comment with the extra attribute ->has_leading_bang.
This is set to true for swissprot comments that start with -!-

	(b) in the Bio::SeqIO::swiss the code should go

	if( $comment->isa('Bio::Annotation::SwissComment') ) {
		# then test for band
		if( $comment->has_leading_bang ) {
			# add the bang back
                }
                # write the comment
        } else {
                # write the comment
        }
		
Solution (ii)

	change the code in swiss in reading in not to strip out -!- and
leave it to the user/client code to deal with this.

Solution (iii)

	Throw your hands in the air and insist we do a ground-up rewrite
of swissprot, bioperl and everything else (sometimes I feel like this).

> 
> shall i split up the comment into different comment objects for every
> block starting with "-!-" or shall i read the whole comment literally,
> store it in one object and let the user handle the special blocks...
> (as i have done it for now)
> 
> kind regards,
> lorenz
> 
> PS: tonight i will commit a swiss.pm that can now write everything 
> except the "SQ"-sequence line because i don't know how to calculate the
> CRC64 sum ...
> 

-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------