Jake Feala | 1 Jun 2007 01:52
Picon

Re: interaction networks in biopython

Hi Everybody -

I've been thinking about the possible structure of a "BioNet" package,
and here is what I think would be most useful:

InteractionRecord.py - a storage object for biological interactions,
mirroring information stored in the PSI-MI (Proteomics Standards
Initiative - Molecular Interaction) XML standard - unless someone
knows a better one.

Network.py - network object inheriting a NetworkX graph class with
additional methods for manipulating an InteractionRecord stored with
each edge

InteractionIO - a submodule with parsers to read and write
interactions to/from Cytoscape, PSI-MI, and other formats or online
interaction databases

BioNetSQL - a submodule for storing and querying to a local SQL
database of interactions

I've started on the code, including parsers for Cytoscape, PSI-MI XML
files, and GRID flat files.  I haven't fixed up my SQL scripts yet
because I want to rethink the database design.  All the code is
available at  http://cmrg.ucsd.edu/JakeFeala#software

Here is an example that worked fine for me:
   from Network import *
   f = open(<GRID flat file from http://theBioGRID.org>)
   parser = GRIDIterator(f):
(Continue reading)

Michiel de Hoon | 3 Jun 2007 05:14
Favicon

Re: interaction networks in biopython

Jake Feala wrote:
> Here is an example that worked fine for me:
>    from Network import *
>    f = open(<GRID flat file from http://theBioGRID.org>)
>    parser = GRIDIterator(f):
>    net = create_network()
>    net.load(parser)
> 
To be more consistent with recent parsers in Biopython, this would be 
more appropriate:

 >>> import Network
 >>> f = open(<GRID flat file from http://theBioGRID.org>)
 >>> net = Network.parse(f, format="GRID")

Also, assuming that

 >>> net = create_network()

creates a NetworkObject representing an empty network, you could instead 
use the initialization function of Network objects. As in

 >>> import Network
 >>> net = Network.NetworkObject()

For the example above, you might then also consider

 >>> import Network
 >>> f = open(<GRID flat file from http://theBioGRID.org>)
 >>> net = Network.NetworkObject(f, format="GRID")
(Continue reading)

bugzilla-daemon | 4 Jun 2007 15:46

[Bug 2269] Shebang (hashbang) lines need cleanup

http://bugzilla.open-bio.org/show_bug.cgi?id=2269

------- Comment #1 from mdehoon <at> ims.u-tokyo.ac.jp  2007-06-04 09:46 EST -------
Do we actually need the shebangs?
Unless the Biopython scripts are intended to be run as a stand-alone program
(and appear as such to the user), we may as well remove all the shebang lines.

--

-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon | 4 Jun 2007 16:01

[Bug 2269] Shebang (hashbang) lines need cleanup

http://bugzilla.open-bio.org/show_bug.cgi?id=2269

------- Comment #2 from biopython-bugzilla <at> maubp.freeserve.co.uk  2007-06-04 10:01 EST -------
>From looking at the code, some of the files ARE intended to be run as a script
- they do a "__main__" check to detect this and then do something based on the
command line arguments.

I personally have never used any of them in this way - but there may be some
users out there who do.

--

-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon | 4 Jun 2007 16:19

[Bug 2269] Shebang (hashbang) lines need cleanup

http://bugzilla.open-bio.org/show_bug.cgi?id=2269

------- Comment #3 from mdehoon <at> ims.u-tokyo.ac.jp  2007-06-04 10:19 EST -------
> From looking at the code, some of the files ARE intended to be run as a script
> - they do a "__main__" check to detect this and then do something based on the
> command line arguments.

If we remove the shebangs, users can still do

python script.py

if they want to run script.py as a script.

With the shebangs, users can do

./script.py

instead. But IMHO, for Biopython scripts the advantage is minimal, and won't
work on Windows.

Well let's wait a few days to see if somebody steps forward who really needs
the shebangs.

--

-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon | 4 Jun 2007 16:56

[Bug 2269] Shebang (hashbang) lines need cleanup

http://bugzilla.open-bio.org/show_bug.cgi?id=2269

------- Comment #4 from dalloliogm <at> gmail.com  2007-06-04 10:56 EST -------
Well, I think it's a good practice to add the shebang to the beginning of every
script, I don't know why you want to remove it ;)

In the future, if I'm going to be able to contribute to the biopython code with
some script, I will use the #!/usr/bin/env form.

--

-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon | 4 Jun 2007 18:04

[Bug 2269] Shebang (hashbang) lines need cleanup

http://bugzilla.open-bio.org/show_bug.cgi?id=2269

------- Comment #5 from chris.lasher <at> gmail.com  2007-06-04 12:04 EST -------
FWIW, the shebang appears to convey the Python file is meant to be executed in
a standalone fashion*, rather than be used as a module. Since Biopython
consists largely of modules, I can agree with Michiel that, with exception of
the test scripts, the shebangs ought to be removed. I need to check more of the
files, but it seems modules which are written with an "if __name__ ==
'__main__'" check simply execute some test code, or even nothing, if true. This
indicates they truly are meant to be modules rather than standalone scripts,
making a case for removing their shebangs.

That said, there's no real harm in having the shebangs in the files. I think
consistency is more key. If we do allow shebangs, we ought to set a standard.

* See
<http://groups.google.com/group/comp.lang.python/browse_thread/thread/bbb75a35b6175217>
alternative TinyURL: <http://tinyurl.com/2kmso2>

--

-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
Jake Feala | 4 Jun 2007 19:55
Picon

interaction networks in biopython

Michiel -

Thanks for the advice.  For consistency with Biopython parsers, I did
write an __init__.py for the module that contains a parse(f,format)
function to behave like you suggest.  I'll put the script up on the
website (http://cmrg.ucsd.edu/JakeFeala#software) with the others.

As for the create_network function, I think it is necessary to pass a
"directed" argument in order to create a Network object with the right
superclass.  (sorry this was not obvious from the usage example I
gave).  My Network objects inherit either a directed or undirected
graph class from the existing NetworkX package.  The code looks like
this:

from networkx import XGraph,XDiGraph

def create_network(directed=False):
    """Generates Network object derived from a directed or undirected
NetworkX Graph class """
    if not directed:
        GraphClass = XGraph
    else:
        GraphClass = XDiGraph

    class Network(GraphClass):
        """Biological network based on NetworkX XGraph class.  This wrapper
        bundles biological annotations (from InteractionRecord) with the
        graph representation and offers compatibility with Biopython, SBML,
        and Cytoscape
        """
(Continue reading)

bugzilla-daemon | 13 Jun 2007 11:33

[Bug 2090] Blast.NCBIStandalone BlastParser fails with blastall 2.2.14

http://bugzilla.open-bio.org/show_bug.cgi?id=2090

------- Comment #12 from biopython-bugzilla <at> maubp.freeserve.co.uk  2007-06-13 05:33 EST -------
Created an attachment (id=676)
 --> (http://bugzilla.open-bio.org/attachment.cgi?id=676&action=view)
BLASTX 2.2.15 plain text output

Example from Italo Maia (see mailing list)

--

-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon | 13 Jun 2007 11:35

[Bug 2090] Blast.NCBIStandalone BlastParser fails with blastall 2.2.14

http://bugzilla.open-bio.org/show_bug.cgi?id=2090

------- Comment #13 from biopython-bugzilla <at> maubp.freeserve.co.uk  2007-06-13 05:35 EST -------
Created an attachment (id=677)
 --> (http://bugzilla.open-bio.org/attachment.cgi?id=677&action=view)
BLASTX 2.2.15 plain text output with no hits

Another example from Italo Maia via the mailing list

--

-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Gmane