8 our ($opt_r, $opt_o); # -r: fix r headers -o: outfile
14 open(my $OUT, ">", $opt_o) || die "Can't open outfile $opt_o";
16 foreach my $f (@files) {
17 print STDERR
"Opening file $f... ";
18 my $gtio = CXGN
::GenotypeIO
->new( { file
=> $f, format
=>"dosage_transposed", fix_r_headers
=> $opt_r });
21 print STDERR
"Done.\n";
27 foreach my $io (@io) {
28 print STDERR
"processing file ".$io->plugin->file().".\n";
29 while (my $gt= $io->next()) {
30 my $name = $gt->name();
31 my $markers = $gt->markers();
32 foreach my $m (@
$markers) {
35 my $scores = $gt->rawscores();
36 #print STDERR Dumper($scores);
37 foreach my $k (keys %$scores) {
38 #print "Adding score $scores->{$k} for marker $k to accession $name...\n";
39 $all_accs{$name}->{$k} = $scores->{$k};
45 foreach my $m (sort keys %all_markers) {
51 foreach my $name (sort keys %all_accs) {
53 foreach my $m (sort keys %all_markers) {
54 print $OUT "\t".$all_accs{$name}->{$m};
60 print STDERR
"Done.\n";