[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to draw a distance map with Ruby

Marc Hoeppner

6/2/2008 1:43:00 PM

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-....

12 Answers

G.Durga Prasad

6/2/2008 4:23:00 PM

0

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-....
>
>

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

Prasad

Axel Etzold

6/2/2008 10:21:00 PM

0


-------- 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-....
> >
> >
>
> 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/...

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_...

joseph collins

6/2/2008 10:55:00 PM

0


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
>=20
>=20
> -------- 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
>=20
> > 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-....
> > >
> > >
> >=20
> > I am just examining RubyDCL (ruby-dcl-1.5.3). May be you will find
> > something useful there.
> >=20
> > Prasad
>=20
> Dear Marc,
>=20
> maybe you can use RGL in some way:
>=20
> http://rgl.rubyforge.org/rgl/...
>=20
> There is some care taken of the distance in the second example module_gra=
ph.jpg,=20
> not yet what you asked for, but there's a description language, 'dot', as=
sociated to the
> project, which might be tweakable into what you asked for.
>=20
> Best regards,
>=20
> Axel=20
>=20
>=20
> --=20
> GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
> Jetzt dabei sein: http://www.shortview.de/?mc=3Dsv_...
>=20

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

Todd Benson

6/2/2008 11:22:00 PM

0

On Mon, Jun 2, 2008 at 5:54 PM, joseph collins <joec_49@hotmail.com> wrote:
>
> 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

joseph collins

6/3/2008 12:50:00 AM

0


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.N=
ET?2-Can ruby programs be turned into .exe files if needed?3-Does Ruby supp=
ort 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 - thank=
s! Joe
_________________________________________________________________
Change the world with e-mail. Join the i=92m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=3DEML_WL_...
ld=

James Britt

6/3/2008 1:10:00 AM

0

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

Phlip

6/3/2008 1:56:00 AM

0

joseph collins wrote:

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

Yes.

> I need
> inputfrom the Ruby programmers:1-Can ruby programs create Guis much like
> C# and VB.NET?

Ruby has bindings for Gtk+, Tk (TCL/Tk), Fox, and native Windows. It also
has web platforms like Merb and Rails, which are competitive with C# using
mere web pages - and Ajax.

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

Not directly. However, the best kind of application uses multiple layers,
and putting a Ruby layer inside a C program is very easy.

> 3-Does Ruby support regexp like Perl does?

Ruby was invented to compete with Perl over such details: Yes.

That's why Ruby is named after a gem that is next after "pearl" in
alphabetical order.

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

Yes. Better, Ruby uses object oriented notation, instead of the
bass-ackwards system Perl often uses. For example, shift in Perl
behaves sometimes like a magic keyword, and sometimes not. In
Ruby, string.shift is always a method and always interprets like
one.

> 5-Does ruby have anything like associative
> arrays?

Yes - the Hash type.

M. Edward (Ed) Borasky

6/3/2008 2:34:00 AM

0

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_C...
>

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. :)

Axel Etzold

6/3/2008 7:07:00 AM

0


-------- 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/mult...

Eivind Eklund

6/3/2008 9:41:00 AM

0

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?

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.