How to create a matrix format in perl
- by shaq
I have an array of array in which each array is like:
clusterA gene1 1
clusterA gene2 0
clusterB gene1 1
clusterB gene2 0
I want to produce a file like:
name gene1 gene2
clusterA 1 0
clusterB 1 0
Current attempt:
if (condition) {
@array = ($cluster, $genes, "1");
}
elsif (not condition) {
@array = ($cluster, $genes, "0");
}
push @AoA, [ @array ];
@A0A is my array of array.