bioDS / beast-phylonco

A BEAST2 package for single-cell cancer evolution
GNU Lesser General Public License v2.1
6 stars 2 forks source link

Create API class to define the mapping between PhasedGenotypeState and NucleotideState #48

Open walterxie opened 4 months ago

walterxie commented 4 months ago

Encapsulate the mapping between PhasedGenotypeState and NucleotideState, and using the API method to replace the follow code in loops, such as int[] getNucIndex(int phasedGTInd) and PhasedGenotypeState getPhasedGenotypeState(NucleotideState parent1st, NucleotideState parent2nd)

for (int i = 0; i < numStates; i++) {

            int fromParent1State = i / 4;
            int fromParent2State = i % 4;
            for (int j = i + 1; j < numStates; j++) {
                int toParent1State = j / 4;
                int toParent2State = j % 4;

...