How to download REVIGO TreeMap as Image? Also need help for Python script
2
0
Entering edit mode
5.3 years ago
Farbod ★ 3.4k

Hi,

1- How can I simply download REVIGO scatter-plot and/or TreeMap as image (not .CSV or .r)?

2- I have found a Python script here (appreciate it's creator) and it goes well for it's the example but I can not use that for my own data.

of course it has some help as "# For actual data, use open('mydata.txt').read()" in this regard, but I could not figure out how I should change the script and where I should put my data as they are already online I the REVIGO site and my results are online, too.

Thanks

python revigo GO software error • 5.2k views
3
Entering edit mode
5.3 years ago
Diwan ▴ 650

If you want the treemap for publication purposes, it is best to use "make R script" option. Just run the script in R and you will get the image inside R which you can save as figure or pdf. Moreover, it will also allow you to modify font/color etc. If you need it for presentation, just print screen and copy to slide : ) .

Edit: Farbod, First, you can try the example given in revigo website. I ran their example #1. In the output, just below the "treemap" view, you will find a link: Make R script for plotting treemaps.It will save the script as "Revigo_treemap.R"

In R all you need is: install.packages( "treemap" )

Run the script "Revigo_treemap.R". You will get treemap pdf as output.

eg: revigooutput

You can repeat the same process using your input data. HTH

0
Entering edit mode

Hi, @ Diwan and thanks, I have installed it and tried that but I received the following error:

Error in treemap(...) : vSize is invalid column name

0
Entering edit mode

Hi and thank you,

I works for sample#1 for me, but when I used my own data, the same error occurred:

Note: tmPlot deprecated as of version 2.0. Please use treemap instead.
Error in treemap(...) : vSize is invalid column name
>
> dev.off()
null device
1

1
Entering edit mode

As it works for the example, its difficult to understand the error message without further details. I can only guess. Based on the script, there is an assignment: vSize = "abslog10pvalue" Can you check if you get some results for : stuff$abslog10pvalue In example #1, you get something like [1] 22 5 300 26 10 25 113 10........... ADD REPLY 0 Entering edit mode you mean I should use "vSize = "stuff$abslog10pvalue"" ?

0
Entering edit mode

I now understand, As I did not use pValue for my graph, the error occur,

So, I made "vSize = "abslog10pvalue"" as comment,

BUT new error has arose :

> stuff$abslog10pvalue <- as.numeric( as.character(stuff$abslog10pvalue) );
Error in \$<-.data.frame(*tmp*, "abslog10pvalue", value = numeric(0)) :
replacement has 0 rows, data has 153

0
Entering edit mode

AND another try:

Error in treemap(...) : argument "vSize" is missing, with no default


so, I guess I must make R realize that I am not using p values, but commenting the " vSize" is not working.

0
Entering edit mode

Good. So that is the source of error. The usual input is GO IDs and associated p-value. Since you don't have pvalue you are getting error where ever it is mentioned. You should comment that line in the script too. As you can see, the Rscript creates a dataframe called stuff with GO terms, pvalues etc and then pass it to treemap function. HTH

0
Entering edit mode

check ?treemap as tmPlot is deprecated. It says dataframe, index, and vsize are required parameters for treemap (also tmPlot) function.

0
Entering edit mode
5.3 years ago
shoujun.gu ▴ 380
1. I am not familiar with this specific software. So no comments on this question.

2. code: os.path.join(url, 'examples', 'example1.txt') will return a string: http://revigo.irb.hr/examples/example1.txt So get the address of your online file and replace 'examples' and 'example1.txt' accordingly to match your file address And as the comment said, if your file is local, use code: open('mydata.txt').read(). Of course ,replace 'mydata.txt' with your actual file path.

0
Entering edit mode

Hi @shoujun.gu and thank you,

But were is the address of my online results? as in any input and change to REVIGO, the address would be the same as " http://revigo.irb.hr"! of course the results are shown in a flash program interactive mode. So, what must I do in this situation? AND as the results can be downloaded as CSV or R files, there is no mydata.txt.

1
Entering edit mode
1. Since I'm not familiar with this software, I have no idea what the address is. Maybe it's hide in a javascript code. etc. But since it can be downloaded, you may download it and use open().read() as the code comment suggested.

2. file extension is just a label. If it's csv, then replace txt with csv.