Commit e02abd84 authored by Koehorst, Jasper's avatar Koehorst, Jasper
Browse files

read length check for both files added

parent 4f5f4cde
Pipeline #15123 failed with stage
in 32 seconds
......@@ -111,19 +111,25 @@ public class NGTax {
workflow.addForward_reads(files.get(0).getFilePath());
workflow.addReverse_reads(files.get(1).getFilePath());
SequenceDataSet sequenceDataSet = (SequenceDataSet) ampliconAssay.getAllFile().get(0);
SequenceDataSet sequenceDataSet1 = (SequenceDataSet) ampliconAssay.getAllFile().get(0);
SequenceDataSet sequenceDataSet2 = (SequenceDataSet) ampliconAssay.getAllFile().get(1);
Long maxReadLength = sequenceDataSet1.getReadLength();
if (maxReadLength < sequenceDataSet2.getReadLength()) {
maxReadLength = sequenceDataSet2.getReadLength()
}
// Evaluate if the set read length matches / smaller than the raw read length
if (commandOptions.read_len == 0 && sequenceDataSet.getReadLength() > 0) {
if (commandOptions.read_len == 0 && maxReadLength > 0) {
log.debug("Obtaining read length information from RDF file");
workflow.setRev_read_len(Math.toIntExact(sequenceDataSet.getReadLength()));
workflow.setFor_read_len(Math.toIntExact(sequenceDataSet.getReadLength()));
workflow.setFor_read_len(Math.toIntExact(sequenceDataSet1.getReadLength()));
workflow.setRev_read_len(Math.toIntExact(sequenceDataSet2.getReadLength()));
} else if (commandOptions.read_len > 0) {
if (commandOptions.read_len > sequenceDataSet.getReadLength()) {
log.error("Skipping!!! As ead length of " + commandOptions.read_len + " is larger than " + sequenceDataSet.getReadLength());
// If set read length greater then file 1 OR file 2 skip
if (commandOptions.read_len > maxReadLength) {
log.error("Skipping!!! As read length of " + commandOptions.read_len + " is larger than " + maxReadLength);
continue;
}
log.debug("Setting read length to " + commandOptions.read_len + " of " + sequenceDataSet.getReadLength());
log.debug("Setting read length to " + commandOptions.read_len + " of " + maxReadLength);
workflow.setRev_read_len(Math.toIntExact(commandOptions.read_len));
workflow.setFor_read_len(Math.toIntExact(commandOptions.read_len));
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment