Hi Finn,

Thanks lot. This is the first time I'm using Ruby so apologies for the noob 
question. I was successfully able to convert my workflow to DOT after this. 
Thank you all for your quick and efficient replies.

--Kamran

On 28 Mar 2012, at 08:42, Finn Bacall wrote:

> Hi Kamran,
> 
> There's another dependency: t2flow/dot.rb
> 
> Adding 'require "t2flow/dot.rb"' causes your script to execute successfully.
> 
> -Finn
> 
> 
> On 27/03/12 20:07, Kamran Soomro wrote:
>> Ok, I don't know if this is the right place to ask about this, but I 
>> downloaded the taverna-t2flow Ruby gem and installed it. When I run the 
>> following code:
>> 
>> =====================================================================
>> require "rubygems"
>> require "t2flow/model.rb"
>> require "t2flow/parser.rb"
>> 
>> out_file = 
>> File.new("pathways_and_gene_annotations_forqtl_region_290738.dot", "w+")
>> workflow = 
>> File.new("pathways_and_gene_annotations_forqtl_region_290738.t2flow", 
>> "r").read
>> model = T2Flow::Parser.new.parse(workflow)
>> T2Flow::Dot.new.write_dot(out_file, model)
>> =====================================================================
>> 
>> I get the error:
>> 
>> uninitialized constant T2Flow::Dot (NameError)
>> 
>> I did a T2Flow.constants and got the following result:
>> 
>> ["DataflowAnnotation", "ProcessorLinks", "Source", "Parser", "Model", 
>> "Dataflow", "Coordination", "Processor", "Sink", "Datalink"]
>> 
>> As you can see, there is not Dot class in there. What do I do?
>> 
>> --Kamran
>> 
>> On 27 Mar 2012, at 17:04, Kamran Soomro wrote:
>> 
>>> Hi Rob,
>>> 
>>> Thanks a lot for the link. I absolutely do not mind Ruby if I just have to 
>>> use the script as a black box. The less work for me, the better :) A 
>>> question: why would the plugins need to be loaded for the conversion 
>>> process? If it's just for the colour conversions, I am not interested in 
>>> those as I actually need to process the graphs further programmatically. I 
>>> don't care how they look. Is there no way I can circumvent the need for 
>>> loading the plugins?
>>> 
>>> --Kamran
>>> 
>>> P.S., I forgot to link to the tutorial in the previous email. My bad. 
>>> http://www.mygrid.org.uk/usermanual1.6/executeworkflowprogram.html
>>> 
>>> On 27 Mar 2012, at 16:50, Robert Haines wrote:
>>> 
>>>> Hi Kamran,
>>>> 
>>>>> Thanks a lot for the quick reply. Assuming that I have all the
>>>>> plugins available, do I have to perform any other initialisations to
>>>>> get these methods to work or simply constructing the appropriate
>>>>> objects would be enough? Using a bit of Google-Fu, I found the
>>>>> following tutorial. However, it is for Taverna 1.6. Do I have to
>>>>> perform any of the steps mentioned in it? If not, any documentation
>>>>> that would help me get started quickly?
>>>> Something else that you could try, if you don't mind a bit of ruby, is
>>>> the taverna-t2flow gem: https://rubygems.org/gems/taverna-t2flow
>>>> 
>>>> It can parse t2flow and produce the necessary data file needed by dot to
>>>> produce the workflow image. I believe that this is what myExperiment.org
>>>> uses to create its images.
>>>> 
>>>> Note that, as David mentioned earlier, this code will not know about all
>>>> the different activities that could be present as plugins but you
>>>> probably wouldn't find it too difficult to add colour conversions to
>>>> that code should you need them. You might not even need to go that far
>>>> if the workflows you are using don't use any extra plugins.
>>>> 
>>>> Best wishes,
>>>> Rob
>>>> 
>>>>> On 27 Mar 2012, at 16:27, David Withers wrote:
>>>>> 
>>>>>> Hi Kamran,
>>>>>> 
>>>>>> To generate the DOT programmatically you will have to :
>>>>>> 
>>>>>> 1. Parse the workflow file to create a Dataflow object - see
>>>>>> net.sf.taverna.t2.workbench.file.impl.T2DataflowOpener.openDataflow()
>>>>>> 
>>>>>> 
>>>> 2. Generate a Graph from the Dataflow -
>>>> net.sf.taverna.t2.workbench.models.graph.GraphController.generateGraph()
>>>>>> 3. Generate the DOT from the Graph -
>>>>>> net.sf.taverna.t2.workbench.models.graph.DotWriter.writeGraph()
>>>>>> 
>>>>>> It's not quite as simple as this though; as Taverna has a plugin
>>>>>> based architecture you will have to ensure that you also have all
>>>>>> the required activity plugins for all the activity types that your
>>>>>> workflows use.
>>>>>> 
>>>>>> David.
>>>>>> 
>>>>>> On 27 Mar 2012, at 14:32, Kamran Soomro wrote:
>>>>>> 
>>>>>>> Hi,
>>>>>>> 
>>>>>>> I am looking to convert a bunch of Taverna 2 workflows to the DOT
>>>>>>> language in bulk as I don't want to load up each workflow in the
>>>>>>> application and save it manually. I was wondering if there was
>>>>>>> any way to do that? I have looked at the command line tool but
>>>>>>> apparently it doesn't support exporting the workflows to DOT. I
>>>>>>> see that there is an API method to write a Taverna graph to a DOT
>>>>>>> file. If there is no existing way to do what I want, I am ready
>>>>>>> to write my own code and convert the workflow through the API. In
>>>>>>> that case, I would appreciate it somebody can point me to any
>>>>>>> tutorials which can help to understand how I can load the
>>>>>>> workflows and convert them programmatically. Thank you.
>>>>>>> 
>>>>>>> --Kamran
>>>>>>> 
>>>>>> -- David Withers School of Computer Science, University of
>>>>>> Manchester, Oxford Road, Manchester, M13 9PL, UK. +44 (0)161 275
>>>>>> 0683
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ------------------------------------------------------------------------------
>>>>>> 
>>>>>> 
>>>> This SF email is sponsosred by:
>>>>>> Try Windows Azure free for 90 days Click Here
>>>>>> http://p.sf.net/sfu/sfd2d-msazure
>>>>>> _______________________________________________ taverna-users
>>>>>> mailing list [email protected]
>>>>>> [email protected] Web site:
>>>>>> http://www.taverna.org.uk Mailing lists:
>>>>>> http://www.taverna.org.uk/about/contact-us/
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> 
>>>>> 
>>>> This SF email is sponsosred by:
>>>>> Try Windows Azure free for 90 days Click Here
>>>>> http://p.sf.net/sfu/sfd2d-msazure
>>>>> _______________________________________________ taverna-users mailing
>>>>> list [email protected]
>>>>> [email protected] Web site:
>>>>> http://www.taverna.org.uk Mailing lists:
>>>>> http://www.taverna.org.uk/about/contact-us/
>>>> 
>>>> -- 
>>>> Robert Haines
>>>> myGrid Team
>>>> School of Computer Science
>>>> University of Manchester
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> This SF email is sponsosred by:
>>>> Try Windows Azure free for 90 days Click Here
>>>> http://p.sf.net/sfu/sfd2d-msazure
>>>> _______________________________________________
>>>> taverna-users mailing list
>>>> [email protected]
>>>> [email protected]
>>>> Web site: http://www.taverna.org.uk
>>>> Mailing lists: http://www.taverna.org.uk/about/contact-us/
>>> 
>>> ------------------------------------------------------------------------------
>>> This SF email is sponsosred by:
>>> Try Windows Azure free for 90 days Click Here
>>> http://p.sf.net/sfu/sfd2d-msazure
>>> _______________________________________________
>>> taverna-users mailing list
>>> [email protected]
>>> [email protected]
>>> Web site: http://www.taverna.org.uk
>>> Mailing lists: http://www.taverna.org.uk/about/contact-us/
>> 
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> taverna-users mailing list
>> [email protected]
>> [email protected]
>> Web site: http://www.taverna.org.uk
>> Mailing lists: http://www.taverna.org.uk/about/contact-us/
> 
> 
> -- 
> Finn Bacall
> School of Computer Science
> University of Manchester
> http://www.myexperiment.org/
> 


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
taverna-users mailing list
[email protected]
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/

Reply via email to