Permalink
Browse files

Pre-Merge from Lopsided

  • Loading branch information...
danfdeblasio committed Jan 5, 2016
1 parent 9de9b25 commit e7dfbdd00e4813b6b1cdf002bd5dfe430cbbb0c5
Showing with 1,416 additions and 941 deletions.
  1. +0 −3 .gitignore
  2. +10 −2 facet/Consistancy.java
  3. +14 −6 facet/CoreColumn.java
  4. +43 −12 facet/Facet.java
  5. +0 −1 facet/GapCoil.java
  6. +9 −5 facet/InformationContent.java
  7. +7 −4 facet/PercentIdentity.java
  8. +2 −1 facet/Support.java
  9. +24 −0 numberOfRealignmentHistogram.pl
  10. +0 −1 opal/IO/AlignmentWriter.java
  11. +71 −157 opal/IO/ArgumentHandler.java
  12. +0 −2 opal/IO/Configuration.java
  13. +0 −2 opal/IO/CostMatrix.java
  14. +0 −1 opal/IO/Inputs.java
  15. +31 −12 opal/IO/StructureFileReader.java
  16. +10 −20 opal/Opal.java
  17. +41 −42 opal/align/Aligner.java
  18. +28 −24 opal/align/Alignment.java
  19. +2 −2 opal/align/ConsistencyAligner.java
  20. +55 −12 opal/align/ExactCountAligner_Time.java
  21. +16 −16 opal/align/PairAligner.java
  22. +14 −14 opal/align/PairAligner_SplitGamma.java
  23. +85 −49 opal/align/PairSuboptimalityMatrices.java
  24. +2 −3 opal/align/PairSuboptimalityMatricesModified.java
  25. +18 −6 opal/align/PairwiseAlignmentContainer_asymBlendOneParam.java
  26. +18 −6 opal/align/PairwiseAlignmentContainer_asymBlendTwoParam.java
  27. +0 −1 opal/align/PairwiseAlignmentContainer_pureSuboptBlend.java
  28. +18 −6 opal/align/PairwiseAlignmentContainer_simpleBlend.java
  29. +42 −17 opal/align/PairwiseAlignmentContainer_symmetricBlend.java
  30. +6 −6 opal/align/PairwiseAlignmentsContainer.java
  31. +409 −68 opal/align/ProfileAligner.java
  32. +28 −29 opal/align/StructureAlignment.java
  33. +1 −0 opal/align/shapes/ConsistencyShape.java
  34. +14 −9 opal/align/shapes/Shape.java
  35. +27 −14 opal/align/shapes/ShapeLinear.java
  36. +33 −8 opal/align/shapes/ShapeQuadratic.java
  37. +133 −63 opal/align/shapes/ShapeTesterLinear.java
  38. +20 −12 opal/align/shapes/ShapeTesterQuadratic.java
  39. +5 −3 opal/makers/AlignmentMaker.java
  40. +8 −4 opal/makers/AlignmentMaker_Converter.java
  41. +17 −11 opal/makers/AlignmentMaker_SingleSequences.java
  42. +3 −6 opal/makers/AlignmentMaker_SuboptimalityTester.java
  43. +9 −5 opal/makers/AlignmentMaker_TwoAlignments.java
  44. +6 −6 opal/polish/ExhaustiveTwoCutPolisher.java
  45. +9 −11 opal/polish/PolishHelper.java
  46. +10 −10 opal/polish/RandomThreeCutPolisher.java
  47. +7 −7 opal/polish/RandomThreeCutPolisher_restricted_edges.java
  48. +4 −4 opal/polish/RandomTreeTwoCutPolisher.java
  49. +25 −71 opal/realignment/realignmentDriver.java
  50. +0 −1 opal/structures/RangeQuery.java
  51. +1 −2 opal/tree/NormCostDistance.java
  52. +0 −2 opal/tree/PctIDDistance.java
  53. +2 −3 opal/tree/Tree.java
  54. +29 −0 parameterAdviseCleanFolder.pl
  55. +50 −0 parameterAdviseForFolder.pl
  56. +0 −21 twi_200.BLOSUM45.65.35.44.44.fa
  57. +0 −21 twi_200.BLOSUM45.65.65.44.44.fa
  58. +0 −25 twi_200.VTML200.45.11.42.40.fa
  59. +0 −25 twi_200.VTML200.45.45.42.42.fa
  60. +0 −21 twi_200.VTML200.50.2.45.43.fa
  61. +0 −21 twi_200.VTML200.50.50.45.45.fa
  62. +0 −25 twi_200.pre.VTML200.45.11.42.40.fa
