# Class ReadsOnMarkersModel

java.lang.Object
org.snpeff.stats.ReadsOnMarkersModel

public class ReadsOnMarkersModel extends Object
Calculate the maximum interval length by type, for all markers in a genome Create a probability model based on binomial ditribution.

Author:
  pcingola

## Constructor Summary

Constructors
Constructor
Description
`ReadsOnMarkersModel(SnpEffectPredictor snpEffectPredictor)`

## Method Summary

Modifier and Type
Method
Description
`void`
`countBases()`
Count bases covered for each marker type
`CountByType`
`getCountBases()`
`CountByType`
`getCountMarkers()`
`CountByType`
`getProb()`
`CountByType`
`getRawCountBases()`
`CountByType`
`getRawCountMarkers()`
`void`
`load(String fileName)`
Load data from a file
`void`
`randomSampling(int iterations, int readLen, int numReads)`
Sample and calculate the probability of hitting each type of marker (marker.class).
`boolean`
`run()`
Run
`void`
`save(String fileName)`
Save model to file
`void`
`setMarkerTypes(MarkerTypes markerTypes)`
`void`
`setNumIterations(int numIterations)`
`void`
`setNumReads(int numReads)`
`void`
`setReadLength(int readLength)`
`void`
`setSnpEffectPredictor(SnpEffectPredictor snpEffectPredictor)`
`void`
`setVerbose(boolean verbose)`
`String`
`toString()`

### Methods inherited from class Object

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

## Constructor Details

### ReadsOnMarkersModel

public ReadsOnMarkersModel(SnpEffectPredictor snpEffectPredictor)

## Method Details

### countBases

public void countBases()
Count bases covered for each marker type

### getCountBases

public CountByType getCountBases()

### getCountMarkers

public CountByType getCountMarkers()

### getProb

public CountByType getProb()

### getRawCountBases

public CountByType getRawCountBases()

### getRawCountMarkers

public CountByType getRawCountMarkers()

### load

public void load(String fileName)
Load data from a file

Parameters:
  `fileName` -

### randomSampling

public void randomSampling(int iterations, int readLen, int numReads)
Sample and calculate the probability of hitting each type of marker (marker.class). Creates 'numReads' reads of size 'readLen' and count how many of them hit each marker type. Iterate 'iterations' times to obtain a distribution.

### run

public boolean run()
Run

Returns:

### save

public void save(String fileName)
Save model to file

Parameters:
  `fileName` -

### setMarkerTypes

public void setMarkerTypes(MarkerTypes markerTypes)

### setNumIterations

public void setNumIterations(int numIterations)

### setNumReads

public void setNumReads(int numReads)

### setReadLength

public void setReadLength(int readLength)

### setSnpEffectPredictor

public void setSnpEffectPredictor(SnpEffectPredictor snpEffectPredictor)

### setVerbose

public void setVerbose(boolean verbose)

### toString

public String toString()

Overrides:
  `toString` in class `Object`