Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/main/groovy/life/qbic/utils/BioinformaticAnalysisParser.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,12 @@ class BioinformaticAnalysisParser implements DatasetParser<NfCorePipelineResult>
private static void parsePipelineInformation(Map pipelineInformation) {

pipelineInformation.get("children").each { Map child ->
switch (child.get("name")) {
case "software_versions.yml":
insertAsProperty(pipelineInformation, child, RequiredPipelineFileKeys.SOFTWARE_VERSIONS.getKeyName())
break
case "execution_report.html":
insertAsProperty(pipelineInformation, child, RequiredPipelineFileKeys.EXECUTION_REPORT.getKeyName())
break
default:
//ignoring other children
break
String filename = child.get("name")
if(filename.equals("software_versions.yml")){
insertAsProperty(pipelineInformation, child, RequiredPipelineFileKeys.SOFTWARE_VERSIONS.getKeyName())
}
else if(filename.matches("^execution_report.*")) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting i didn't know groovy could do that since java does not have the same functionality 😓

insertAsProperty(pipelineInformation, child, RequiredPipelineFileKeys.EXECUTION_REPORT.getKeyName())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class BioinformaticAnalysisSpec extends Specification {
assert softwareVersions.getName() == "software_versions.yml"

ExecutionReport executionReport = pipelineInfo.getExecutionReport()
assert executionReport.getRelativePath() == "./pipeline_info/execution_report.html"
assert executionReport.getName() == "execution_report.html"
assert executionReport.getRelativePath() == "./pipeline_info/execution_report_1234-56-78_90-12-34.html"
assert executionReport.getName() == "execution_report_1234-56-78_90-12-34.html"


}
Expand Down Expand Up @@ -104,7 +104,7 @@ class BioinformaticAnalysisSpec extends Specification {

def "parsing a file throws a DataParserException"() {
given:
def pathToDirectory = Paths.get(exampleDirectoriesRoot, "validates/pipeline_info/execution_report.html")
def pathToDirectory = Paths.get(exampleDirectoriesRoot, "validates/pipeline_info/execution_report_1234-56-78_90-12-34.html")
when:
bioinformaticAnalysisParser.parseFrom(pathToDirectory)
then:
Expand Down