That's possible, but a bit confusing. In all biological databases, a circular genome of length 100 does have coordinate 100. It doesn't have coordinate zero. So, when I print a range that spans to the end of the genome, I must print it as x..100, not x..0, as this is the convention. So this representation might have some benefits, but it also brings the overhead of remembering switch back to 'biological' coordinates when you input/output back...

Also note not all genomes are circular. What would you do about those? If you put the first coordinate in the first position of the array (arr[0]), you will surely have to -1 anytime you output any coordinate. If you start from arr1 you do what I currently do, but now you treat circular genomes and linear genomes differently anytime you print or even calculate their length (if the genome is circular scalar(@arr) == genome size, but if it's linear scalar(@arr) == genome size + 1). Confusing...

Anyway, I must admit I'm not sure why are we focusing on this... that's really not the issue. Finally, note that in biology circles do have a start :) For each circular genome, a certain point was selected as '1'. This choice is actually not completely arbitrary - there are some rules for deciding where to call this landmark. Once a genome has been sequenced and published it has one and only '1' and any reference to this genome will be relative to this landmark. Just for general knowledge...


In reply to Re^4: Can I speed this up? (repetitively scanning ranges in a large array) by daverave
in thread Can I speed this up? (repetitively scanning ranges in a large array) by daverave

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.