v15 has asked for the wisdom of the Perl Monks concerning the following question:
I want to transform it into a table like thisgeneA T1 geneA T1 geneA T2 geneB T8 geneC T10 geneC T1
So in this case T1 and T2 are present for gene A so we put a + sign but T8 and T10 are absent so we put a - sign. Similarly for others. How can I do this. I tried something like this BUT i am stuck what to do nextNAMES T1 T2 T8 T10 geneA + + - - geneB - - + - geneC + - - +
Any help would be appreciated. Thanks#!/usr/bin/perl-w use strict; use warnings; use List::MoreUtils qw(uniq); my %gene2TF2val = (); my @TF = (); while(<>){ chomp; my @s = split /\s+/,$_; push @TF , $s[1]; # pushing every TF into array @TF but this is st +ill not unique list of transcription factors. $gene2TF2val{$s[1]}->{$s[0]} = "-"; } @TF = uniq @TF;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: transforming a table
by Athanasius (Archbishop) on Apr 04, 2016 at 06:32 UTC | |
|
Re: transforming a table
by kennethk (Abbot) on Apr 04, 2016 at 13:42 UTC | |
|
Re: transforming a table
by woland99 (Beadle) on Apr 04, 2016 at 17:42 UTC |