Changeset 4631
- Timestamp:
- Nov 7, 2008, 12:06:05 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java
r4606 r4631 1339 1339 // Position -> ReporterID mapping for the parent bioassay set 1340 1340 Map<Integer, Integer> parentReporterPositions = new HashMap<Integer, Integer>(); 1341 boolean parentHasNullReporter = false; 1342 boolean parentHasZeroReporter = false; 1343 boolean mapZeroToNull = false; 1344 1341 1345 // Position -> ReporterID mapping for the child bioassay set 1342 1346 Map<Integer, Integer> childReporterPositions = new HashMap<Integer, Integer>(); … … 1466 1470 { 1467 1471 SqlResult result = positionQueryIterator.next(); 1468 parentReporterPositions.put(result.getInt(1), (Integer)result.getObject(2)); 1469 } 1472 Integer reporterId = (Integer)result.getObject(2); 1473 if (reporterId == null) 1474 { 1475 parentHasNullReporter = true; 1476 } 1477 else if (reporterId.intValue() == 0) 1478 { 1479 parentHasZeroReporter = true; 1480 } 1481 parentReporterPositions.put(result.getInt(1), reporterId); 1482 } 1483 1484 1485 // If we have null reporter (but none with ID=0) in the export 1486 // we may need to convert 0->null when importing since some 1487 // BASE1 plug-ins convert null -> 0 1488 mapZeroToNull = parentHasNullReporter && !parentHasZeroReporter; 1470 1489 } 1471 1490 … … 1528 1547 ffp.getParsedLines() + " in file '" + stdout.getName() + "'"); 1529 1548 } 1530 1549 // Convert 0 -> null since some BASE1 plug-ins convert null -> 0 1550 if (mapZeroToNull && newReporterId != null && newReporterId.intValue() == 0) 1551 { 1552 newReporterId = null; 1553 } 1554 1531 1555 // Is the new reporter the same as the existing? 1532 1556 // A 'null' reporter is considered the same as another 'null' reporter -
trunk/src/test/Base1TestPlugin.java
r4514 r4631 131 131 { 132 132 FlatFileParser.Data data = ffp.nextData(); 133 System.out.println(offset + data.line() );133 System.out.println(offset + data.line().replaceFirst("\\t\\t", "\t0\t")); 134 134 } 135 135 System.out.println();
Note: See TracChangeset
for help on using the changeset viewer.