Clean up pipeline files

- Remove unused variable and redundant comments/echo statements in main.nf
- Remove obsolete files: simple.nf, test.nf, generate_patients.sh,
  test_synthea.sh, trace.txt, docker-compose.yml
  (all referenced local-only synthea-module-generator image)
This commit is contained in:
2026-03-25 15:09:07 +01:00
parent f8df39d9af
commit 67bd6692b0
7 changed files with 2 additions and 378 deletions

14
main.nf
View File

@@ -2,7 +2,6 @@
nextflow.enable.dsl=2
// Default parameters
params.disease_name = null
params.outdir = null
params.population = 10
@@ -11,7 +10,6 @@ params.min_age = 0
params.max_age = 90
params.seed = null
// Validate required parameters
if (!params.disease_name) {
error "Disease name is required. Please specify with --disease_name"
}
@@ -20,7 +18,6 @@ if (!params.outdir) {
error "Output directory is required. Please specify with --outdir"
}
// Process to generate synthetic patients
process generatePatients {
container 'harbor.cluster.omic.ai/omic/synthea-alldiseases:v3'
publishDir params.outdir, mode: 'copy'
@@ -33,14 +30,13 @@ process generatePatients {
path "run.log", emit: log_file
script:
def moduleBasename = diseaseName.toLowerCase().replaceAll(' ', '_')
def genderArg = params.gender < 0.5 ? "-g M" : (params.gender > 0.5 ? "-g F" : "")
def seedArg = params.seed ? "-s ${params.seed}" : ""
"""
set +e
WORKDIR=\$(pwd)
# Use pre-built jar directly (bypasses Gradle which needs write access to .gradle)
# Run Synthea via pre-built jar (Gradle is not writable in K8s)
cd /app
java -jar /app/build/libs/synthea-with-dependencies.jar \
-p ${params.population} \
@@ -49,18 +45,13 @@ process generatePatients {
${seedArg} 2>&1 | tee \${WORKDIR}/run.log
JAVA_EXIT=\${PIPESTATUS[0]}
# Collect FHIR output back into Nextflow work dir
cd \${WORKDIR}
mkdir -p fhir
if [ -d /app/output/fhir ]; then
cp /app/output/fhir/*.json fhir/ 2>/dev/null || true
FHIR_COUNT=\$(ls fhir/*.json 2>/dev/null | wc -l)
echo "Copied \${FHIR_COUNT} FHIR bundles" | tee -a run.log
else
echo "Warning: No FHIR output directory found" | tee -a run.log
fi
# Exit 0 if we got FHIR output, regardless of java exit code
# Succeed if FHIR output was produced
if [ -n "\$(ls fhir/*.json 2>/dev/null)" ]; then
exit 0
else
@@ -69,7 +60,6 @@ process generatePatients {
"""
}
// Workflow
workflow {
generatePatients(params.disease_name)
}