|
13 | 13 | import org.apache.commons.io.FileUtils; |
14 | 14 | import org.apache.commons.io.filefilter.IOFileFilter; |
15 | 15 | import org.apache.commons.lang3.StringUtils; |
16 | | -import org.apache.logging.log4j.Logger; |
17 | 16 | import org.apache.logging.log4j.LogManager; |
| 17 | +import org.apache.logging.log4j.Logger; |
18 | 18 | import org.json.JSONArray; |
19 | 19 | import org.json.JSONObject; |
20 | 20 | import org.junit.AfterClass; |
|
88 | 88 | import java.util.List; |
89 | 89 | import java.util.Map; |
90 | 90 | import java.util.Set; |
| 91 | +import java.util.stream.Collectors; |
91 | 92 |
|
92 | 93 | /** |
93 | 94 | * User: bimber |
@@ -923,8 +924,8 @@ public int compare(PipelineJob o1, PipelineJob o2) |
923 | 924 |
|
924 | 925 | verifyJob(basedir, jobName, expectedOutputs, new String[]{PAIRED_FILENAME_L1a, PAIRED_FILENAME2_L1a, PAIRED_FILENAME_L1b, PAIRED_FILENAME2_L1b, PAIRED_FILENAME_L2, PAIRED_FILENAME2_L2}, prefix, config); |
925 | 926 |
|
926 | | - Assert.assertEquals("Incorrect read number", 633L, FastqUtils.getSequenceCount(merge1)); |
927 | | - Assert.assertEquals("Incorrect read number", 633L, FastqUtils.getSequenceCount(merge2)); |
| 927 | + Assert.assertEquals("Incorrect read number", 422L, FastqUtils.getSequenceCount(merge1)); |
| 928 | + Assert.assertEquals("Incorrect read number", 422L, FastqUtils.getSequenceCount(merge2)); |
928 | 929 |
|
929 | 930 | //job2: g2 |
930 | 931 | expectedOutputs = new HashSet<>(); |
@@ -1337,7 +1338,12 @@ private void validateSamples(SequenceReadsetImpl[] models, JSONObject config) |
1337 | 1338 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); |
1338 | 1339 | Assert.assertEquals("Incorrect sampleDate", o.getString("sampledate"), m.getSampleDate() == null ? null : format.format(m.getSampleDate())); |
1339 | 1340 |
|
1340 | | - //TODO: readData |
| 1341 | + String fileGroup = o.getString("fileGroupId"); |
| 1342 | + List<String> keys = config.keySet().stream().filter(x -> x.startsWith("fileGroup_")).filter(x -> fileGroup.equals(new JSONObject(config.getString(x)).getString("name"))).collect(Collectors.toList()); |
| 1343 | + Set<String> platformUnits = keys.stream().map(x -> new JSONObject(config.getString(x)).getJSONArray("files").toJSONObjectArray()).flatMap(Arrays::stream).map(y -> y.getString("platformUnit") == null ? y.getString("file1") : y.getString("platformUnit")).collect(Collectors.toSet()); |
| 1344 | + Assert.assertFalse("No matching readdata", platformUnits.isEmpty()); |
| 1345 | + |
| 1346 | + Assert.assertEquals("Incorrect number of readdata", m.getReadData().size(), platformUnits.size()); |
1341 | 1347 | } |
1342 | 1348 | } |
1343 | 1349 |
|
|
0 commit comments