in reply to Re: Clustering with Perl
in thread Clustering with Perl

Hi there,

Your code athough it has a bug or a error on my side providing incomplete details.

My sample input was
Gene1,Gene2,spc1,spc2
Gene3,Gene1,spc1,spc2,spc4
Gene4,Gene1,spc1,spc2,spc5,spc3,spc1
etc

And I got the correct results.

But the sample can contains entries like the below the number of "gene" is variable can be less or be more

GeneX,GeneY,GeneP,spc1,spc2
GeneY,spc3,spc4

The desired result would be
GeneX,GeneY,GeneP,spc1,spc2,spc3,spc4


But the results which the script gives is
GeneX,GeneY,spc3,GeneP,spc1,spc2,spc4

Replies are listed 'Best First'.
Re^3: Clustering with Perl
by Transient (Hermit) on Jun 25, 2009 at 13:03 UTC
    That's correct - my code assumes two genes per line in the first and second position. I had actually included a comment in my original attempt at solving the problem, but somehow left it out in my post =)

    Update: Can it be assumed then, that a gene starts with "Gene" and the values start with "spc"?