# HG changeset patch # User big-tiandm # Date 1414474532 14400 # Node ID 4c0b1a94b88224abf871f80cfd11bac4b8bec889 # Parent 3b9a6381e6bf88fa5881b5f83771dbe2f1f2d90b Uploaded diff -r 3b9a6381e6bf -r 4c0b1a94b882 precursors.pl --- a/precursors.pl Tue Oct 28 01:35:17 2014 -0400 +++ b/precursors.pl Tue Oct 28 01:35:32 2014 -0400 @@ -482,6 +482,7 @@ # print "$larm_beg,$larm_end $larm\n"; # define the precursor by hybriding short arm to long arm +=cut #modify in 2014-10-28 my $duplex=RNA::duplexfold($sarm,$larm); my $struct=$duplex->{structure}; my $energy=sprintf "%.2f", $duplex->{energy}; @@ -492,6 +493,20 @@ my $end1=$duplex->{i}; my $beg2=$duplex->{j}; my $end2=$duplex->{j}+length($str2)-1; +=cut +###### new codes begin + my $duplex=`perl -e 'print "$sarm\n$larm"' | RNAduplex`; + #(.(.(((.....(((.&))))))...).). 1,16 : 1,13 (-7.20) + my @tmpduplex=split/\s+/,$duplex; + my $struct=$tmpduplex[0]; + $tmpduplex[-1]=~s/[(|)]//g; + my $energy=$tmpduplex[-1]; + my ($str1,$str2)=split(/&/,$struct); + my $pair=$str1=~tr/(//; + my ($beg1,$end1)=split/,/,$tmpduplex[1]; + my ($beg2,$end2)=split/,/,$tmpduplex[3]; +######## new codes end + # print "$beg1:$end1 $beg2:$end2\n"; # transform coordinates $beg1=$beg1+$sarm_beg-1; @@ -524,6 +539,7 @@ my $length1=length $seq1; my $length2=length $seq2; +=cut my $duplex=RNA::duplexfold($seq1, $seq2); my $duplex_struct=$duplex->{structure}; my $duplex_energy=sprintf "%.2f", $duplex->{energy}; @@ -532,7 +548,18 @@ my $end1=$duplex->{i}; my $beg2=$duplex->{j}; my $end2=$duplex->{j}+length($str2)-1; - +=cut + my $duplex=`perl -e 'print "$seq1\n$seq2"' | RNAduplex`; + #(.(.(((.....(((.&))))))...).). 1,16 : 1,13 (-7.20) + my @tmpduplex=split/\s+/,$duplex; + my $duplex_struct=$tmpduplex[0]; + $tmpduplex[-1]=~s/[(|)]//g; + my $duplex_energy=$tmpduplex[-1]; + my ($str1,$str2)=split(/&/,$duplex_struct); + #my $pair=$str1=~tr/(//; + my ($beg1,$end1)=split/,/,$tmpduplex[1]; + my ($beg2,$end2)=split/,/,$tmpduplex[3]; + # revise beg1, end1, beg2, end2 $str1=~/^(\.*)/; $beg1+=length($1);