Iddo Friedberg | 4 Mar 2008 03:07
Picon
Gravatar

[BioPython] GenBank writer?

Hi all,

Does biopython have a GenBank writer? SeqIO does not seem to have that.

Forgive the basic question. I'm a structure person lately turned sequence
analyzer....

Iddo

--

-- 

Iddo Friedberg, Ph.D.
CALIT2, mail code 0440
University of California, San Diego
9500 Gilman Drive
La Jolla, CA 92093-0440, USA
T: +1 (858) 534-0570
T: +1 (858) 646-3100 x3516
http://iddo-friedberg.org
_______________________________________________
BioPython mailing list  -  BioPython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Peter | 4 Mar 2008 10:30
Picon
Picon

Re: [BioPython] GenBank writer?

On Tue, Mar 4, 2008 at 2:07 AM, Iddo Friedberg <idoerg <at> gmail.com> wrote:
> Hi all,
>
>  Does biopython have a GenBank writer? SeqIO does not seem to have that.
>
>  Forgive the basic question. I'm a structure person lately turned sequence
>  analyzer....
>
>  Iddo

I've got bits of one for SeqIO, unfinished.  There are a lot of tricky
little problems when trying to write a SeqRecord which didn't
originally come from a GenBank or EMBL file - e.g. identifiers that
are too long.  I do still want to finish this, and I should have more
free time in a couple of months.

You could try using the GenBank Record objects (not SeqRecord
objects), and writing them to file.

Peter
_______________________________________________
BioPython mailing list  -  BioPython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Stefanie Lück | 4 Mar 2008 10:48
Picon
Favicon

[BioPython] Genbank writer (code)

Hi!

I wrote a small class, which I use for writing Genbank Files. If someone is interested, I can send it. At the
moment it's adjusted for my purpose but you can change it. It's a very simple line by line writing, but it
work's. Since I'm beginner, it's would be helpful to get correction from the user.

Regards 
Stefanie
_______________________________________________
BioPython mailing list  -  BioPython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Peter | 4 Mar 2008 11:30
Picon
Picon

Re: [BioPython] Genbank writer (code)

On Tue, Mar 4, 2008 at 9:48 AM, Stefanie Lück <lueck <at> ipk-gatersleben.de> wrote:
> Hi!
>
>  I wrote a small class, which I use for writing Genbank Files. If someone is interested,
>  I can send it. At the moment it's adjusted for my purpose but you can change it. It's
>  a very simple line by line writing, but it work's. Since I'm beginner, it's would be helpful
>  to get correction from the user.
>
>  Regards
>  Stefanie

Could you add the files to Bug 2294?
http://bugzilla.open-bio.org/show_bug.cgi?id=2294

I did make a start at integrating Howard's code - some of the issues
involve tweaking the parser to record more information in the
SeqRecord.  Then there is the whole issue of mapping other file
formats to GenBank and vice versa, and validating our output in other
tools (e.g. EMBOSS or BioPerl).

Thanks,

Peter

_______________________________________________
BioPython mailing list  -  BioPython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Eric Gibert | 8 Mar 2008 05:13
Picon
Favicon

Re: [BioPython] Bio.EUtils


Dear Michel,

I use DBIdsClient from Bio.EUtils to fetch data from the taxonomy database
of NCBI to update the table "taxon" and "taxon_name" in my BioSQL database
with the NCBI data.

I added one line definition in /Bio/EUtils/Config.py to declare that db:
Databases.TAXONOMY = _add_db(DatabaseInfo("taxonomy", 1))

Then I can use  client.search and result.efetch without problem.

Eric

-----Original Message-----
From: biopython-bounces <at> lists.open-bio.org
[mailto:biopython-bounces <at> lists.open-bio.org] On Behalf Of Michiel de Hoon
Sent: Friday, January 25, 2008 9:05 PM
To: biopython <at> biopython.org
Subject: [BioPython] Bio.EUtils

Hello everybody,

I am looking at the various ways Biopython interacts with NCBI's Entrez
search engine, and if possible to organize and document this a bit more.
Currently there are several modules that interact with Entrez. The most
extensive one is Bio.EUtils, but there are also simpler modules such as
Bio.WWW.NCBI. I was wondering:
1) Is anybody using Bio.EUtils?
2) If so, could you give an example script that uses Bio.EUtils?
(Continue reading)

Michiel de Hoon | 9 Mar 2008 14:13
Picon
Favicon

Re: [BioPython] Bio.EUtils

Dear Eric,

Thank you for your reply.
For esearch and efetch, can you use Bio.WWW.NCBI instead?
Something like:
>>> from Bio.WWW import NCBI
>>> handle = NCBI.esearch(db="taxonomy", term="your_search_term")
>>> result = handle.read() # Gets the search results in XML format.
and similar for NCBI.efetch.
Or does Bio.EUtils parse the XML results?

