Coarsening Nucleobase Count Assignment

From CSE231 Wiki
Revision as of 22:23, 11 February 2024 by D.Linus (talk | contribs) (→‎count)
Jump to navigation Jump to search

Building On Previous Exercises

Be sure to complete the Half & Half and Ranges exercises first.

Code To Implement

Attention niels epting.svg Warning: Invoke NucleobaseUtils.countRange where appropriate.

CoarseningNucleobaseCounter

class: CoarseningNucleobaseCounter.java Java.png
methods: constructor
numRanges
count
package: count.exercise
source folder: student/src/main/java

constructor

method: public CoarseningNucleobaseCounter(int numRanges) Sequential.svg (sequential implementation only)

To support the required count method below, we will need to hang onto the number of ranges as an instance variable.

numRanges

method: public int numRanges() Sequential.svg (sequential implementation only)

Getter method for numRanges.

count

method: public int count(byte[] chromosome, Nucleobase targetNucleobase) Parallel.svg (parallel implementation required)

To coarsen our parallel counting of an array of nucleobases, we must use our previously created Ranges slice method and count each Range in parallel. Remember to use the numRanges variable you stored from the constructor.

In the computation graph below, we depict a chromosome of length 42 sliced into 4 Ranges:

CoarseningNucleobaseCounter Computation Graph.svg

There are many incantations of the join_fork_loop to choose from. Be sure to select the correct one. If you are failing the CoarsenParallelismRightToolTest, you've picked a suboptimal join_fork_loop (though your solution may produce the correct result, the tests enforce the better style).

Check out this page for details on choosing the correct parallel loop.


Choose the one which iterates over your array of Ranges.

Correctness

class: _CoarseningNucleobaseCounterTestSuite.java Junit.png
package: count.exercise
source folder: testing/src/test/java

Pledge, Acknowledgments, Citations

file: nucleobase-count-coarsen-pledge-acknowledgments-citations.txt

More info about the Honor Pledge