I'm looking for a simple method for calculating position specific weight matrices (PWM) from a position occurrence matrix ... like what's found in the jaspar database:
>MA0004.1 Arnt A [ 4 19 0 0 0 0 ] C [16 0 20 0 0 0 ] G [ 0 1 0 20 0 20 ] T [ 0 0 0 0 20 0 ]
I need to scan a large collection of sequences and submitting them to online services would be a complete hassle.
Once I have a PWM I know how to scan sequences, but I'm just having trouble creating them.
PS. I'm looking for an equation (or psuedocode) for fining the PWM, not a library. I plan to implement it in python and matlab. I'd prefer not to make a wrapper for system-calls but to actually implement it in my code. Thanks