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