MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Wavelet "filter"?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84965] Re: Wavelet "filter"?
  • From: "Steve Luttrell" <steve at _removemefirst_luttrell.org.uk>
  • Date: Mon, 21 Jan 2008 04:14:10 -0500 (EST)
  • References: <fmv1sh$314$1@smc.vnet.net>

"Bill Rowe" <readnewsciv at sbcglobal.net> wrote in message 
news:fmv1sh$314$1 at smc.vnet.net...
> On 1/19/08 at 6:06 AM, edsferr at uol.com.br (edsferr) wrote:
>
>>Replying the questions:
>
>>The 14 characters strings are all the possible strings with length
>>14, i.e. 2^14=16384 strings.
>
>>What I need is to select the ones which have higher probability to
>>occur according to the wavelet power spectrum. Is it possible? I'ts
>>like to see, if I'm not saying anything absurd, what are the most
>>probable 14 length DNA sequence given a 4096 length sample. What
>>happens in my case is that this sample is not randomically
>>generated.
>
> There really isn't much need to use wavelets to find the most
> frequent 14 character long strings in your data set.
>
> A simulated data set can be generated using:
>
> data = RandomInteger[{0,1},4096];
>
> All possible 14 character long strings in this longer set can be
> computed using
>
> Partition[data,14,1]
>
> Since your data set is simply 1's and 0's, it is convenient to
> encode them as a integer using FromDigits. So,
>
> h = Split[Sort[FromDigits[#, 2] & /@ Partition[data, 14, 1]]];
>
> will group all similar 14 character strings. And the most
> frequent 5 will be
>
> In[22]:= First /@ (h[[Ordering[h]]][[-5 ;;]])
>
> Out[22]= {15466,16141,1859,6230,11307}
>
> which can be converted back to 14 character strings if you like
> using IntegerDigits[n,2,14] where n is the encoded string value.
> --
> To reply via email subtract one hundred and four
>

And here is a way of doing that using Tally:

data=RandomInteger[{0,1},4096];
tally=Tally[Partition[data,14,1]];
sortedtally=Sort[tally,#2[[2]]<=#1[[2]]&];
Take[sortedtally,5]

{{{0,0,1,1,0,1,0,1,1,0,1,0,1,0},4},{{0,1,1,0,0,1,0,1,0,1,1,0,0,0},4},{{1,1,0,0,1,0,1,0,1,1,0,0,0,1},4},{{0,0,0,1,1,0,1,0,1,1,0,1,0,1},3},{{1,0,0,0,1,0,1,1,1,1,0,1,0,0},3}}

Stephen Luttrell
West Malvern, UK 



  • Prev by Date: Two bugs in Mathematica 6.01 ".m" packaging.
  • Next by Date: Re: Shuffle problem
  • Previous by thread: Re: Wavelet "filter"?
  • Next by thread: Re: Wavelet "filter"?