How to draw a distance map with Ruby

Hi!

I have been scratching my head over this and thought someone here can
help me out:

I have a number of data points that I want to plot in a 2 or 3d space
based on pairwise distances. I do have the distances, but frankly no
idea of how to do the mapping/plotting.

I am not necessarily looking for a complete solution - but would be
grateful if someone could point me in the right direction (tutorials or
which methods to use in ruby..)

Cheers,

Marc

···

--
Posted via http://www.ruby-forum.com/.

I am just examining RubyDCL (ruby-dcl-1.5.3). May be you will find
something useful there.

Prasad

···

On Mon, Jun 2, 2008 at 7:12 PM, Marc Hoeppner <marc.hoeppner@molbio.su.se> wrote:

Hi!

I have been scratching my head over this and thought someone here can
help me out:

I have a number of data points that I want to plot in a 2 or 3d space
based on pairwise distances. I do have the distances, but frankly no
idea of how to do the mapping/plotting.

I am not necessarily looking for a complete solution - but would be
grateful if someone could point me in the right direction (tutorials or
which methods to use in ruby..)

Cheers,

Marc
--
Posted via http://www.ruby-forum.com/\.

-------- Original-Nachricht --------

Datum: Tue, 3 Jun 2008 01:23:08 +0900
Von: "G.Durga Prasad" <gdprasad@gmail.com>
An: ruby-talk@ruby-lang.org
Betreff: Re: How to draw a distance map with Ruby

> Hi!
>
> I have been scratching my head over this and thought someone here can
> help me out:
>
> I have a number of data points that I want to plot in a 2 or 3d space
> based on pairwise distances. I do have the distances, but frankly no
> idea of how to do the mapping/plotting.
>
> I am not necessarily looking for a complete solution - but would be
> grateful if someone could point me in the right direction (tutorials or
> which methods to use in ruby..)
>
> Cheers,
>
> Marc
> --
> Posted via http://www.ruby-forum.com/\.
>
>

I am just examining RubyDCL (ruby-dcl-1.5.3). May be you will find
something useful there.

Prasad

Dear Marc,

maybe you can use RGL in some way:

http://rgl.rubyforge.org/rgl/index.html

There is some care taken of the distance in the second example module_graph.jpg,
not yet what you asked for, but there's a description language, 'dot', associated to the
project, which might be tweakable into what you asked for.

Best regards,

Axel

···

On Mon, Jun 2, 2008 at 7:12 PM, Marc Hoeppner > <marc.hoeppner@molbio.su.se> wrote:

--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx

I wonder if I stop using perl and start using Ruby.
1-Can ruby programs create Guis much like C# and VB.NET?
2-Can ruby programs be turned into .exe files if needed?
3-Does Ruby support regexp like Perl does?
4-If Ruby as good as perl is when processing text?
5-Does ruby have anything like associative arrays?

Feedback needed

Joe

···

Date: Tue, 3 Jun 2008 07:20:34 +0900
From: AEtzold@gmx.de
Subject: Re: How to draw a distance map with Ruby
To: ruby-talk@ruby-lang.org

-------- Original-Nachricht --------
> Datum: Tue, 3 Jun 2008 01:23:08 +0900
> Von: "G.Durga Prasad" <gdprasad@gmail.com>
> An: ruby-talk@ruby-lang.org
> Betreff: Re: How to draw a distance map with Ruby

> On Mon, Jun 2, 2008 at 7:12 PM, Marc Hoeppner > > <marc.hoeppner@molbio.su.se> wrote:
> > Hi!
> >
> > I have been scratching my head over this and thought someone here can
> > help me out:
> >
> > I have a number of data points that I want to plot in a 2 or 3d space
> > based on pairwise distances. I do have the distances, but frankly no
> > idea of how to do the mapping/plotting.
> >
> > I am not necessarily looking for a complete solution - but would be
> > grateful if someone could point me in the right direction (tutorials or
> > which methods to use in ruby..)
> >
> > Cheers,
> >
> > Marc
> > --
> > Posted via http://www.ruby-forum.com/\.
> >
> >
>
> I am just examining RubyDCL (ruby-dcl-1.5.3). May be you will find
> something useful there.
>
> Prasad

Dear Marc,

maybe you can use RGL in some way:

http://rgl.rubyforge.org/rgl/index.html

There is some care taken of the distance in the second example module_graph.jpg,
not yet what you asked for, but there's a description language, 'dot', associated to the
project, which might be tweakable into what you asked for.

Best regards,

Axel

--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx

_________________________________________________________________
Change the world with e-mail. Join the i’m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ChangeWorld

I wonder if I stop using perl and start using Ruby.
1-Can ruby programs create Guis much like C# and VB.NET?

That's a vague question, but the answer: probably not the same kind of
GUI API you're thinking of.

2-Can ruby programs be turned into .exe files if needed?

Yes. But that's Windows, so your question misses a large user base.

3-Does Ruby support regexp like Perl does?

I'm going to go with Yes on this one. There are differences between
releases, though (look behind capabilities, etc.)

4-If Ruby as good as perl is when processing text?

Depends on the programmer.

5-Does ruby have anything like associative arrays?

This last question will have many ruby programmers silently biting
their teeth. You may not have done your homework. For Giggles and
Sits...

h = {}

Feedback needed

Joe

A bunch of articles that spear, roast, and slice these questions --
complete with gravy -- frequent a simple google search. Funny, I
didn't think I would ever say that.

hth,
Todd

···

On Mon, Jun 2, 2008 at 5:54 PM, joseph collins <joec_49@hotmail.com> wrote:

