Re: [Cytoscape-discuss] Using Cytoscape plugin to open GSEA enrichment results

83 views
Skip to first unread message
Message has been deleted

Oliver Stueker

unread,
Dec 5, 2009, 11:18:57 AM12/5/09
to cytoscap...@googlegroups.com
Hi Francesco,

The 'Excel" files that are generated by GSEA are in fact tab-separated
text files with an .xls file-extension.

On Mon, Nov 30, 2009 at 17:30, Franktwis <francesco...@gmail.com> wrote:
> Hi all,
> I've encountered some problems trying to open files returned from GSEA
> with Java. Someone had used them?
> It's impossible to open a file xls with Jxl libraries if you don't do
> some preliminary operations on the file.

> I tried copy and paste the text on a new file and java now can open it.

Hm, this sounds more like you have encoding issues ( Unix/Mac/Windows
newlines or ASCII/ANSI/UTF8 encoding).

Try to inspect both files ecoding with a good text-editor (don't know
which OS you are on, but Jedit is available for all major systems)
or with the Unix-Command "file" (comes with Linux and MacOSX, Windows
version available at gnuwin32.sourceforge.net).

You can also write your own file reader (e.g. using
cytoscape.data.readers.TextFileReader).


Oliver

> But I wouldn't do this
> operation and I'll use the file directly. A similar situation happen
> with .gct files that Jxl libraries don't recognize as a stream.
> Someone knows how to use these files?
> Thanks
>

Franktwis

unread,
Dec 6, 2009, 7:03:11 AM12/6/09
to cytoscape-discuss
Hi Oliver,
thanks for your answer. Maybe is like you tell me cause files were
produced on another operating system (Windows) and I use MACOSX
SnowLeopard. For now I cannot use GSEA to produce them.
The other file I cannot open is a .gct file that someone converted for
me in Excel but, googling, I found that XLS libraries can open only
original produced Excel files, not other format.
How can I open these files using Cytoscape Libraries?
I watched the class you said and it seems minimal. I have only to open
file with:
TextFileReader(String filename)
and read fields with: getText()
is it correct?
Francesco
On 5 Dic, 17:18, Oliver Stueker <ostue...@gmail.com> wrote:
> Hi Francesco,
>
> The 'Excel" files that are generated by GSEA are in fact tab-separated
> text files with an .xls file-extension.
>

Oliver Stueker

unread,
Dec 7, 2009, 10:24:24 AM12/7/09
to cytoscap...@googlegroups.com
Hi Francesco,

there's probably more than one way to do it, but how about:

import cytoscape.data.readers.TextFileReader;

TextFileReader reader = new TextFileReader("file.gct");
reader.read();
String fullText = reader.getText();

String[] lines = fullText.split("\n"); // split whole file into lines

for (int i=0; i < lines.length ; i++ ) {
String[] tokens = lines[i].split("\t"); // split line into tokens
// ...
--
Oliver Stueker
Post-doctoral Fellow, Bader Lab
Donnelly CCBR, University of Toronto, Canada
http://baderlab.org
phone: +1 (416) 978-0571
Message has been deleted

Franktwis

unread,
Dec 7, 2009, 2:03:47 PM12/7/09
to cytoscape-discuss
Ok.. I rewrited all the code reading the file using this class and
using your code.
Eclipse says there's no errors... but I'll try to compile it
tomorrow... :D
I'll let you know if it works!
Thanks for all
Francesco

On 7 Dic, 16:24, Oliver Stueker <ostue...@gmail.com> wrote:
> Hi Francesco,
>
> Donnelly CCBR, University of Toronto, Canadahttp://baderlab.org
> phone: +1 (416) 978-0571

Franktwis

unread,
Dec 12, 2009, 6:23:08 AM12/12/09
to cytoscape-discuss
It works!
Thanks a lot
Reply all
Reply to author
Forward
0 new messages