Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
location to load python code fro using CytoscapeRPC
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
sanjan  
View profile  
 More options Jun 19 2012, 2:21 am
From: sanjan <tpsan...@gmail.com>
Date: Mon, 18 Jun 2012 23:21:57 -0700 (PDT)
Local: Tues, Jun 19 2012 2:21 am
Subject: location to load python code fro using CytoscapeRPC
Hi,

I just installed the cytoscapeRPC plug in so that i can write a python
code for automating the process of loading files into Cytoscape and
saving the generated output.I found the following code in one of the
earlier discussions:
https://trac.nbic.nl/brs2011p07/browser/trunk/brs2011p07/src/piqc/dat...

I would like to know the path as to where the code should be saved for
compiling.I am using cytoscape2.8.3 version(installed on ubuntu12.04)
which is stored in my desktop.I tried by saving the code in cytoscape
dir as well as in documents dir.(pasted the code given in above link
in gedit and tried compiling using terminal)But none worked.

Thanks in advance.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim te Beek  
View profile  
 More options Jun 20 2012, 9:20 am
From: Tim te Beek <timteb...@gmail.com>
Date: Wed, 20 Jun 2012 06:20:30 -0700 (PDT)
Local: Wed, Jun 20 2012 9:20 am
Subject: Re: location to load python code fro using CytoscapeRPC

Hi Sanjan,

The latest version of that project is located here:
https://trac.nbic.nl/brs2011p07/browser/tags/python-cytoscape-rpc/src...
The link you ave points to a old revision, the tag above is more stable.

You can store the python code anywhere you want, preferably outside the
Cytoscape install folder. It's not tied to Cytoscape in anyway: It merely
talks to the XMLRPC server that you can enable from the CytoscapeRPC
plugin. To run the code just type `python data2network.py` in your favorite
terminal.

Does that help?

Best regards,
Tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sanjan Tp  
View profile  
 More options Jun 20 2012, 12:46 pm
From: Sanjan Tp <tpsan...@gmail.com>
Date: Wed, 20 Jun 2012 22:16:14 +0530
Local: Wed, Jun 20 2012 12:46 pm
Subject: Re: [Cytoscape-discuss] Re: location to load python code fro using CytoscapeRPC

Hi Tim,

Actually i tried compiling the code and got the following error message:
Traceback (most recent call last):
  File "data2net.py", line 8, in <module>
    from __init__ import connect2cytoscape
ImportError: cannot import name connect2cytoscape

Actually I could not figure out as to where to mention the input file
name(its gedit text file having two columns separated by tab-former being
source and the latter being target).
In fact i have a directory of such files.So instead of filename can dir be
mentioned and made to iterate over all the files?

Thanks for spending time.

Sanjan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim te Beek  
View profile  
 More options Jun 20 2012, 4:13 pm
From: Tim te Beek <timteb...@gmail.com>
Date: Wed, 20 Jun 2012 13:13:41 -0700 (PDT)
Local: Wed, Jun 20 2012 4:13 pm
Subject: Re: [Cytoscape-discuss] Re: location to load python code fro using CytoscapeRPC

Hi Sanjan,

Could it be that you're getting this error because you've only compied the
data2networkpy file, and not the accompanying __init__.py file? That would
explain the error that you're getting.

Also, I'm somewhat confused as to what you are trying to achieve: Do you
want to write your own code that connects to cytoscape using my code as an
example, or do you merely want to use the python scripts I've created?

I could make my code run by executing the following statements in this
order:
$ svn co
https://trac.nbic.nl/svn/brs2011p07//tags/python-cytoscape-rpc/src/piqc
A    piqc/test
A    piqc/test/__init__.py
A    piqc/test/test_data2network.py
A    piqc/count_graphs.py
A    piqc/__init__.py
A    piqc/data2network.py
Checked out revision 436.

$ python data2network.py --help
Usage: Data2Network.py [options]

Convert a spreadsheet of data to a Cytoscape network.

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -f FILE, --file=FILE  Peptide identification and quantification data as
.tsv
                        or .csv
  -s SOURCE, --source=SOURCE
                        Source node attribute
  -t TARGET, --target=TARGET
                        Target node attribute

$ python data2network.py -f ../../my_import_file.tsv -s Source_column -t
Target_column
...

This script is however a very complicated way to import data: For single
files it's probably better to use the Table Import Plugin already provided
with Cytoscape. For the directory of files that you mention you would have
to write the loop in bash, or alter the Python code yourself. This is
currently not supported, and probably wont be in the future, as I've moved
development to Java instead of Python.

If you want to use my scripts as an example on how to connect to Cytoscape
& CytoscapeRPC from Python, have a look at, and maybe copy, the __init__.py
file from the same folder:
https://trac.nbic.nl/brs2011p07/browser/tags/python-cytoscape-rpc/src...

