Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: motif finding

by Khen1950fx (Canon)
on Jan 31, 2012 at 07:09 UTC ( #950895=note: print w/replies, xml ) Need Help??


in reply to motif finding

Try this:
#!/usr/bin/perl use strict; use warnings; use Term::ANSIColor::Print open READ, '<', '/root/Desktop/rna.dna'; my (@e) = <READ>; my $a = join( " ", @e ); $a =~ s/\s+//gi; my $s = 0; my @c; my $i; for ( $i = 0; $i < length($a); ++$i ) { my $d = substr( $a, $i, 6 ); unless ( $d eq "AGGGGG" ) { my $print = Term::ANSIColor::Print->new(); $print->bold_green($d); ++$s; push( @c, $i + 1 ); } } print $a; print "NUMBER OF SITES THE MOTIF (AGGGGG) IS PRESENT: $s"; print "AND THE POSITION IN THE STRING IS: \n", print join( ',', ( @c, "\n" ) ), "\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://950895]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-08-16 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?