[Biopython-dev] [Biopython - Bug #3297] newline added in quated features

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Wed Oct 31 19:09:57 UTC 2012


Issue #3297 has been updated by Chris Fields.

Assignee changed from Bioperl Guts to Biopython Dev Mailing List

Changing default assignee.
----------------------------------------
Bug #3297: newline added in quated features
https://redmine.open-bio.org/issues/3297

Author: Jesse van Dam
Status: New
Priority: Normal
Assignee: Biopython Dev Mailing List
Category: 
Target version: 
URL: 


Note: sorry for the duplicate reporting, did not notice the makeup of the bug reporting system

When I have a feature line like (which spans multiple lines) in a genbank file

<pre>
                     /product="Glutamate synthase [NADPH] small chain (EC 1.4.1
                     .13)"

</pre>

Then a space/newline will be added between 1.4.1 and .13 in the result so when printing the feature with the following code
<pre>
  print(source[0].qualifiers["product"])
</pre>

It will print (with the an unwanted space) 
<pre>
Glutamate synthase [NADPH] small chain (EC 1.4.1 .13)
</pre>

Changed the following thing in scanner.py to fix this problem
<pre>
                    elif value[0]=='"':
                        #Quoted...
                        if value[-1]!='"' or value!='"':
                            #No closing quote on the first line...
                            while value[-1] != '"':
-                               value += "\n" + iterator.next() 
+                               value += iterator.next() 
                        else:
                            #One single line (quoted)
                            assert value == '"'
                            if self.debug : print "Quoted line %s:%s" % (key, value)
                        #DO NOT remove the quotes...
                        qualifiers.append((key,value))

</pre>


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org




More information about the Biopython-dev mailing list