comparison precursors.pl @ 43:4c0b1a94b882 draft

Uploaded
author big-tiandm
date Tue, 28 Oct 2014 01:35:32 -0400
parents 1131b4008650
children ca05d68aca13
comparison
equal deleted inserted replaced
42:3b9a6381e6bf 43:4c0b1a94b882
480 } 480 }
481 # print "$sarm_beg,$sarm_end $sarm\n"; 481 # print "$sarm_beg,$sarm_end $sarm\n";
482 # print "$larm_beg,$larm_end $larm\n"; 482 # print "$larm_beg,$larm_end $larm\n";
483 483
484 # define the precursor by hybriding short arm to long arm 484 # define the precursor by hybriding short arm to long arm
485 =cut #modify in 2014-10-28
485 my $duplex=RNA::duplexfold($sarm,$larm); 486 my $duplex=RNA::duplexfold($sarm,$larm);
486 my $struct=$duplex->{structure}; 487 my $struct=$duplex->{structure};
487 my $energy=sprintf "%.2f", $duplex->{energy}; 488 my $energy=sprintf "%.2f", $duplex->{energy};
488 my ($str1,$str2)=split(/&/,$struct); 489 my ($str1,$str2)=split(/&/,$struct);
489 my $pair=$str1=~tr/(//; 490 my $pair=$str1=~tr/(//;
490 # print "pair=$pair\n"; 491 # print "pair=$pair\n";
491 my $beg1=$duplex->{i}+1-length($str1); 492 my $beg1=$duplex->{i}+1-length($str1);
492 my $end1=$duplex->{i}; 493 my $end1=$duplex->{i};
493 my $beg2=$duplex->{j}; 494 my $beg2=$duplex->{j};
494 my $end2=$duplex->{j}+length($str2)-1; 495 my $end2=$duplex->{j}+length($str2)-1;
496 =cut
497 ###### new codes begin
498 my $duplex=`perl -e 'print "$sarm\n$larm"' | RNAduplex`;
499 #(.(.(((.....(((.&))))))...).). 1,16 : 1,13 (-7.20)
500 my @tmpduplex=split/\s+/,$duplex;
501 my $struct=$tmpduplex[0];
502 $tmpduplex[-1]=~s/[(|)]//g;
503 my $energy=$tmpduplex[-1];
504 my ($str1,$str2)=split(/&/,$struct);
505 my $pair=$str1=~tr/(//;
506 my ($beg1,$end1)=split/,/,$tmpduplex[1];
507 my ($beg2,$end2)=split/,/,$tmpduplex[3];
508 ######## new codes end
509
495 # print "$beg1:$end1 $beg2:$end2\n"; 510 # print "$beg1:$end1 $beg2:$end2\n";
496 # transform coordinates 511 # transform coordinates
497 $beg1=$beg1+$sarm_beg-1; 512 $beg1=$beg1+$sarm_beg-1;
498 $end1=$end1+$sarm_beg-1; 513 $end1=$end1+$sarm_beg-1;
499 $beg2=$beg2+$larm_beg-1; 514 $beg2=$beg2+$larm_beg-1;
522 my $seq2=shift; 537 my $seq2=shift;
523 my $like_mir_duplex=1; 538 my $like_mir_duplex=1;
524 539
525 my $length1=length $seq1; 540 my $length1=length $seq1;
526 my $length2=length $seq2; 541 my $length2=length $seq2;
542 =cut
527 my $duplex=RNA::duplexfold($seq1, $seq2); 543 my $duplex=RNA::duplexfold($seq1, $seq2);
528 my $duplex_struct=$duplex->{structure}; 544 my $duplex_struct=$duplex->{structure};
529 my $duplex_energy=sprintf "%.2f", $duplex->{energy}; 545 my $duplex_energy=sprintf "%.2f", $duplex->{energy};
530 my ($str1,$str2)=split(/&/,$duplex_struct); 546 my ($str1,$str2)=split(/&/,$duplex_struct);
531 my $beg1=$duplex->{i}+1-length($str1); 547 my $beg1=$duplex->{i}+1-length($str1);
532 my $end1=$duplex->{i}; 548 my $end1=$duplex->{i};
533 my $beg2=$duplex->{j}; 549 my $beg2=$duplex->{j};
534 my $end2=$duplex->{j}+length($str2)-1; 550 my $end2=$duplex->{j}+length($str2)-1;
535 551 =cut
552 my $duplex=`perl -e 'print "$seq1\n$seq2"' | RNAduplex`;
553 #(.(.(((.....(((.&))))))...).). 1,16 : 1,13 (-7.20)
554 my @tmpduplex=split/\s+/,$duplex;
555 my $duplex_struct=$tmpduplex[0];
556 $tmpduplex[-1]=~s/[(|)]//g;
557 my $duplex_energy=$tmpduplex[-1];
558 my ($str1,$str2)=split(/&/,$duplex_struct);
559 #my $pair=$str1=~tr/(//;
560 my ($beg1,$end1)=split/,/,$tmpduplex[1];
561 my ($beg2,$end2)=split/,/,$tmpduplex[3];
562
536 # revise beg1, end1, beg2, end2 563 # revise beg1, end1, beg2, end2
537 $str1=~/^(\.*)/; 564 $str1=~/^(\.*)/;
538 $beg1+=length($1); 565 $beg1+=length($1);
539 $str1=~/(\.*)$/; 566 $str1=~/(\.*)$/;
540 $end1-=length($1); 567 $end1-=length($1);