diff precursors.pl @ 43:4c0b1a94b882 draft

Uploaded
author big-tiandm
date Tue, 28 Oct 2014 01:35:32 -0400
parents 1131b4008650
children ca05d68aca13
line wrap: on
line diff
--- 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);