Package kmer.balance.exercise
Class DefaultKMerBalancer
java.lang.Object
kmer.balance.exercise.DefaultKMerBalancer
- All Implemented Interfaces:
KMerBalancer
- Author:
- __STUDENT_NAME__, Dennis Cosgrove
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
calculateReasonableThreshold
(List<byte[]> sequences, int k) Calculate a reasonable threshold to be used withcreateSlices(List, int, IntPredicate)
where reasonable is defined to mean will create between 2X and 10X tasks per available processor.createSlices
(List<byte[]> sequences, int k, IntPredicate slicePredicate) Should create a list of slices from the given list of sequences.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface kmer.balance.core.KMerBalancer
createReasonableSlices
-
Constructor Details
-
DefaultKMerBalancer
public DefaultKMerBalancer()
-
-
Method Details
-
createSlices
public List<ByteArrayRange> createSlices(List<byte[]> sequences, int k, IntPredicate slicePredicate) Should create a list of slices from the given list of sequences. Each sequence may be divided many times or not divided at all, depending on its size relative to the sliceThreshold. Any sequence whose length is less than k should be omitted.- Specified by:
createSlices
in interfaceKMerBalancer
- Parameters:
sequences
- a list of sequences of nucleobasesk
- the k in k-merslicePredicate
- predicate which if returns true when tested with the range length from min to max indicates that continued slicing is appropriate- Returns:
- the list of slices
-
calculateReasonableThreshold
Calculate a reasonable threshold to be used withcreateSlices(List, int, IntPredicate)
where reasonable is defined to mean will create between 2X and 10X tasks per available processor.- Specified by:
calculateReasonableThreshold
in interfaceKMerBalancer
- Parameters:
sequences
- a list of nucleobase sequencesk
- the k in k-mer- Returns:
- a reasonable threshold
- See Also:
-