4 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
existing nodeRelation1: GO:001 - red1
existing nodeRelation1: GO:002 - red2
existing nodeRelation1: GO:003 - red3
nodeRelation1: GO:001 1 red1
nodeRelation1: GO:002 1 red2
nodeRelation1: GO:003 1 red3
nodeRelation1: GO:004 0
1
2
3
4
5
6
7
existing nodeRelation2: GO:001 - blue1
existing nodeRelation2: GO:004 - blue2
nodeRelation2: GO:001 2 red1 blue1
nodeRelation2: GO:002 1 red2
nodeRelation2: GO:003 1 red3
nodeRelation2: GO:004 1 blue2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
#/usr/bin/perl -w use strict; use warnings; print `clear`; my %nodes = ( 'GO:001' => [0], 'GO:002' => [0], 'GO:003' => [0], 'GO:004' => [0] ); my @valuesNode1 = ( ['red1','GO:001'], ['red2','GO:002'], ['red3','GO:003'] ); my @valuesNode2 = ( ['blue1','GO:001'], ['blue2','GO:004'] ); my %nodeRelation1 = %nodes; foreach my $ref (@valuesNode1) { my $value = $ref->[0]; my $id = $ref->[1]; if (exists $nodeRelation1{$id}) { print "existing nodeRelation1: $id - $value\n"; # first element = scoring schmea, will be increased by 1 ${$nodeRelation1{$id}}[0]++; # gene will be added to array push (@{$nodeRelation1{$id}}, $value); } } print "\n"; foreach my $key (sort keys %nodeRelation1) { my @tmp = @{$nodeRelation1{$key}}; print "nodeRelation1: $key\t@tmp\n"; } print "\n"; my %nodeRelation2 = %nodes; foreach my $ref (@valuesNode2) { my $value = $ref->[0]; my $id = $ref->[1]; if (exists $nodeRelation2{$id}) { print "existing nodeRelation2: $id - $value\n"; # first element = scoring schmea, will be increased by 1 ${$nodeRelation2{$id}}[0]++; # gene will be added to array push (@{$nodeRelation2{$id}}, $value); } } print "\n"; foreach my $key (sort keys %nodeRelation2) { my @tmp = @{$nodeRelation2{$key}}; print "nodeRelation2: $key\t@tmp\n"; } print "\n";
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#/usr/bin/perl -w use strict; use warnings; use Data::Dumper; #print `clear`; my %nodes = ( 'GO:001' => [0], 'GO:002' => [0], 'GO:003' => [0], 'GO:004' => [0] ); my @valuesNode1 = ( ['red1','GO:001'], ['red2','GO:002'], ['red3','GO:003'] ); my @valuesNode2 = ( ['blue1','GO:001'], ['blue2','GO:004'] ); my %nodeRelation1 = %nodes; foreach my $ref (@valuesNode1) { my $value = $ref->[0]; my $id = $ref->[1]; if (exists $nodeRelation1{$id}) { ${$nodeRelation1{$id}}[0]++; push (@{$nodeRelation1{$id}}, $value); } } print "\n"; foreach my $key (sort keys %nodeRelation1) { print "nodeRelation1: $key\t",$nodeRelation1{$key},"\n";#@tmp\n"; } print "\n"; my %nodeRelation2 = %nodes; foreach my $ref (@valuesNode2) { my $value = $ref->[0]; my $id = $ref->[1]; if (exists $nodeRelation2{$id}) { ${$nodeRelation2{$id}}[0]++; push (@{$nodeRelation2{$id}}, $value); } } print "\n"; foreach my $key (sort keys %nodeRelation2) { print "nodeRelation2: $key\t",$nodeRelation2{$key},"\n";#@tmp\n"; } print "\n";
1
2
3
4
5
6
7
8
9
10
nodeRelation1: GO:001 ARRAY(0x234f18)
nodeRelation1: GO:002 ARRAY(0x234ffc)
nodeRelation1: GO:003 ARRAY(0x234e34)
nodeRelation1: GO:004 ARRAY(0x18bb230)
nodeRelation2: GO:001 ARRAY(0x234f18)
nodeRelation2: GO:002 ARRAY(0x234ffc)
nodeRelation2: GO:003 ARRAY(0x234e34)
nodeRelation2: GO:004 ARRAY(0x18bb230)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
#/usr/bin/perl -w use strict; use warnings; use Data::Dumper; #print `clear`; my @valuesNode1 = ( ['red1','GO:001'], ['red2','GO:002'], ['red3','GO:003'] ); my @valuesNode2 = ( ['blue1','GO:001'], ['blue2','GO:004'] ); my %nodeRelation1 = _get_base(); foreach my $ref (@valuesNode1) { my $value = $ref->[0]; my $id = $ref->[1]; if (exists $nodeRelation1{$id}) { ${$nodeRelation1{$id}}[0]++; push (@{$nodeRelation1{$id}}, $value); } } print "\n"; foreach my $key (sort keys %nodeRelation1) { print "nodeRelation1: $key\t",$nodeRelation1{$key},"\n";#@tmp\n"; } print "\n"; my %nodeRelation2 = _get_base(); foreach my $ref (@valuesNode2) { my $value = $ref->[0]; my $id = $ref->[1]; if (exists $nodeRelation2{$id}) { ${$nodeRelation2{$id}}[0]++; push (@{$nodeRelation2{$id}}, $value); } } print "\n"; foreach my $key (sort keys %nodeRelation2) { print "nodeRelation2: $key\t",$nodeRelation2{$key},"\n";#@tmp\n"; } print "\n"; sub _get_base{ my %nodes = ( 'GO:001' => [0], 'GO:002' => [0], 'GO:003' => [0], 'GO:004' => [0] ); return %nodes; }
4 Einträge, 1 Seite |