Changeset 1583 for branches/ralph/src/main/java/de/ugoe/cs/autoquest
- Timestamp:
- 06/26/14 23:34:58 (10 years ago)
- Location:
- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/pal/tree/FengDoolittleNode.java
r1580 r1583 11 11 12 12 import java.util.ArrayList; 13 import java.util.logging.Level; 13 14 14 15 import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.NumberSequence; 15 16 import de.ugoe.cs.autoquest.tasktrees.alignment.pal.misc.Identifier; 17 import de.ugoe.cs.util.console.Console; 16 18 17 19 18 20 /** 19 * data structure for a node (includes branch) in a binary/non-binary20 * rooted/unrooted tree21 21 * 22 22 * @version $Id: SimpleNode.java,v 1.20 2002/01/14 04:16:53 matt Exp $ … … 377 377 378 378 if(newNode instanceof FengDoolittleNode) { 379 ((FengDoolittleNode) newNode).alignSequences();379 newNode.setSequences(((FengDoolittleNode) newNode).alignSequences()); 380 380 } 381 381 … … 397 397 398 398 399 private void alignSequences() { 399 private ArrayList<NumberSequence> alignSequences() { 400 ArrayList<NumberSequence> alignment = new ArrayList<NumberSequence>(); 400 401 if(this.getChildCount()<3) { 401 402 … … 406 407 int seqCount2 = node2.getSequences().size(); 407 408 409 //Align 2 sequences 410 if(seqCount1 == 1 && seqCount2 == 1) { 411 } 412 //Align a sequence to a group 413 else if( seqCount1 > 1 && seqCount2 == 1) { 408 414 409 415 } 416 //Align a sequence to a group 417 else if(seqCount1 == 1 && seqCount2 > 1) { 418 419 } 420 //Align 2 groups 421 else if((seqCount1 > 1) && (seqCount2 > 1)){ 422 423 } 424 else { 425 Console.traceln(Level.INFO,"No sequences to align while merging two nodes."); 426 } 410 427 } 411 428 else { 412 System.out.println("This should never happen, it's a binary tree."); 413 } 414 415 } 416 429 Console.traceln(Level.WARNING,"More than 2 children! This should never happen, it's a binary tree."); 430 } 431 return alignment; 432 } 433 434 public void setSequences(ArrayList<NumberSequence> alignSequences) { 435 this.sequences = alignSequences; 436 } 417 437 418 438 } -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/pal/tree/Node.java
r1580 r1583 138 138 void addSequence(NumberSequence numberSequence); 139 139 140 void setSequences(ArrayList<NumberSequence> alignSequences); 141 142 143 144 140 145 141 146 -
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
r1580 r1583 160 160 UPGMAMatrix sequenceDistances = new UPGMAMatrix(numberseqs.size()); 161 161 sequenceDistances.initialize(Double.POSITIVE_INFINITY); 162 163 //Save the alignments so we do not need to recalculate those when aligning them again in feng doolittle algorithm 164 SmithWatermanRepeated[][] alignments = new SmithWatermanRepeated[numberseqs.size()][numberseqs.size()]; 162 165 163 166 for (int i = 0; i < numberseqs.size(); i++) { … … 169 172 int smithWatermanThreshold = 10; 170 173 171 SmithWatermanRepeated twoSequences= new SmithWatermanRepeated(174 alignments[i][j] = new SmithWatermanRepeated( 172 175 ns1.getSequence(), ns2.getSequence(), submat, 173 176 smithWatermanThreshold); … … 182 185 183 186 // Score of the aligmnment 184 double score = twoSequences.getAlignmentScore();187 double score = alignments[i][j].getAlignmentScore(); 185 188 // Scores of the sequence being aligned to itself (maximum score) 186 189 double sSelf1 = sameSequence1.getAlignmentScore();
Note: See TracChangeset
for help on using the changeset viewer.