View
@@ -6,6 +6,3 @@
.classpath
*.class
realignment_simple*
realignment_removeBlankLines*
View
@@ -23,15 +23,23 @@ public static float sequence(FacetAlignment a, Configuration c){
for(int j1=0;j1<a.numberOfSequences;j1++){
int ct = 0;
for(int j2=j1+1;j2<a.numberOfSequences;j2++){
ct += (c.basesEquivelant(a.sequence[j1].charAt(i),a.sequence[j1].charAt(i)))?1:0;
try{
ct += (c.basesEquivelant(a.sequence[j1].charAt(i),a.sequence[j1].charAt(i)))?1:0;
}catch(IllegalArgumentException e){
}
}
if(ct>max){
max = ct;
cons = a.sequence[j1].charAt(i);
}
}
for(int j=0;j<a.numberOfSequences;j++){
is_consensus[i][j] = c.basesEquivelant(a.sequence[j].charAt(i),cons);
try{
is_consensus[i][j] = c.basesEquivelant(a.sequence[j].charAt(i),cons);
}catch(IllegalArgumentException e){
}
}
}
View
@@ -12,7 +12,11 @@
}else{
int same = 0;
for(int k=0;k<a.numberOfSequences;k++){
if(c.basesEquivelant(a.sequence[j].charAt(i), a.sequence[k].charAt(i))) same++;
try{
if(c.basesEquivelant(a.sequence[j].charAt(i), a.sequence[k].charAt(i))) same++;
}catch(IllegalArgumentException e){
}
}
if(same > max_same) max_same = same;
}
@@ -69,11 +73,15 @@ public static double consensus(FacetAlignment a, Configuration c){
int ec = 0;
int ee = 0;
for(int k=0;k<a.numberOfSequences;k++){
if(c.basesEquivelant(a.sequence[k].charAt(i), a.consensus[i]) &&
c.basesEquivelant(a.sequence[k].charAt(j), a.consensus[j])) cc++;
else if(c.basesEquivelant(a.sequence[k].charAt(i), a.consensus[i])) ce++;
else if(c.basesEquivelant(a.sequence[k].charAt(j), a.consensus[j])) ec++;
else ee++;
try{
if(c.basesEquivelant(a.sequence[k].charAt(i), a.consensus[i]) &&
c.basesEquivelant(a.sequence[k].charAt(j), a.consensus[j])) cc++;
else if(c.basesEquivelant(a.sequence[k].charAt(i), a.consensus[i])) ce++;
else if(c.basesEquivelant(a.sequence[k].charAt(j), a.consensus[j])) ec++;
else ee++;
}catch(IllegalArgumentException e){
}
}
//System.err.println("(" + i + "," + j + ")\t(" + cc + "," + ce + "," + ec + "," + ee + ")");
count_total++;
View
@@ -1,9 +1,6 @@
package facet;
import java.io.FileNotFoundException;
import java.io.File;
import java.util.*;
import java.lang.StringBuffer;
import java.io.PrintWriter;
/**
*
@@ -16,15 +13,49 @@
public class Facet {
public static float defaultValue(FacetAlignment a){
double total = 0.171730397;
Configuration c = new Configuration();
c.normalizeBigN = true;
total += 0.105434529 * PercentIdentity.replacement_score(a, c);
total += 0.172122922 * GapDensity.open(a, c);
total += 0.174107269 * Blockiness.evaluate(a, c);
total += 0.176015402 * PercentIdentity.structure(a, c);
total += 0.200589481 * Support.probability(a, c);
return (float) total;
return defaultValue(a,true);
}
public static float defaultValue(FacetAlignment a, boolean useLegacyFacetFunction){
if(useLegacyFacetFunction){
double total = 0.171730397;
Configuration c = new Configuration();
c.normalizeBigN = true;
total += 0.105434529 * PercentIdentity.replacement_score(a, c);
total += 0.172122922 * GapDensity.open(a, c);
total += 0.174107269 * Blockiness.evaluate(a, c);
total += 0.176015402 * PercentIdentity.structure(a, c);
total += 0.200589481 * Support.probability(a, c);
return (float) total;
}
Configuration c6 = new Configuration();
Configuration c10 = new Configuration();
Configuration c20 = new Configuration();
c6.normalizeBigN = true;
c10.normalizeBigN = true;
c20.normalizeBigN = true;
c6.equivelanceClassSize = 6;
c10.equivelanceClassSize = 10;
c20.equivelanceClassSize = 20;
if(a.type == FacetAlignment.AlignmentType.DNA){
c6.matrix = Configuration.ReplacementMatrix.DNA;
c10.matrix = Configuration.ReplacementMatrix.DNA;
c20.matrix = Configuration.ReplacementMatrix.DNA;
}
if(a.type == FacetAlignment.AlignmentType.RNA){
c6.matrix = Configuration.ReplacementMatrix.RNA;
c10.matrix = Configuration.ReplacementMatrix.RNA;
c20.matrix = Configuration.ReplacementMatrix.RNA;
}
float total = 0;
total += 0.1410924954165966 * Blockiness.evaluate(a, c6);
total += 0.0036230596053536332 * CoreColumn.percentage(a, c10);
total += 0.46472100224308432 * GapDensity.open(a, c6);
total += 0.20416796078871755 * PercentIdentity.sequence(a, c10);
total += 0.039875954173829012 * PercentIdentity.structure(a, c10) ;
total += 0.23897573022221946 * Support.probability(a, c10);
return (float) total;
}
public static void outputDefaultFeatures(String fname, FacetAlignment a){
View
@@ -27,4 +27,3 @@ public static float percentage(FacetAlignment a, Configuration c){
}
}
}
@@ -1,5 +1,5 @@
package facet;
public class InformationContent{
public static String evaluate(Configuration c){
@@ -21,10 +21,14 @@ public static double evaluate(FacetAlignment a, Configuration c){
}
for(int j=0;j<a.numberOfSequences;j++){
if(a.sequence[j].charAt(i) != '-'){
column_count++;
total_count++;
background_probability[c.baseToInt(a.sequence[j].charAt(i))]++;
column_probability[i][c.baseToInt(a.sequence[j].charAt(i))]++;
try{
background_probability[c.baseToInt(a.sequence[j].charAt(i))]++;
column_probability[i][c.baseToInt(a.sequence[j].charAt(i))]++;
column_count++;
total_count++;
}catch(IllegalArgumentException e){
}
}
}
for(int j=0;j<=20;j++){
View
@@ -22,9 +22,13 @@ public static float sequence(FacetAlignment a, Configuration c){
for(int i2=i1+1;i2<a.numberOfSequences;i2++){
for(int j=0;j<a.width;j++){
if(!(a.sequence[i1].charAt(j) == '-' && a.sequence[i2].charAt(j)=='-')){
pairs++;
if(c.basesEquivelant(a.sequence[i1].charAt(j), a.sequence[i2].charAt(j))){
pairsMatch++;
try{
if(c.basesEquivelant(a.sequence[i1].charAt(j), a.sequence[i2].charAt(j))){
pairsMatch++;
}
pairs++;
}catch(IllegalArgumentException e){
}
}
}
@@ -47,7 +51,6 @@ public static float structure(FacetAlignment a, Configuration c){
}
}
}
//System.err.println(pairsMatch+"/"+pairs);
return (float) pairsMatch/pairs;
}
View
@@ -24,9 +24,10 @@ public static float probability(FacetAlignment a, Configuration c){
}
}
//System.err.println(rtn + "/" + ct);
if(ct == 0) return 0;
return rtn/ct;
}
private static float[] scoreTriple(FacetAlignment a, int i, int j, int k, int column){
if(a.sequence[i].charAt(column) == '-' || a.sequence[j].charAt(column) == '-' || a.sequence[k].charAt(column) == '-') return null;
float sum_i = a.structure_prob[i][column][0] + a.structure_prob[i][column][1] + a.structure_prob[i][column][2];
@@ -0,0 +1,24 @@
#!/usr/bin/perl
use strict;
my $fname = shift;
open FILE, "$fname" or die("$fname: $!\n");
my @histogram;
my $countInFile;
while(<FILE>){
if($_ =~ /output file.*pre/){
$histogram[$countInFile]++;
$countInFile = 0;
}elsif($_ =~ /Realigned window/){
$countInFile++;
}
}
$histogram[$countInFile]++;
foreach my $i(0...scalar(@histogram)){
print "$i\t $histogram[$i]\n";
}
@@ -2,7 +2,6 @@
import java.util.ArrayList;
import com.traviswheeler.libs.LogWriter;
import opal.align.Aligner;
Oops, something went wrong.

0 comments on commit e7dfbdd

Please sign in to comment.