Package edu.msu.cme.rdp.classifier

# Class Classifier

java.lang.Object
edu.msu.cme.rdp.classifier.Classifier

public class Classifier extends Object
This is the class to do the classification.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`MAX_SEQ_LEN`
`static final int`
`MIN_BOOTSTRSP_WORDS`
`static final int`
`MIN_GOOD_WORDS`
`static final int`
`MIN_SEQ_LEN`
The minimum number of bases per sequence.

## Method Summary

Modifier and Type
Method
Description
`void`
`addConfidence(HierarchyTree node, HashMap map)`
increase the count of the RankAssignment in the map if match that node or any ancestor of that node.
`ClassificationResult`
`classify(ClassifierSequence seq)`
`ClassificationResult`
`classify(ClassifierSequence seq, int min_bootstrap_words)`
Takes a query sequence, returns the classification result.
`ClassificationResult`
`classify(edu.msu.cme.rdp.readseq.readers.Sequence seq)`
Takes a query sequence, returns the classification result.
`String`
`getTrainRank()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### MIN_SEQ_LEN

public static final int MIN_SEQ_LEN
The minimum number of bases per sequence. Initially set to 200.

See Also:
  - Constant Field Values

### MAX_SEQ_LEN

public static final int MAX_SEQ_LEN

See Also:
  - Constant Field Values

### MIN_GOOD_WORDS

public static final int MIN_GOOD_WORDS

See Also:
  - Constant Field Values

### MIN_BOOTSTRSP_WORDS

public static final int MIN_BOOTSTRSP_WORDS

See Also:
  - Constant Field Values

## Method Details

### getTrainRank

public String getTrainRank()

### classify

public ClassificationResult classify(edu.msu.cme.rdp.readseq.readers.Sequence seq) throws IOException
Takes a query sequence, returns the classification result. For each query sequence, first assign it to a genus node using all the words for calculation. Then randomly chooses one-eighth of the all overlapping words in the query to calculate the joint probability. The number of times a genus was selected out of the number of bootstrap trials was used as an estimate of confidence in the assignment to that genus.

Throws:
  `ShortSequenceException` - if the sequence length is less than the minimum sequence length.
  `IOException`

### classify

public ClassificationResult classify(ClassifierSequence seq)

### classify

public ClassificationResult classify(ClassifierSequence seq, int min_bootstrap_words)
Takes a query sequence, returns the classification result. For each query sequence, first assign it to a genus node using all the words for calculation. Then randomly chooses one-eighth of the all overlapping words in the query to calculate the joint probability. The number of times a genus was selected out of the number of bootstrap trials was used as an estimate of confidence in the assignment to that genus.

Throws:
  `ShortSequenceException` - if the sequence length is less than the minimum sequence length.

### addConfidence

public void addConfidence(HierarchyTree node, HashMap map)
increase the count of the RankAssignment in the map if match that node or any ancestor of that node.

Parameters:
  `node` -
  `map` -