tar : ERGC [1] | ALX5 [2] | PT2 [3] | PRTD [4] act: Ago [1] : Inhibit [2,3,4]
####
insert into Table1 values(sq_tab1.nextval,'ERGC','AGO');
insert into table1 values(sq_tab1.nextval,'ALX5','inhibit');
insert into table1 values(sq_tab1.nextval,'PT2','inhibit');
insert into table1 values(sq_tab1.nextval,'PRTD','inhibit');
####
my @targets = split (/\|/,$mech_results->{'Targets'});
my @actions = split (/\|/,$mech_results->{'Mechanism of Action_type'} );
my $a = sprintf "targets: %s | actions: %s |", join( ":", @targets ), join ( ":", @actions );
warn $a;
my $iteration = each_array(@targets,@actions);
#my ($targets,$actions) = targetsSynced(\@targets,\@actions);
#warn scalar @targets. '|' . @actions;
if(scalar @targets eq scalar @actions){
}else{
while(my($targets,$actions) = $iteration->()){
next if ($targets|$actions) eq '';
# targets with more than one reference.
if($targets =~ /(\(?\w+\))?(?:[ \/](.*))/){
my ($target, $tar_ref) = $targets =~ /\(?(\w+)\)?(?:[ \/]((.*)))/;
my ($tarref_no) = $tar_ref =~ /\[(\d)\]/;
my ($action,$act_ref) = $actions =~ /(.*)?\s\[(.*)\]/;
my @act = split(/,/,$act_ref);
foreach my $af(@act){
#warn "$af,$tarref_no $target, $action";
}
}
}
####
1,1 ERGC, Ago
2,2 ALX5, Inhibit
3,2 ALX5, Inhibit
4,2 ALX5, Inhibit
####
1,1 ERGC, Ago
2,2 ALX5, Inhibit
3,3 PT2, Inhibit
4,4 PRTD, Inhibit