I like your time estimates. I will definitely try your program.

Then you'll like this estimate even better:

P:\test>484593-5 bioman.dat 000:001 L[072] (1557,1557)'CCTTCTCATCTGCCGGACCGTGTGCACTTCGCTTCACCTCTGCACGTCG +CATGGAGACC 000:002 L[1271] (0082,0082)'CAGAACCCTGCTCCGACTATTGCCTCTCTCACATCATCAATCTTCTTGA +AGACTGGGGG 000:003 L[225] (1128,1128)'CAATACATGAACCTTTACCCCGTTGCTCGGCAACGGCCAGGCCTGTGCC +AAGTGTTTGC 000:004 L[191] (0619,0619)'TGGGCTTTAGGAAAATACCTATGGGAGTGGGCCTCAGCCCGTTTCTCCT +GGCTCAGTTT 000:005 L[269] (0292,0292)'GGGTGTCCTGGCCAAAATTCGCAGTCCCCAACCTCCAATCACTTACCAA +CCTCCTGTCC 001:002 L[072] (1557,1557)'CCTTCTCATCTGCCGGACCGTGTGCACTTCGCTTCACCTCTGCACGTCG +CATGGAGACC 001:003 L[072] (1557,1557)'CCTTCTCATCTGCCGGACCGTGTGCACTTCGCTTCACCTCTGCACGTCG +CATGGAGACC 001:004 L[080] (1764,1764)'TCTTTGTACTAGGAGGCTGTAGGCATAAATTGGTCTGTTCACCAGCACC +ATGCAACTTT 001:005 L[072] (1557,1557)'CCTTCTCATCTGCCGGACCGTGTGCACTTCGCTTCACCTCTGCACGTCG +CATGGAGACC 002:003 L[320] (1128,1128)'CAATACATGAACCTTTACCCCGTTGCTCGGCAACGGCCAGGCCTGTGCC +AAGTGTTTGC 002:004 L[191] (0619,0619)'TGGGCTTTAGGAAAATACCTATGGGAGTGGGCCTCAGCCCGTTTCTCCT +GGCTCAGTTT 002:005 L[269] (0292,0292)'GGGTGTCCTGGCCAAAATTCGCAGTCCCCAACCTCCAATCACTTACCAA +CCTCCTGTCC 003:004 L[161] (1128,1128)'CAATACATGAACCTTTACCCCGTTGCTCGGCAACGGCCAGGCCTGTGCC +AAGTGTTTGC 003:005 L[510] (2693,2693)'AAACCCTATTATCCTGATAACGTGGTTAATCATTATTTTAAGACCAGAC +ACTATTTGCA 004:005 L[148] (1138,1138)'ACCTTTACCCCGTTGCTCGGCAACGGCCAGGCCTGTGCCAAGTGTTTGC +TGACGCAACC 15 trials of bioman.dat ( 1.948s total), 129.853ms/trial

That projects to a total time for your 300x3k of 1hr 37 minutes.

This is a Inline C (or could be XS) implementation and is the full monty with no restrictions on position or ordering, and will report multiple equal-length matches for all pairings. It is linear in both time (O(n*m)) and space (O(n+1) upto the capacity of your machine). It also supports a "minimum match" parameter though it makes little difference on performance.

It is much faster (2-orders of maginitude (or more)) than anything else I have been able to compare it against.

I would like to compare it against Bio::Tools::dpAlign, but I cannot even work out where to obtain this package. I (re-) installed the lastest Bioperl package, but it was not installed with that, and the install link takes you to the entire BioPerl distribution, but I cannot find either a Bio::Tools::dpAlign, or Bio::Tools package to download. If you succeeded in installing and using B::T::dpAlign, I'd realy like to see your results and timings?

I'm currently working out the best way to package what I have--with Inline::C as a dependancy or using the .xs it produces--as I think this would be useful even if dpAlign is faster. For anyone wanting a Least Common SubString function for simple/non-bioperl use, installing the whole bioperl behemoth is just overkill. I'm also thinking of sticking the Least Common SubSequences algo in there if my optimisation prove to be equally effective on it as on the SubStrings algo.

If you have/are comfortable installing Inline C and want to try this out, left me know and I'll send you the unpackaged version. You can be my guinea pig:)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

In reply to Re^7: Search for identical substrings by BrowserUk
in thread Search for identical substrings by bioMan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.