Gibb's Sampling Steps:
- Set every variable to a random value.
- Choose a variable to update.
- Randomly Select (aka "Sample") a new value for the variable based on the current conditions.
- Repeat from Step 2.
Gibb's Sampling Steps:
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 1 | Constructs and performs Gibb's Sampling in order to find repeated motifs. |
| sample | 1 | This method is repeated 2000 times. |
| calculateQ | 1 | Calculates the probability of a letter in this position. |
| calculateP | 1 | Calculates the probability of a letter randomly selected. |
| generateRandomValue | 1 | Calculates and stores every random value. |
| PQ | 1 |
03 Members
String(), Int32)Constructs and performs Gibb's Sampling in order to find repeated motifs.
| Name | Type | Description |
|---|---|---|
seqArray | String() | A String array of the sequences that will be used. |
motifLength | Int32 | An Integer that shows the length of the motif or pattern we are trying to find, this value is given. |
Int32)This method is repeated 2000 times.
String, Int32, Int32)Calculates the probability of a letter in this position.
| Name | Type | Description |
|---|---|---|
tempMotif | String | The motif being used for this calculation. |
chosenSeqIndex | Int32 | The index of the sequence being used for this calculation, useful for skipping all of this sequences calculations and focusing on the other ones. |
A double of the probability of a letter in this position.
String, Int32)Calculates the probability of a letter randomly selected.
To find this value, the method loops through each letter of the selected temporary motif, and loops through the other sequences. While looping through the other sequences, we find the amount of same letters in each other sequence, along with the total length of all other sequences. The value P is a product of every result, each result being the amount of letters of the same kind over the total amount of letters.
| Name | Type | Description |
|---|---|---|
tempMotif | String | The motif being used for this calculation. |
chosenSeqIndex | Int32 | The index of the sequence being used for this calculation, useful for skipping all of this sequences calculations and focusing on the other ones. |
A double of the probability of a letter randomly selected.
Calculates and stores every random value. Generates a random from 0 to a value of each individual sequences length subtracted by the motif length.
A HashTable containing the sequence as a key, and the random integer to be used as the value.
Int32)