It contains a connect2cytoscape method that returns a handle that allows
you to execute all the commands listed in the CytoscapeRPC documentation:
http://homepage.tudelft.nl/f1f6a/CytoscapeRPC_v1.7/tudelft/CytoscapeR...
It's best to explore this from an interactive Python session, preferably an
iPython session because you'll get tab-completion on the available methods.

Please let me know what it is you're trying to achieve, so I can target my
suggestions accordingly.

Best,
Tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sanjan Tp  
View profile  
 More options Jun 21 2012, 3:34 am
From: Sanjan Tp <tpsan...@gmail.com>
Date: Thu, 21 Jun 2012 13:04:23 +0530
Local: Thurs, Jun 21 2012 3:34 am
Subject: Re: [Cytoscape-discuss] Re: location to load python code fro using CytoscapeRPC

Hi TIm,

I converted one of the text files to csv file(in libre calc) and tried
compiling _init_.py first but still getting the same error as follows:

sanjan@ubuntu:~/Documents/programs/cytoRPC$ python _init_.py
sanjan@ubuntu:~/Documents/programs/cytoRPC$ python data2net.py -f test.csv
-s source -t target
Traceback (most recent call last):
  File "data2net.py", line 8, in <module>
    from __init__ import connect2cytoscape
ImportError: cannot import name connect2cytoscape

Let me clearly state what i am trying to do:

I have a large number of text files having two columns separated by
tab(source and target).All of them are stored in one directory.Instead of
manually importing  the files into cytoscape,generate graph ,use network
anlyser plug-in and finally save the statistics generated(deg
distribution,clustering coeff. etc), I thought of automating it through RPC
plug in.But since I am fairly new to python couldn't code it and thought of
using ur code as it too serves similar purpose.

I would be glad if there's a custom made code or if u can give some
pointers as to how to code in python or bash.

I am familiar with basics of python but dont know how to load files to
cytoscape , generate graphs...

thanks,

Sanjan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim te Beek  
View profile  
 More options Jun 21 2012, 4:04 am
From: Tim te Beek <timteb...@gmail.com>
Date: Thu, 21 Jun 2012 10:04:56 +0200
Local: Thurs, Jun 21 2012 4:04 am
Subject: Re: [Cytoscape-discuss] Re: location to load python code fro using CytoscapeRPC

Not sure why that would be failing.. Could you instead copy the contents of
__init__.py to the start of data2net.py, and remove the following line:

from __init__ import connect2cytoscape

You should then be able to remove the __init__.py as a separate file, and
running data2net.py should work, provided you have Cytoscape open, and the
CytoscapeRPC plugin server is running.

Best,
Tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sanjan Tp  
View profile  
 More options Jun 21 2012, 8:36 am
From: Sanjan Tp <tpsan...@gmail.com>
Date: Thu, 21 Jun 2012 18:06:04 +0530
Local: Thurs, Jun 21 2012 8:36 am
Subject: Re: [Cytoscape-discuss] Re: location to load python code fro using CytoscapeRPC

Hey it worked.Thanks for the info.

But the  fact is i need to convert the file to csv everytime(the text files
i hav are .dat/.sif)

So i was thinking of using the following code:
https://trac.nbic.nl/cytoscaperpc/browser/CytoscapeRPC/scripts<http://www.google.com/url?sa=D&q=https://trac.nbic.nl/cytoscaperpc/br...>

the file loadnetwork.py

I modified the code a little bit as i dont have any edge and node attribute
files(attached code).The code ran and created only one node and terminated
giving the following error:

sanjan@ubuntu:~/Documents/programs/cytoRPC$ python myload.py 9000 ip
test_216
Working on sif-file: eco_links156_long.sif
Traceback (most recent call last):
  File "myload.py", line 139, in <module>
    run()
  File "myload.py", line 109, in run
    edge_ids = server.Cytoscape.createEdges(netid, nodes_from,
nodes_to,[True]*len(nodes_to), True)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 0: 'No method matching arguments: java.lang.String,
[Ljava.lang.Object;, [Ljava.lang.Object;, [Ljava.lang.Object;,
java.lang.Boolean'>

Also can the network analyser(the preinstalled one on cytoscape2.8.3)
plug-in be used through RPC?

-
Sanjan

  myload.py
6K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim te Beek  
View profile  
 More options Jun 21 2012, 9:40 am
From: Tim te Beek <timteb...@gmail.com>
Date: Thu, 21 Jun 2012 15:40:11 +0200
Local: Thurs, Jun 21 2012 9:40 am
Subject: Re: [Cytoscape-discuss] Re: location to load python code fro using CytoscapeRPC

Hi Sanjan,

Sorry to say I can't help you with that: I have no experience with that
script, or calling plugins through CytoscapeRPC, but maybe Jan Bot can help
you (it's his script).

Best,
Tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »