Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to determine bitwise binary scores for a list of number in perl?
    primarykey
    data
    text
    <p>I am trying to inter-convert some decimal and binary numbers. I am working with data produced in the following format:</p> <pre><code>Example decimal: 163, Corresponding binary: 10100011 Binary table key: </code></pre> <p><img src="https://i.stack.imgur.com/LDIhF.png" alt="enter image description here"></p> <pre><code>...and the corresponding description for the binary number in question: </code></pre> <p><img src="https://i.stack.imgur.com/nhbCe.png" alt="enter image description here"></p> <p>I want to be able to take a decimal number, convert it to binary, and then use this look-up table to print a list of attributes for a given decimal. I'm able to convert my decimal to binary using this code:</p> <pre><code>sub dec2bin { my $str = unpack("B32", pack("N", shift)); $str =~ s/^0+(?=\d)//; # otherwise you'll get leading zeros return $str; } </code></pre> <p>But then don't see how to use the lookup table. The problem is, I have binary numbers specifically designed to be compatible for this table, such as 1000011, 10000011, 101110011, but I just don't see how to use these binaries to pull our their descriptions. They are even different lengths!</p> <p>Can someone please help me understand what is going on here?</p> <p>EDIT: here is another look-up table I found... perhaps this is more accurate/helpful? It looks identical to me, but is from the software's offiical <a href="http://samtools.sourceforge.net/samtools.shtml#5" rel="nofollow noreferrer">website</a>. </p> <p><img src="https://i.stack.imgur.com/XG7nv.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload