devi has asked for the wisdom of the Perl Monks concerning the following question:
hello every one i have a program to identify a given motif in the dna seq and color that particular region alone. when i am trying it by using ansi color my entire seq is being colored what should i do to color only the motif part here is the code that i have used
#use strict; #use warnings; #Progarm to find motif site in a given protein sequence using files use Term::ANSIColor open(READ,"<dna.txt"); @e=<READ>; $a=join(" ",@e); $a=~s/\s+//gi; $s=0;@c; for($i=0;$i<length($a);$i++) { $d=substr($a,$i,6); if($d eq "AGGGGG") { print color 'bold green'; $s++; push(@c,$i+1); } } print $a ; print"NUMBER OF SITES THE MOTIF (AGGGGG) IS PRESENT: $s\n"; print"AND THE POSITION IN THE STRING IS:", print join(',',(@c,"\n")),"\n\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: motif finding
by quester (Vicar) on Jan 31, 2012 at 07:12 UTC | |
Re: motif finding
by Khen1950fx (Canon) on Jan 31, 2012 at 07:09 UTC | |
Re: motif finding
by quester (Vicar) on Jan 31, 2012 at 07:58 UTC | |
by educated_foo (Vicar) on Jan 31, 2012 at 13:55 UTC | |
by Anonymous Monk on Oct 05, 2013 at 21:07 UTC | |
by RichardK (Parson) on Jan 31, 2012 at 14:19 UTC | |
by devi (Initiate) on Feb 03, 2012 at 06:08 UTC | |
by RichardK (Parson) on Feb 03, 2012 at 12:47 UTC |
Back to
Seekers of Perl Wisdom