Mercurial > repos > big-tiandm > mirplant2
comparison precursors.pl @ 46:ca05d68aca13 draft
Uploaded
author | big-tiandm |
---|---|
date | Thu, 13 Nov 2014 22:43:35 -0500 |
parents | 4c0b1a94b882 |
children |
comparison
equal
deleted
inserted
replaced
45:2cb6add23dfe | 46:ca05d68aca13 |
---|---|
7 #Description: | 7 #Description: |
8 my $version=1.00; | 8 my $version=1.00; |
9 | 9 |
10 use strict; | 10 use strict; |
11 use Getopt::Long; | 11 use Getopt::Long; |
12 use RNA; | 12 #use RNA; |
13 | 13 |
14 my %opts; | 14 my %opts; |
15 GetOptions(\%opts,"map=s","g=s","d:i","f:i","o=s","e:f","s=s","h"); | 15 GetOptions(\%opts,"map=s","g=s","d:i","f:i","o=s","e:f","s=s","h"); |
16 if (!(defined $opts{map} and defined $opts{g} and defined $opts{o} and defined $opts{s} ) || defined $opts{h}) { #necessary arguments | 16 if (!(defined $opts{map} and defined $opts{g} and defined $opts{o} and defined $opts{s} ) || defined $opts{h}) { #necessary arguments |
17 &usage; | 17 &usage; |
18 } | 18 } |
19 | 19 |
20 my $checkno=1; | |
20 my $filein=$opts{'map'}; | 21 my $filein=$opts{'map'}; |
21 my $faout=$opts{'o'}; | 22 my $faout=$opts{'o'}; |
22 my $strout=$opts{'s'}; | 23 my $strout=$opts{'s'}; |
23 my $genome= $opts{'g'}; | 24 my $genome= $opts{'g'}; |
24 | 25 |
235 } | 236 } |
236 $tag1_end=$tag1_beg+length($tag1)-1; | 237 $tag1_end=$tag1_beg+length($tag1)-1; |
237 $tag2_end=$tag2_beg+length($tag2)-1; | 238 $tag2_end=$tag2_beg+length($tag2)-1; |
238 | 239 |
239 # fold | 240 # fold |
240 my ($struct,$mfe)=RNA::fold($seq); | 241 #my ($struct,$mfe)=RNA::fold($seq); |
241 $mfe=sprintf "%.2f", $mfe; | 242 my $rnafold=`perl -e 'print "$seq"' | RNAfold --noPS`; |
243 my @rawfolds=split/\s+/,$rnafold; | |
244 my $struct=$rawfolds[1]; | |
245 my $mfe=$rawfolds[-1]; | |
246 $mfe=~s/\(//; | |
247 $mfe=~s/\)//; | |
248 #$mfe=sprintf "%.2f", $mfe; | |
242 if ($mfe > $MAX_ENERGY) {return 0;} | 249 if ($mfe > $MAX_ENERGY) {return 0;} |
243 | 250 |
244 # tag1 | 251 # tag1 |
245 my $tag1_length=$tag1_end-$tag1_beg+1; | 252 my $tag1_length=$tag1_end-$tag1_beg+1; |
246 my $tag1_struct=substr($struct,$tag1_beg-1,$tag1_length); | 253 my $tag1_struct=substr($struct,$tag1_beg-1,$tag1_length); |
329 $seq=substr($seq,$beg-1,$end-$beg+1); | 336 $seq=substr($seq,$beg-1,$end-$beg+1); |
330 $seq_length=length $seq; | 337 $seq_length=length $seq; |
331 | 338 |
332 | 339 |
333 # fold | 340 # fold |
334 my ($struct,$mfe)=RNA::fold($seq); | 341 #my ($struct,$mfe)=RNA::fold($seq); |
335 $mfe=sprintf "%.2f",$mfe; | 342 my $rnafold=`perl -e 'print "$seq"' | RNAfold --noPS`; |
343 my @rawfolds=split/\s+/,$rnafold; | |
344 my $struct=$rawfolds[1]; | |
345 my $mfe=$rawfolds[-1]; | |
346 $mfe=~s/\(//; | |
347 $mfe=~s/\)//; | |
348 | |
336 if ($mfe > $MAX_ENERGY) { | 349 if ($mfe > $MAX_ENERGY) { |
337 $pass=0; | 350 $pass=0; |
338 return $pass; | 351 return $pass; |
339 } | 352 } |
340 | 353 |