src/CombedMoleculeProperties.java
/**
     * Does the heavy lifting for initializing the properties of the molecule 
     */
Does the heavy lifting for initializing the properties of the molecule
Does the heavy lifting for initializing the properties of the molecule
private void SetProps() {
        double totalIODLength = 0;
        double totalGLength = 0;
        double totalNLength = 0;
        int numForks = 0;
        molIODArray =  new ArrayList<>();
        molGArray = new ArrayList<>();
        molNArray = new ArrayList<>();
        startPosition = molecule.startPosition();
        for (int i = 0; i < molSegArray.size(); i++) {   
            if (molSegArray.get(i).getSegmentType() == 'G' && i != 0 && i+3 < molSegArray.size()) {
                double IODlen = molSegArray.get(i).getSegLength()/2 + molSegArray.get(i+1).getSegLength() + molSegArray.get(i+2).getSegLength()/2;
                totalIODLength += IODlen;
                numberIODs++;
                molIODArray.add(new CombedMoleculeReplicatedSegment(i, IODlen, (molSegArray.get(i).getLeftBound()+ molSegArray.get(i).getRightBound())/2, molecule));
           }
           if (molSegArray.get(i).getSegmentType() == 'G' && i != 0 && i+1 < molSegArray.size())  {
                totalGLength += molSegArray.get(i).getSegLength();
                numberGs++;
               molGArray.add(new CombedMoleculeReplicatedSegment(i, molSegArray.get(i).getSegLength(), molSegArray.get(i).getLeftBound(), molecule));
           }
           if (molSegArray.get(i).getSegmentType() == 'N' && i != 0 && i+1 < molSegArray.size()) {
               totalNLength += molSegArray.get(i).getSegLength();
               numberNs++;
               molNArray.add(new CombedMoleculeReplicatedSegment(i, molSegArray.get(i).getSegLength(), molSegArray.get(i).getLeftBound(), molecule));
           }
        }
        averageIODLength = totalIODLength/numberIODs;
        averageGLength = totalGLength/numberGs;
        averageNLength = totalNLength/numberNs;
        numberForks = 2 * numberGs;
        if (molSegArray.get(0).getSegmentType() == 'G') {numberForks++;}
        if (molSegArray.get(molSegArray.size()-1).getSegmentType() == 'G') {numberForks++;}
        plusNumberGs = numberForks - numberGs;
        plusNumberNs = numberNs + 2 -numberForks +2*numberGs;
        molLength = totalGLength + totalNLength + molSegArray.get(0).getSegLength() + molSegArray.get(molSegArray.size() - 1).getSegLength();
        fxReplicated = (totalGLength + (molSegArray.get(0).segmentType == 'G' ? molSegArray.get(0).getSegLength() : 0) +  
                (molSegArray.get(molSegArray.size() - 1).getSegmentType() == 'G' ? molSegArray.get(molSegArray.size() - 1).getSegLength() : 0))/molLength;
        firstType = molSegArray.get(0).getSegmentType();
        lastType = molSegArray.get(molSegArray.size() - 1).getSegmentType();
    }
private void SetProps ( ) { double totalIODLength = 0 ; double totalGLength = 0 ; double totalNLength = 0 ; int numForks = 0 ; molIODArray = new ArrayList < > ( ) ; molGArray = new ArrayList < > ( ) ; molNArray = new ArrayList < > ( ) ; startPosition = molecule . startPosition ( ) ; for ( int i = 0 ; i < molSegArray . size ( ) ; i ++ ) { if ( molSegArray . get ( i ) . getSegmentType ( ) == 'G' && i != 0 && i + 3 < molSegArray . size ( ) ) { double IODlen = molSegArray . get ( i ) . getSegLength ( ) / 2 + molSegArray . get ( i + 1 ) . getSegLength ( ) + molSegArray . get ( i + 2 ) . getSegLength ( ) / 2 ; totalIODLength += IODlen ; numberIODs ++ ; molIODArray . add ( new CombedMoleculeReplicatedSegment ( i , IODlen , ( molSegArray . get ( i ) . getLeftBound ( ) + molSegArray . get ( i ) . getRightBound ( ) ) / 2 , molecule ) ) ; } if ( molSegArray . get ( i ) . getSegmentType ( ) == 'G' && i != 0 && i + 1 < molSegArray . size ( ) ) { totalGLength += molSegArray . get ( i ) . getSegLength ( ) ; numberGs ++ ; molGArray . add ( new CombedMoleculeReplicatedSegment ( i , molSegArray . get ( i ) . getSegLength ( ) , molSegArray . get ( i ) . getLeftBound ( ) , molecule ) ) ; } if ( molSegArray . get ( i ) . getSegmentType ( ) == 'N' && i != 0 && i + 1 < molSegArray . size ( ) ) { totalNLength += molSegArray . get ( i ) . getSegLength ( ) ; numberNs ++ ; molNArray . add ( new CombedMoleculeReplicatedSegment ( i , molSegArray . get ( i ) . getSegLength ( ) , molSegArray . get ( i ) . getLeftBound ( ) , molecule ) ) ; } } averageIODLength = totalIODLength / numberIODs ; averageGLength = totalGLength / numberGs ; averageNLength = totalNLength / numberNs ; numberForks = 2 * numberGs ; if ( molSegArray . get ( 0 ) . getSegmentType ( ) == 'G' ) { numberForks ++ ; } if ( molSegArray . get ( molSegArray . size ( ) - 1 ) . getSegmentType ( ) == 'G' ) { numberForks ++ ; } plusNumberGs = numberForks - numberGs ; plusNumberNs = numberNs + 2 - numberForks + 2 * numberGs ; molLength = totalGLength + totalNLength + molSegArray . get ( 0 ) . getSegLength ( ) + molSegArray . get ( molSegArray . size ( ) - 1 ) . getSegLength ( ) ; fxReplicated = ( totalGLength + ( molSegArray . get ( 0 ) . segmentType == 'G' ? molSegArray . get ( 0 ) . getSegLength ( ) : 0 ) + ( molSegArray . get ( molSegArray . size ( ) - 1 ) . getSegmentType ( ) == 'G' ? molSegArray . get ( molSegArray . size ( ) - 1 ) . getSegLength ( ) : 0 ) ) / molLength ; firstType = molSegArray . get ( 0 ) . getSegmentType ( ) ; lastType = molSegArray . get ( molSegArray . size ( ) - 1 ) . getSegmentType ( ) ; }
Does the heavy lifting for initializing the properties of the molecule
Does the heavy lifting for initializing the properties of the molecule
// declaration of derivative length arrays NOTE these arrays do not contain terminal lengths //Fill derivative length arrays from molecular segment array; terminal lengths not included //this is not as efficient as it could be //Compute number of forks //compute total Gs and Ns including terminal ones //Compute total molecular length and Fx Replicated //Define terminal types