One caveat: Bio.WWW.NCBI will be updated and renamed Bio.Entrez in Biopython 1.45.

Thanks,

--Michiel.

Eric Gibert <ericgibert <at> yahoo.fr> wrote: 
Dear Michel,

I use DBIdsClient from Bio.EUtils to fetch data from the taxonomy database
of NCBI to update the table "taxon" and "taxon_name" in my BioSQL database
with the NCBI data.

I added one line definition in /Bio/EUtils/Config.py to declare that db:
Databases.TAXONOMY = _add_db(DatabaseInfo("taxonomy", 1))

Then I can use  client.search and result.efetch without problem.

Eric
(Continue reading)

Florian Koelling | 10 Mar 2008 18:15
Picon
Picon

[BioPython] Trying to extract a (single) ligand from a PDB file (dimere)

Hi folks!
I'm new to biopython and tried to write a parser to extract a Ligand
from it 's PDB file. It even works - but I've got a dimer with two
ligands  and  I'd like to have a new PDB file containing only one
ligand.
My trials to acces the residue(the ligand) via the residue id failed...

Hope you can Help me.

My code so far :-((((

#### LIGAND DETECTION

import Bio.PDB
from Bio.PDB import*
import Numeric

parser = PDBParser()                                    
structure = parser.get_structure('s', '2F1G.pdb')
print  "\n"
print "structure_object_created"

requirement_id_list = []                
requirement_names_list = []                                     

residue = structure.get_residues()

for i in residue:       
        residue_id = i.get_id()                                         

(Continue reading)

James Swetnam | 10 Mar 2008 23:42
Picon
Gravatar

[BioPython] import error

Hello.  First of all, thank you to the developers for the great  
resource.  It's only with a sense of regret that I post my first  
message to this list as a complaint!

I'm doing some rather complicated (to me, at least) database  
manipulation with the help of the excellent ORM provided by the  
biopython project.  I think this is unimportant, but I can provide the  
full source code if asked.  The problem I have is with the following  
line I have included in one of my source files, copied from one of  
the  biopython tutorials:

ncbi_dict = GenBank.NCBIDictionary("nucleotide", "genbank")

This line, both in isolation and in the context of my script, produces  
the rather terse import error:

cardozo13:Bio james$ python
Python 2.5.1 (r251:54863, Jan 10 2008, 15:27:44)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> from Bio import GenBank
 >>> ncbi_dict = GenBank.NCBIDictionary("nucleotide","genbank")
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/sw/lib/python2.5/site-packages/Bio/GenBank/__init__.py",  
line 1283, in __init__
     from Bio import db
ImportError: cannot import name db

The import error is actually occuring inside one of the stock files  
(Continue reading)

Peter | 11 Mar 2008 00:54
Picon
Picon

Re: [BioPython] import error

On Mon, Mar 10, 2008 at 10:42 PM, James Swetnam <jswetnam <at> gmail.com> wrote:
> Hello.  First of all, thank you to the developers for the great
>  resource.  It's only with a sense of regret that I post my first
>  message to this list as a complaint!
>
>  ncbi_dict = GenBank.NCBIDictionary("nucleotide", "genbank")
>
>  This line, both in isolation and in the context of my script, produces
>  the rather terse import error:

Unfortunately you have fallen foul of a known issue in Biopython 1.44
(bug 2993), which has since been fixed:
http://bugzilla.open-bio.org/show_bug.cgi?id=2393

If you can hold on a few weeks we do hope to have Biopython 1.45 out
"shortly".  You could update to CVS, or perhaps most simply I can
suggest you use the one line fix in the NCBIDictionary class, see:
http://bugzilla.open-bio.org/show_bug.cgi?id=2393#c2

Peter
_______________________________________________
BioPython mailing list  -  BioPython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Peter | 11 Mar 2008 18:35
Picon
Picon

Re: [BioPython] import error

On Tue, Mar 11, 2008 at 4:27 PM, James Swetnam <jswetnam <at> gmail.com> wrote:
> Would anyone have any problem with me updating the BioSQL tutorial to
>  reflect the fact that BioSQL is on svn and not CVS?  I got burned by a
>  bug that had been fixed in both the stable 1.0 release and current svn
>  version, but which lurked unsquashed in the (deprecated) CVS.

Updating the documentation is always a good idea - which bit of it did you mean?

I've just updated the wiki page http://biopython.org/wiki/BioSQL as it
certainly shouldn't talk about BioSQL in CVS anymore.  We could update
it to get their latest code from SVN, but I thought it would probably
be simpler to use the standard downloads now that BioSQL 1.0 has been
released.  If you could proof read the new page, and fix any little
things, that would be great.

When Biopython moves from CVS to SVN (which is imminent) we'll have to
check all the documentation again...

Peter
_______________________________________________
BioPython mailing list  -  BioPython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython


Gmane