forked from trvrb/antigen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New GeometricSeqPhenotype class (#22)
* Created a GeometricSeqPhenotype class that implements Phenotype and uses composition * Maintain translation from nucleotides to amino acids * Precompute vectors from gamma distribution * Made sure nucleotide is being mutated to a different letter. * Test matrix of vectors drawn from the gamma distribution * Remove gamma distribution csv output from repo * Keep mutating until it's not a stop codon * if mutation creates a stop codon, switch index to mutate * represent sequence using a char[] * use inheritance instead of composition * Clean up code, add documentation * finish unit tests for geometricseq * clean up repo * each sentence gets own line. * Address Hugh and Zorian's comments. First round. * Remove SequencePhenotype.java * Fix issue #23 * Remove DMS file requirement * Clean up code and refactor sanity check * Created a GeometricSeqPhenotype class that implements Phenotype and uses composition * Maintain translation from nucleotides to amino acids * Precompute vectors from gamma distribution * Made sure nucleotide is being mutated to a different letter. * Test matrix of vectors drawn from the gamma distribution * Remove gamma distribution csv output from repo * Keep mutating until it's not a stop codon * if mutation creates a stop codon, switch index to mutate * represent sequence using a char[] * use inheritance instead of composition * Clean up code, add documentation * finish unit tests for geometricseq * clean up repo * Address Hugh and Zorian's comments. First round. * Fix issue #23 * Remove DMS file requirement * Clean up code and refactor sanity check * format updates. * remove illegal characters from filename * update readme * Nonfunctional changes to code from Erick's review of PR #22 * Test CodonMap values are correct * Update out.tips for GeometricSeq fields * change names from traitA/B to ag1/2 to consistency * Clean up commented and unused code * print fasta for branches * Add startingSequence and epitopeSites files and output fasta file * Initial commit for testing geometric seq phenotype without predefined dictionary of vectors * Clean up and refactor things * Fix bug with reset and organize/optimize a little more in GeometricSeqPhenotype.java * Make sure that the nucleotide sequence is updated even for synonymous mutations * fasta file rename for pipeline * Update README.md * updates to params for customization of output path * remove .out from outputs * Add headers to fasta file sequences * Update to deme name instead of ID * allow last codon to be a stop * log file creation * file formatting --------- Co-authored-by: Zorian Thornton <[email protected]>
- Loading branch information
1 parent
0cc19ec
commit 25ad694
Showing
19 changed files
with
1,951 additions
and
988 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,53 @@ | ||
/* Holds random number genator necessities */ | ||
/* Trying to encapsulate this, so the RNG particulars can be changed if necessary */ | ||
/* Trying to encapsulate this, so the RNG particulars can be changed if necessary */ | ||
/* Completely static class, allows no instances to be instantiated */ | ||
|
||
//import cern.jet.random.*; | ||
import cern.jet.random.*; | ||
|
||
public class Random { | ||
|
||
// methods | ||
|
||
public static int nextInt(int from, int to) { | ||
return cern.jet.random.Uniform.staticNextIntFromTo(from, to); | ||
} | ||
} | ||
|
||
public static double nextDouble() { | ||
return cern.jet.random.Uniform.staticNextDouble(); | ||
return cern.jet.random.Uniform.staticNextDouble(); | ||
} | ||
|
||
public static double nextDouble(double from, double to) { | ||
return cern.jet.random.Uniform.staticNextDoubleFromTo(from, to); | ||
} | ||
return cern.jet.random.Uniform.staticNextDoubleFromTo(from, to); | ||
} | ||
|
||
public static double nextNormal() { | ||
return cern.jet.random.Normal.staticNextDouble(0.0,1.0); | ||
return cern.jet.random.Normal.staticNextDouble(0.0, 1.0); | ||
} | ||
|
||
public static double nextNormal(double mean, double sd) { | ||
return cern.jet.random.Normal.staticNextDouble(mean,sd); | ||
} | ||
return cern.jet.random.Normal.staticNextDouble(mean, sd); | ||
} | ||
|
||
// tuned with mean | ||
public static double nextExponential(double lambda) { | ||
return cern.jet.random.Exponential.staticNextDouble(1.0/lambda); | ||
return cern.jet.random.Exponential.staticNextDouble(1.0 / lambda); | ||
} | ||
|
||
// tuned with alpha and beta, matching Mathematica's notation | ||
public static double nextGamma(double alpha, double beta) { | ||
return cern.jet.random.Gamma.staticNextDouble(alpha, 1/beta); | ||
} | ||
return cern.jet.random.Gamma.staticNextDouble(alpha, 1 / beta); | ||
} | ||
|
||
public static int nextPoisson(double lambda) { | ||
return cern.jet.random.Poisson.staticNextInt(lambda); | ||
} | ||
|
||
public static boolean nextBoolean(double p) { | ||
boolean x = false; | ||
if (nextDouble() < p) { | ||
x = true; | ||
} | ||
return x; | ||
} | ||
|
||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.