For thousands of fragments, your result set could get large. Since you are obtaining 4 results for each combination, the total number of results would come to 4 * the total number of combinations.
- 4 * C(1000,2) == 1,998,000
- 4 * C(5000,2) == 12,497,500
- 4 * C(10,000,2) == 199,980,000
- 4 * C(20,000,2) == 799,960,000
I guess you need to know how you want to use/analyze the results. Also if you would want to print the results to a file or store in an array or hash.
Update: When I ran a test here against a sample fasta file, I generated 124 fragments and stored the combinations in a hash. I had a total memory use of 12,848,152 bytes for the 30,504 combinations (about 421 bytes per combination). So I'd guess that if you had 1000 or more fragments, you would probably exceed your memory.
When I used an array instead of a hash, the memory used was slightly less, 10,888,016 bytes. (roughly 357 bytes per combination).
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.