I wonder if I should stop using perl and start using Ruby. I need inputfrom the Ruby programmers:1-Can ruby programs create Guis much like C# and VB.NET?2-Can ruby programs be turned into .exe files if needed?3-Does Ruby support regexp like Perl does?4-If Ruby as good as perl is when processing text?5-Does ruby have anything like associative arrays? Feedback needed - thanks! Joe

···

_________________________________________________________________
Change the world with e-mail. Join the i’m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ChangeWorld

-------- Original-Nachricht --------

Datum: Tue, 3 Jun 2008 07:54:57 +0900
Von: joseph collins <joec_49@hotmail.com>
An: ruby-talk@ruby-lang.org
Betreff: Re: How to draw a distance map with Ruby

I wonder if I stop using perl and start using Ruby.
1-Can ruby programs create Guis much like C# and VB.NET?
2-Can ruby programs be turned into .exe files if needed?
3-Does Ruby support regexp like Perl does?
4-If Ruby as good as perl is when processing text?
5-Does ruby have anything like associative arrays?

Feedback needed

Joe

Joe,

when posting to this list, please don't hijack other people's threads...

Best regards,

Axel

···

--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

joseph collins wrote:

I wonder if I should stop using perl and start using Ruby. I need inputfrom the Ruby programmers:

1-Can ruby programs create Guis much like C# and VB.NET?

Yes. I suggest using JRuby + Monkeybars for maximum power + most ease of use.

But there's also Fx, Tk, a few other options.

2-Can ruby programs be turned into .exe files if needed?

Um, depends on what you mean.

There is rubyscript2exe that bundles up your code + a Ruby interpreter in a self-executing file, and using JRuby + the rawr lib you can easily create distributable executable files for distribution, but these are not actually turning Ruby code into native code.

3-Does Ruby support regexp like Perl does?

Yes, though not exactly as Perl does. Some small syntax variance.

4-If Ruby as good as perl is when processing text?

I think so. Don't see why not, but I haven't used perl in 4 years.

5-Does ruby have anything like associative arrays?

yes. We call them hashes.

···

--
James Britt

"I can see them saying something like 'OMG Three Wizards Awesome'"
   - billinboston, on reddit.com

joseph collins wrote:

I wonder if I should stop using perl and start using Ruby.

Probably not. Perl has certain advantages, not the least of which is the fact that you know it.

I need input from the Ruby programmers:

1-Can ruby programs create Guis much like C# and VB.NET?

There are quite a few GUI toolkits for Ruby. A Frequently Asked Question here is "which one is the best?" And the answer is usually "it depends."

2-Can ruby programs be turned into .exe files if needed?

Probably not as easily as Perl programs can.

3-Does Ruby support regexp like Perl does?

Yes.

4-If Ruby as good as perl is when processing text?

Yes.
5-Does ruby have anything like associative arrays?

Yes.
  Feedback needed - thanks! Joe

_________________________________________________________________
Change the world with e-mail. Join the i’m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ChangeWorld

Just out of curiosity, are you at Microsoft? There's something called IronRuby from Microsoft that runs Ruby on the CLR -- it might be just what you're looking for. As far as I know, there's no "IronPerl", although there is an IronPython, to throw another language into the mix. :slight_smile:

More or less. The Perl convention of having empty string and 0 mean
false and the automatic conversion between numbers and strings
sometimes makes text processing in Perl a bit more convenient; on the
other hand, the convention in Ruby makes most other things more
convenient.

Eivind.

···

On Tue, Jun 3, 2008 at 2:49 AM, joseph collins <joec_49@hotmail.com> wrote:

4-If Ruby as good as perl is when processing text?

Not stopping perl is ok; not starting Ruby might be a missed
opportunity though, well of course only you can decide about your
available time.
<skip>
Cheers
Robert

···

On Tue, Jun 3, 2008 at 4:33 AM, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

joseph collins wrote:

I wonder if I should stop using perl and start using Ruby.

Probably not. Perl has certain advantages, not the least of which is the
fact that you know it.

Thanks - that is what I wanted to hear....I have used perl heavily and it has served me well.
I will look further into Ruby.

Joe

···

Date: Tue, 3 Jun 2008 10:10:16 +0900
From: james.britt@gmail.com
Subject: Re: Ruby or Perl?
To: ruby-talk@ruby-lang.org

joseph collins wrote:
> I wonder if I should stop using perl and start using Ruby. I need input from the Ruby programmers:
1-Can ruby programs create Guis much like C# and VB.NET?
Yes. I suggest using JRuby + Monkeybars for maximum power + most ease of use.
But there's also Fx, Tk, a few other options.

2-Can ruby programs be turned into .exe files if needed?
Um, depends on what you mean.
There is rubyscript2exe that bundles up your code + a Ruby interpreter
in a self-executing file, and using JRuby + the rawr lib you can easily
create distributable executable files for distribution, but these are
not actually turning Ruby code into native code.

3-Does Ruby support regexp like Perl does?
Yes, though not exactly as Perl does. Some small syntax variance.

4-If Ruby as good as perl is when processing text?
I think so. Don't see why not, but I haven't used perl in 4 years.

5-Does ruby have anything like associative arrays?
yes. We call them hashes.

--
James Britt

"I can see them saying something like 'OMG Three Wizards Awesome'"
   - billinboston, on reddit.com

_________________________________________________________________
Search that pays you back! Introducing Live Search cashback.
http://search.live.com/cashback/?&pkw=form=MIJAAF/publ=HMTGL/crea=srchpaysyouback