Changeset 1590
- Timestamp:
- Mar 20, 2012, 7:07:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/no.uib.cbu.base.magetabexport/trunk/src/main/java/no/uib/cbu/base/magetabexport/SDRFCreator.java
r1474 r1590 175 175 } 176 176 177 177 178 // add experimental factors 178 179 if (!rba.isAnnotated()) { … … 180 181 "Can't retrieve experimental factor(s)."); 181 182 } 183 182 184 for (AnnotationType at : factors) { 185 183 186 List<AnnotationSnapshot> as = snapMan.findAnnotations(dc, rba, new AnnotationTypeFilter(at), true); 187 184 188 if (as == null || as.isEmpty()) { 185 189 throw new MageTabException("raw bioassay ["+rba.getName()+"] is not annotated with "+ 186 190 "an experimental factor ["+at.getName()+"]."); 187 } 188 if (as.size() > 1) { 191 } 192 else if (as.size() == 1) { // one-channel experiment 193 AnnotationSnapshot a = as.get(0); 194 se.addExperimentalFactor(at.getName(), getValueForAnnotation(a)); 195 } 196 else if (as.size() == 2) { // two-channel experiment 197 // find the correct annotation looking at sample annotation of this SDRFEntry 198 for (AnnotationSnapshot a : as) { 199 String ann = getValueForAnnotation(a); 200 ItemInfo ii = se.getItems().get(ItemInfo.TYPE.SAMPLE); 201 if (ii != null && ii.getAllCharacteristicsNames().contains(at.getName())) { 202 if (ann.equals(ii.getCharacteristicValue(at.getName()))) { 203 se.addExperimentalFactor(at.getName(), ann); 204 break; 205 } 206 } 207 } 208 } else { 189 209 throw new MageTabException("raw bioassay ["+rba.getName()+"] has multiple annotations "+ 190 210 "of type ["+at.getName()+"]."); 191 211 } 192 AnnotationSnapshot a = as.get(0);193 se.addExperimentalFactor(at.getName(), getValueForAnnotation(a));212 213 194 214 } 195 215
Note: See TracChangeset
for help on using the changeset viewer.