Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Melt and casting array!

by Don Coyote (Pilgrim)
on Apr 11, 2013 at 17:53 UTC ( #1028200=note: print w/ replies, xml ) Need Help??

in reply to Melt and casting array!

hello perlbird and welcome to the monastery!

I do not know what reshape2 has to offer, but your immediate request would be a fairly simple data manipulation exercise. Along with examples in previous reply.

#!usr/bin/perl use warnings; use strict; my %genetable; while(<DATA>){ chomp; next if /^#/; my ($genekey, $samplevalue ) = split /\t/; push @{ $genetable{$genekey} }, $samplevalue; } print map { "$_ @{$genetable{$_}}\n" } sort keys %genetable; exit 0; __END__ #omitted the header row gene_A sample_1 gene_B sample_1 gene_C sample_1 gene_B sample_2 gene_C sample_2 gene_A sample_3
-------- gene_A sample_1 sample_3 gene_B sample_1 sample_2 gene_C sample_1 sample_2

Comment on Re: Melt and casting array!
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028200]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2015-11-28 21:19 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (745 votes), past polls