[Biopython-dev] Notification: incoming/42

Brad Chapman chapmanb at arches.uga.edu
Wed Aug 15 08:55:37 EDT 2001


Hey all;

Bug report from J. Joung:
> >>I'm using GenBank NCBIDictionary to retrieve a GenBank record. The retrived
> >>record is missing the following information: LOCUS, DEFINITION, ACCESSION,
> >>VERSION, and KEYWORDS.

Jeff:
> >Is this information that's in the Genbank record?  It should be 
> >returning whatever NCBI returns, or raising an exception.  Dropping 
> >information would be odd.  Do you have a reproducible?  What is the 
> >accession you're using?

I think this is the infamous "lose the first 5 lines of the file" bug that
popped up in biopython-1.00a2 (which would also explain why 1.00a1 works
just file). This has been fixed in the current CVS, so the next release
should be bug free (well, at least in regards to this bug :-).

The solution for now is to fix Bio/File.py. I'm not exactly sure how this
would be done with diffs on windows, but attached is the change which
fixes the problem. I hope I've picked up on your problem correctly -- if
this change doesn't help please let us know!

Thanks for the bug report, and sorry about the problem! 
Hope this helps.
Brad

$ more File.diff
Index: File.py
===================================================================
RCS file: /home/repository/biopython/biopython/Bio/File.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -c -r1.12 -r1.13
*** File.py     2001/06/04 04:44:09     1.12
--- File.py     2001/07/14 23:48:51     1.13
***************
*** 46,60 ****
          return line
  
      def read(self, size=-1):
!         saved = ''
!         while size > 0 and self._saved:
!             if len(self._saved[0]) <= size:
!                 size = size - len(self._saved[0])
!                 saved = saved + self._saved.pop(0)
!             else:
!                 saved = saved + self._saved[0][:size]
!                 self._saved[0] = self._saved[0][size:]
!                 size = 0
          return saved + self._handle.read(size)
  
      def saveline(self, line):
--- 46,64 ----
          return line
  
      def read(self, size=-1):
!         if size == -1:
!             saved = string.join(self._saved, "")
!             self._saved[:] = []
!         else:
!             saved = ''
!             while size > 0 and self._saved:
!                 if len(self._saved[0]) <= size:
!                     size = size - len(self._saved[0])
!                     saved = saved + self._saved.pop(0)
!                 else:
!                     saved = saved + self._saved[0][:size]
!                     self._saved[0] = self._saved[0][size:]
!                     size = 0
          return saved + self._handle.read(size)
  
      def saveline(self, line):





More information about the Biopython-dev mailing list