Changeset 4442
- Timestamp:
- Mar 13, 2013, 2:09:13 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugin/src/org/proteios/plugins/FeatureSequencePropagator.java
r4441 r4442 743 743 } 744 744 745 Set<Integer> maxSet = fileMatchMap.keySet(); 745 Set<Integer> maxSet = new TreeSet<Integer>(); 746 maxSet.addAll(fileMatchMap.keySet()); 746 747 Set<Integer> firstSubSet = fileMatchMap.get(0); 747 748 Set<Integer> secondSubSet = fileMatchMap.get(0); … … 871 872 .getSecondFile()); 872 873 873 if (addedSetAlignment && firstSubSet.contains(fp.getFirstFile()) && secondSubSet.contains(fp.getSecondFile()) && addedSetMatches<MATCHED_FILES_LIMIT || ((nbrMatchesPerFile[firstFileIndex]<currentMatch || nbrMatchesPerFile[secondFileIndex]<currentMatch) && nbrMatchesPerFile[firstFileIndex]<MATCHED_FILES_LIMIT+1 && nbrMatchesPerFile[secondFileIndex]<MATCHED_FILES_LIMIT+1 )) {874 if (addedSetAlignment && firstSubSet.contains(fp.getFirstFile()) && secondSubSet.contains(fp.getSecondFile()) && addedSetMatches<MATCHED_FILES_LIMIT || ((nbrMatchesPerFile[firstFileIndex]<currentMatch || nbrMatchesPerFile[secondFileIndex]<currentMatch) && nbrMatchesPerFile[firstFileIndex]<MATCHED_FILES_LIMIT+1 && nbrMatchesPerFile[secondFileIndex]<MATCHED_FILES_LIMIT+1 && !breakAlignment)) { 874 875 875 876 if (addedSetAlignment){ 876 877 877 addedSetMatches++; 878 878 } 879 879 880 if (addedSetMatches==MATCHED_FILES_LIMIT){ 881 writer.println("Subgroups have matched " +(addedSetMatches-1) +"times." ); 880 if (addedSetMatches==MATCHED_FILES_LIMIT || !itr.hasNext()){ 882 881 addedSetAlignment = false; 883 882 } … … 911 910 writer.println(); 912 911 913 hasMatchedAllFiles=setMatchedFiles(fp.getFirstFile(), fp.getSecondFile(), fileMatchMap, nbrOfFiles , writer);912 hasMatchedAllFiles=setMatchedFiles(fp.getFirstFile(), fp.getSecondFile(), fileMatchMap, nbrOfFiles); 914 913 915 914 // Alignment is to be performed, the matching … … 1087 1086 1088 1087 } 1089 }1088 1090 1089 1091 1090 1092 1091 if (breakAlignment) { 1093 1094 if (hasMatchedAllFiles && !addedSetAlignment){ 1095 1092 1093 1094 1095 if (hasMatchedAllFiles){ 1096 1096 1097 simList.clear(); 1097 1098 break; 1098 1099 1099 1100 }else{ 1100 1101 //there are subgroups of files that have not matched to each other 1102 1103 writer.println(); 1104 writer.println("==============================="); 1105 writer.println(); 1106 1101 1107 writer.println("There are subgroups in data."); 1108 writer.println("Extending alignment between subgroups."); 1102 1109 1103 1110 addedSetAlignment = true; 1104 1111 1105 1112 firstSubSet = fileMatchMap.get(0); 1106 writer.println("First subgroup: " +firstSubSet.toString()); 1107 1113 1108 1114 maxSet.removeAll(firstSubSet); 1109 1115 secondSubSet = new TreeSet<Integer>(maxSet); 1110 writer.println("Other subgroup: " +secondSubSet.toString()); 1111 1112 maxSet = fileMatchMap.keySet(); 1116 1117 maxSet.addAll(firstSubSet); 1113 1118 itr = simList.listIterator(); 1114 1119 continue; 1115 1120 1121 1116 1122 } 1117 1118 1119 1120 } 1121 1122 if(!addedSetAlignment){1123 1124 1125 1126 } 1127 1128 1123 1129 for (int ii = 0; ii < nbrMatchesPerFile.length; ii++) { 1124 1130 if (nbrMatchesPerFile[ii]<currentMatch) { … … 1467 1473 } 1468 1474 1469 private boolean setMatchedFiles(int file1, int file2, TreeMap<Integer, TreeSet<Integer>> fileMatchMap, int nbrOfFiles , PrintWriter writer){1475 private boolean setMatchedFiles(int file1, int file2, TreeMap<Integer, TreeSet<Integer>> fileMatchMap, int nbrOfFiles){ 1470 1476 1471 1477 Set<Integer> firstFileSet = fileMatchMap.get(file1); … … 1491 1497 for(Integer key:secondFileSet){ 1492 1498 fileMatchMap.put(key, combinedSet); 1493 }1494 1495 writer.println("Current map.");1496 for (int i=0; i<nbrOfFiles;i++){1497 writer.println(i +" " +fileMatchMap.get(i).toString());1498 1499 1499 } 1500 1500
Note: See TracChangeset
for help on using the changeset viewer.