Changeset 20780
- Timestamp:
- 03/03/10 13:56:16 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modmine/webapp/src/org/modmine/web/FeaturesAction.java
r20774 r20780 62 62 */ 63 63 64 // private static final Logger LOG = Logger.getLogger(MetadataCache.class);64 // private static final Logger LOG = Logger.getLogger(MetadataCache.class); 65 65 66 66 public ActionForward execute(ActionMapping mapping, … … 82 82 PathQuery q = new PathQuery(model); 83 83 84 boolean hasPrimer = false; 85 84 86 if (type.equals("experiment")) { 85 87 experimentName = (String) request.getParameter("experiment"); … … 89 91 Set<String> allUnlocated = new HashSet<String>(); 90 92 91 for (String subId : expSubsIds){ 92 if (MetadataCache.getUnlocatedFeatureTypes(os).containsKey(new Integer(subId))){ 93 allUnlocated.addAll(MetadataCache.getUnlocatedFeatureTypes(os).get(new Integer(subId))); 94 } 95 } 96 97 if (allUnlocated.contains(featureType)){ 98 q.addView(featureType + ".primaryIdentifier"); 99 q.addView(featureType + ".score"); 100 q.addView(featureType + ".submissions:experimentalFactors.type"); 101 q.addView(featureType + ".submissions:experimentalFactors.name"); 102 q.addConstraint(featureType + ".submissions.experiment.name", 103 Constraints.eq(experimentName)); 104 105 } else { 106 q.addView(featureType + ".primaryIdentifier"); 107 q.addView(featureType + ".score"); 108 q.addView(featureType + ".chromosome.primaryIdentifier"); 109 q.addView(featureType + ".chromosomeLocation.start"); 110 q.addView(featureType + ".chromosomeLocation.end"); 111 q.addView(featureType + ".chromosomeLocation.strand"); 112 q.addView(featureType + ".submissions:experimentalFactors.type"); 113 q.addView(featureType + ".submissions:experimentalFactors.name"); 114 q.addConstraint(featureType + ".submissions.experiment.name", 115 Constraints.eq(experimentName)); 116 q.addOrderBy(featureType + ".chromosome.primaryIdentifier"); 117 q.addOrderBy(featureType + ".chromosomeLocation.start"); 118 119 } 93 hasPrimer = false; 120 94 121 95 String ef = getFactors(exp); 96 if (ef.contains("primer")){ 97 hasPrimer = true; 98 } 99 100 122 101 String description = "All " + featureType + " features generated by experiment '" 123 102 + exp.getName() + "' in " + StringUtil.prettyList(exp.getOrganisms()) … … 125 104 q.setDescription(description); 126 105 106 107 for (String subId : expSubsIds){ 108 if (MetadataCache.getUnlocatedFeatureTypes(os).containsKey(new Integer(subId))){ 109 allUnlocated.addAll(MetadataCache.getUnlocatedFeatureTypes(os).get(new Integer(subId))); 110 } 111 } 112 113 if (allUnlocated.contains(featureType)){ 114 // temporary until we remove primers from factors 115 if (hasPrimer){ 116 q.addView(featureType + ".primaryIdentifier"); 117 q.addView(featureType + ".score"); 118 q.addConstraint(featureType + ".submissions.experiment.name", 119 Constraints.eq(experimentName)); 120 } else { 121 q.addView(featureType + ".primaryIdentifier"); 122 q.addView(featureType + ".score"); 123 q.addView(featureType + ".submissions:experimentalFactors.type"); 124 q.addView(featureType + ".submissions:experimentalFactors.name"); 125 q.addConstraint(featureType + ".submissions.experiment.name", 126 Constraints.eq(experimentName)); 127 } 128 } else { 129 130 if (hasPrimer){ 131 132 q.addView(featureType + ".primaryIdentifier"); 133 q.addView(featureType + ".score"); 134 q.addView(featureType + ".chromosome.primaryIdentifier"); 135 q.addView(featureType + ".chromosomeLocation.start"); 136 q.addView(featureType + ".chromosomeLocation.end"); 137 q.addView(featureType + ".chromosomeLocation.strand"); 138 q.addConstraint(featureType + ".submissions.experiment.name", 139 Constraints.eq(experimentName)); 140 q.addOrderBy(featureType + ".chromosome.primaryIdentifier"); 141 q.addOrderBy(featureType + ".chromosomeLocation.start"); 142 } else { 143 q.addView(featureType + ".primaryIdentifier"); 144 q.addView(featureType + ".score"); 145 q.addView(featureType + ".chromosome.primaryIdentifier"); 146 q.addView(featureType + ".chromosomeLocation.start"); 147 q.addView(featureType + ".chromosomeLocation.end"); 148 q.addView(featureType + ".chromosomeLocation.strand"); 149 q.addView(featureType + ".submissions:experimentalFactors.type"); 150 q.addView(featureType + ".submissions:experimentalFactors.name"); 151 q.addConstraint(featureType + ".submissions.experiment.name", 152 Constraints.eq(experimentName)); 153 q.addOrderBy(featureType + ".chromosome.primaryIdentifier"); 154 q.addOrderBy(featureType + ".chromosomeLocation.start"); 155 156 } 157 } 158 127 159 } else if (type.equals("submission")) { 128 160 dccId = (String) request.getParameter("submission"); 129 161 Submission sub = MetadataCache.getSubmissionByDccId(os, new Integer(dccId)); 130 131 162 List<String> unlocFeatures = MetadataCache.getUnlocatedFeatureTypes(os).get(new Integer(dccId)); 132 163 133 if (!unlocFeatures.contains(featureType)){ 134 q.addView(featureType + ".primaryIdentifier"); 135 q.addView(featureType + ".score"); 136 q.addView(featureType + ".chromosome.primaryIdentifier"); 137 q.addView(featureType + ".chromosomeLocation.start"); 138 q.addView(featureType + ".chromosomeLocation.end"); 139 q.addView(featureType + ".chromosomeLocation.strand"); 140 q.addView(featureType + ".submissions:experimentalFactors.type"); 141 q.addView(featureType + ".submissions:experimentalFactors.name"); 142 q.addConstraint(featureType + ".submissions.DCCid", Constraints.eq(new Integer(dccId))); 143 q.addOrderBy(featureType + ".chromosome.primaryIdentifier"); 144 q.addOrderBy(featureType + ".chromosomeLocation.start"); 145 146 } else { 147 148 q.addView(featureType + ".primaryIdentifier"); 149 q.addView(featureType + ".score"); 150 q.addView(featureType + ".submissions:experimentalFactors.type"); 151 q.addView(featureType + ".submissions:experimentalFactors.name"); 152 q.addConstraint(featureType + ".submissions.DCCid", Constraints.eq(new Integer(dccId))); 153 } 154 164 hasPrimer = false; 165 166 // to build the query description 155 167 String experimentType = ""; 156 168 if (sub.getExperimentType() != null) { … … 162 174 if (SubmissionHelper.getExperimentalFactorString(sub).length() > 1){ 163 175 efSub = " using " + SubmissionHelper.getExperimentalFactorString(sub); 176 if (efSub.contains("primer")){ 177 hasPrimer = true; 178 efSub = ""; 179 } 164 180 } 165 181 … … 169 185 + " (" + sub.getProject().getSurnamePI() + ")."; 170 186 q.setDescription(description); 187 188 if (unlocFeatures == null || unlocFeatures.contains(featureType)){ 189 if (hasPrimer){ 190 q.addView(featureType + ".primaryIdentifier"); 191 q.addView(featureType + ".score"); 192 q.addConstraint(featureType + ".submissions.DCCid", Constraints.eq(new Integer(dccId))); 193 194 } else { 195 q.addView(featureType + ".primaryIdentifier"); 196 q.addView(featureType + ".score"); 197 q.addView(featureType + ".submissions:experimentalFactors.type"); 198 q.addView(featureType + ".submissions:experimentalFactors.name"); 199 q.addConstraint(featureType + ".submissions.DCCid", Constraints.eq(new Integer(dccId))); 200 } 201 202 } else { 203 204 // temporary until we remove primers from factors 205 if (hasPrimer){ 206 q.addView(featureType + ".primaryIdentifier"); 207 q.addView(featureType + ".score"); 208 q.addView(featureType + ".chromosome.primaryIdentifier"); 209 q.addView(featureType + ".chromosomeLocation.start"); 210 q.addView(featureType + ".chromosomeLocation.end"); 211 q.addView(featureType + ".chromosomeLocation.strand"); 212 q.addConstraint(featureType + ".submissions.DCCid", Constraints.eq(new Integer(dccId))); 213 q.addOrderBy(featureType + ".chromosome.primaryIdentifier"); 214 q.addOrderBy(featureType + ".chromosomeLocation.start"); 215 } else { 216 217 q.addView(featureType + ".primaryIdentifier"); 218 q.addView(featureType + ".score"); 219 q.addView(featureType + ".chromosome.primaryIdentifier"); 220 q.addView(featureType + ".chromosomeLocation.start"); 221 q.addView(featureType + ".chromosomeLocation.end"); 222 q.addView(featureType + ".chromosomeLocation.strand"); 223 q.addView(featureType + ".submissions:experimentalFactors.type"); 224 q.addView(featureType + ".submissions:experimentalFactors.name"); 225 q.addConstraint(featureType + ".submissions.DCCid", Constraints.eq(new Integer(dccId))); 226 q.addOrderBy(featureType + ".chromosome.primaryIdentifier"); 227 q.addOrderBy(featureType + ".chromosomeLocation.start"); 228 } 229 } 171 230 } 172 231
Note: See TracChangeset
for help on using the changeset viewer.
