OK, now we're talking.
Assuming you want a result which is first the AFFX-BioB-xxx_at-identifier, followed by all signal-data which are connected to this identifier, I suggest:
- you drop the get_targets sub and all references to
it.
- Then you change your sub get_signal to:
while (@filename) {
my $i;
$file=shift @filename;
use Cwd 'chdir';
chdir "./data";
open (FILE, "$file") or die;
while (<FILE>) {
next while $i++ <= 14;
(my $id, undef, undef, my $signal, undef, undef)=split(/\t
+/);
push @{$outputdata{$id}}, $signal;
}
close (FILE);
}
After having run this sub over all your files you will find in %outputdata a nicely ordered (per identifier) structure of your signal-data.
- "Printing this datastructure goes as follows:
for $id (keys %outputdata) {
print "$id:\t",(join("\t",@{$outputdata{$id}})),"\n";
}
Of course you can print it to a filehandle. This is a format which is suitable to be imported in a database or a spreadsheet.
The "magic" of using references to anonymous arrays may perhaps be a bit too deep for someone who is just starting to program, but if you read Chapters 8 and 9 of the Camel book a few times and study the examples given, much will become clearer.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.