src/ReplicatingMolecule2.java
/**
     * Given a list of double values in  bins the method updates the list adding the fraction of nucleotides
     * in each bin covered by a DNA sement from segmentStart to segmentEnd
     * nucleotides in sequence are indexed [0, sequenceLength -1]
     * first bin is interval in the sequence [0, binSize -1]
     * @param segmentStart index of starting nucleotide in segment
     * @param segmentEnd  index of ending nucleotide in segment
     * @param binSize size of bin in nucleotides
     * @param binList the list of doubles, one for each bin
     */
Given a list of double values in  bins the method updates the list adding the fraction of nucleotides
in each bin covered by a DNA sement from segmentStart to segmentEnd
nucleotides in sequence are indexed [0, sequenceLength -1]
first bin is interval in the sequence [0, binSize -1]
@param segmentStart index of starting nucleotide in segment
@param segmentEnd  index of ending nucleotide in segment
@param binSize size of bin in nucleotides
@param binList the list of doubles, one for each bin
Given a list of double values in bins the method updates the list adding the fraction of nucleotides in each bin covered by a DNA sement from segmentStart to segmentEnd nucleotides in sequence are indexed [ 0 sequenceLength - 1 ] first bin is interval in the sequence [ 0 binSize - 1 ] @param segmentStart index of starting nucleotide in segment @param segmentEnd index of ending nucleotide in segment @param binSize size of bin in nucleotides @param binList the list of doubles one for each bin
static void nucleotideSegmentToBins (int segmentStart, int segmentEnd, int binSize, List<Double> binList) {
        int binStart = segmentStart / binSize;
        int binEnd = segmentEnd / binSize;
        if (binStart == binEnd) {binList.set(binStart, binList.get(binStart) + (double)(segmentEnd - segmentStart + 1) / binSize);}
        else {
            binList.set(binStart, binList.get(binStart) + (double)((binStart + 1) * binSize - segmentStart) / binSize);
            for (int i = binStart + 1; i < binEnd; i++) {
                binList.set(i, 1.0);
            }
            binList.set(binEnd, binList.get(binEnd) + (double)(segmentEnd - binEnd * binSize + 1) / binSize);
        }
    }
static void nucleotideSegmentToBins ( int segmentStart , int segmentEnd , int binSize , List < Double > binList ) { int binStart = segmentStart / binSize ; int binEnd = segmentEnd / binSize ; if ( binStart == binEnd ) { binList . set ( binStart , binList . get ( binStart ) + ( double ) ( segmentEnd - segmentStart + 1 ) / binSize ) ; } else { binList . set ( binStart , binList . get ( binStart ) + ( double ) ( ( binStart + 1 ) * binSize - segmentStart ) / binSize ) ; for ( int i = binStart + 1 ; i < binEnd ; i ++ ) { binList . set ( i , 1.0 ) ; } binList . set ( binEnd , binList . get ( binEnd ) + ( double ) ( segmentEnd - binEnd * binSize + 1 ) / binSize ) ; } }
Given a list of double values in  bins the method updates the list adding the fraction of nucleotides
 in each bin covered by a DNA sement from segmentStart to segmentEnd
 nucleotides in sequence are indexed [0, sequenceLength -1]
 first bin is interval in the sequence [0, binSize -1]
 @param segmentStart index of starting nucleotide in segment
 @param segmentEnd  index of ending nucleotide in segment
 @param binSize size of bin in nucleotides
 @param binList the list of doubles, one for each bin
Given a list of double values in bins the method updates the list adding the fraction of nucleotides in each bin covered by a DNA sement from segmentStart to segmentEnd nucleotides in sequence are indexed [ 0 sequenceLength - 1 ] first bin is interval in the sequence [ 0 binSize - 1 ] @param segmentStart index of starting nucleotide in segment @param segmentEnd index of ending nucleotide in segment @param binSize size of bin in nucleotides @param binList the list of doubles one for each bin