HI Mark,
This is very cool!
Could i persuade you to post this to cytoscape-discuss? I've been thinking lately that that is would be a better forum for our occasional emails -- better than rcyot...@google.groups.
- Paul
> On Aug 13, 2012, at 4:40 PM, Grimes Mark wrote:
>
>> Paul
>>
>> The saveImage command works! This is good.
>>
>> To note: the help file in RCy says only 'jpeg' is supported as image type, but the R console says
>> 'Error: image.type %in c("png", "pdf", "svg") is not TRUE'
>>
>> Also: the image is saved to the top-level directory, not the one found by getwd().
>>
>> So it works if you use one of the three formats above and the full path is specified.
>>
>> Mark
>>
>>
>> On Aug 10, 2012, at 5:09 PM, Paul Shannon wrote:
>>
>>> Hi Mark,
>>>
>>> Does saveImage help here?
>>>
>>>
http://db.systemsbiology.net:8080/cytoscape/RCytoscape/versions/current/methods/saveImage.html
>>>
>>> - Paul
>>>
>>>
>>> On Aug 10, 2012, at 4:05 PM, Grimes Mark wrote:
>>>
>>>> Paul
>>>>
>>>> I have a network with coordinates in three dimensions. Using RCytoscape it is possible to give the appearance of three dimensions, if the background is set to black (or a dark color) and the edges are not black, using:
>>>>
>>>> setNodePosition (cywindow, as.character(cf$Node.Name), newcoords[,1], newcoords[,2])
>>>> scaleop = scale(newcoords[,3], scale=T, center=T)
>>>> nodeop = 255*scale((scaleop + abs(min(scaleop))), scale=(max(scaleop) + abs(min(scaleop))), center=FALSE)
>>>> setNodeOpacityDirect(cywindow, as.character(cf$Node.Name), nodeop)
>>>>
>>>> Using package 'rgl' it is possible to achieve 3D transformations in an animation, as in the following example.
>>>>
>>>> for (i in 1:15) {
>>>> newcoords <- rotate3d(oldcoords, pi/45, 0, 1, 0)
>>>> setNodePosition (cywindow, as.character(cf$Node.Name), newcoords[,1], newcoords[,2])
>>>> scaleop = scale(newcoords[,3], scale=T, center=T)
>>>> nodeop = 255*scale((scaleop + abs(min(scaleop))), scale=(max(scaleop) + abs(min(scaleop))), center=FALSE)
>>>> setNodeOpacityDirect(cywindow, as.character(cf$Node.Name), nodeop)
>>>> #fitContent (cywindow)
>>>> #showGraphicsDetails (cywindow, TRUE)
>>>> oldcoords=newcoords
>>>> Sys.sleep(1)
>>>> }
>>>>
>>>> This animation would make a marvelous movie (by importing individual frames) if the ability to save the network as a jpg file is inserted into the above loop. If you have time and inclination, I would like to request that the following hypothetical command be made available:
>>>>
>>>> exportNetworkView (cywindow, filename, format='jpeg')
>>>>
>>>> This would also be useful for format='pdf' (or other formats) to make figures for publication, but of course this could be done manually using the Cytoscape GUI. Manually saving hundreds of such files for a movie, however, is impractical, hence my request.
>>>>
>>>> Thanks and best wishes,
>>>>
>>>> Mark Grimes
>>>> University of Montana
>>>
>>
>
> <RCyMovie1.mp4>