On Thu, 29 Jun 2006, Apparao Anakapalli wrote:
> pattern = 'ATTTA'
>
> I want to find the pattern in the sequence and count.
>
> For instance in 'a' there are two 'ATTTA's.
use re.findall:
>>> import re
>>> pat = "ATTTA"
>>> rexp=re.compile(pat)
>>> a = "TCCCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGT
On Thu, Jun 29, 2006 at 01:06:54PM -0700, Matthew White wrote:
> Hello Appu,
>
> You can use the count() method to find the number of occurances of a
> substring within a string:
>
> >>> a = 'TCCCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGTCACATTTA'
> >>> a.count('ATTTA')
> 2
>
And, if you need to search
Hello Appu,
You can use the count() method to find the number of occurances of a
substring within a string:
>>> a = 'TCCCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGTCACATTTA'
>>> a.count('ATTTA')
2
-mtw
On Thu, Jun 29, 2006 at 12:45:06PM -0700, Apparao Anakapalli ([EMAIL
PROTECTED]) wrote:
> hello all:
hello all:
I have a question and I do not know how I can work it
out.
I have a file of sequences
>a
TCCCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGTCACATTTA'
>b
CCTGCGGCGCATGAGTGACTGGCGTATTTAGCCCGTCACAATTTAA'
(10 K)
pattern = 'ATTTA'
I want to find the pattern in the sequence and count.
For ins