Skip to content

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dnaprs

nf-test status nf-core linting status Nextflow nf-core template version nf-test MIT licence

Introduction

dnaprs is a portable Nextflow DSL2 pipeline for generating and evaluating polygenic risk scores from raw target genotypes and raw GWAS summary statistics.

The pipeline discovers PGEN, BED, PED/MAP, BGEN, VCF/BCF, or GenomeStudio FinalReport inputs; records raw genotype EDA; resolves markers against pinned GRCh37 references; applies two target-QC checkpoints; and projects participants onto unrelated 1000 Genomes reference PCA axes. It can impute with Beagle, generate PLINK C+T and/or SBayesRC scores, apply participant eligibility consistently, and fit one or many declared phenotype models.

dnaprs workflow metro map showing raw inputs, target QC, reference handling, PLINK C+T, SBayesRC, phenotype models, and reporting

The workflow publishes one run under dnaprs/model1/ by default:

  • data/ — generated records, checkpoints, QC, weights, scores, and model tables;
  • figures/ — a convenient copy of every report figure;
  • logs/ — scientific and execution logs;
  • reports/ — the portable HTML website, downloads, and provenance.

Minimal run

Install Java 17 or newer, Nextflow 25.10.4 or newer, and Docker, Apptainer, or Singularity. With one raw target dataset in data/plink/raw/ and raw GWAS files in data/gwas/raw/:

nextflow run . -profile singularity -resume

The defaults are equivalent to:

nextflow run . \
  -profile singularity \
  --input data/plink/raw \
  --gwas data/gwas/raw \
  --outdir dnaprs \
  --run_name model1 \
  -resume

Add one phenotype model from a phenotype table:

nextflow run . \
  -profile singularity \
  --input data/plink/raw \
  --gwas data/gwas/raw \
  --phenotype data/pheno/pheno.csv \
  --outcome depression_score \
  --covariates age,sex \
  --model_type gaussian \
  -resume

depression_score, age, and sex are examples, not built-in names. If the participant-ID column cannot be matched uniquely to target IDs, also supply --participant_id <column>. Without phenotype parameters, PRS generation and the genetic report still complete.

Repeated phenotype rows are supported through an explicit timepoint selection in params.yml, such as timepoint_column: Timepoint and timepoint_values: [1]. The input rows remain unchanged; the model uses one agreeing record per participant at the requested value. Analysis values may differ between visits.

References

--reference_mode auto is the default. The pipeline downloads only the required assets from a pinned catalogue, requires and verifies SHA-256 plus size for every asset, and reuses each valid asset from references/dnaprs/grch37-v1/. Beagle and unbref3 are handled in the same way.

To use an existing reference collection:

nextflow run . \
  -profile singularity \
  --references /path/to/rData \
  --reference_mode local \
  -resume

To build or verify only the reusable reference cache, set reference_only: true in a small YAML parameter file and run with -params-file.

Configured and HPC runs

--input and --gwas each accept either a conventional raw-data directory or a YAML list of explicit records. The pipeline resolves both forms into validated TSV records for internal hand-off and provenance. A GenomeStudio assay manifest is an input file paired with a FinalReport and is distinct from these generated records. Paths, GWAS column roles, thresholds, selected methods, and multiple phenotype models can all be declared in YAML. See the complete usage guide and examples/params.yml.

Processes use standard nf-core-style resource labels and pass task.cpus and bounded task memory to capable tools. Nextflow handles cohort, chromosome-imputation, trait, method, reference, and model tasks concurrently, then validates deterministic gathers. Scheduler, queue, project, and filesystem settings remain outside the pipeline, so the same workflow runs locally or through PBS Pro, Slurm, SGE, LSF, and other Nextflow executors. Site-specific launchers and module commands belong outside the portable pipeline repository.

SBayesRC is a high-memory, long-running method. Use --methods plink_ct for a smaller run; selecting fewer methods changes the selected analysis, not the executor.

Report and validation

Open dnaprs/model1/reports/index.html after completion. The report preserves every available plot and provides SVG plus high-resolution PNG, TIFF, and JPEG downloads. Its Logs page displays execution artifacts in expandable, scrollable panels. When imputation is enabled, the PLINK page also reports typed-versus-imputed scoring coverage and agreement between the primary imputed score and direct-genotype sensitivity score; sensitivity scores are not added to phenotype models.

Run the minimal real-tool pipeline test with Docker:

nf-test test tests/default.nf.test --profile +docker --ci

Run the full graph test explicitly in stub mode:

nf-test test tests/stub.nf.test --profile +test_full --ci

Run the focused early-stage and automatic-reference graph checks:

nf-test test tests/stages.nf.test tests/reference.nf.test --profile +docker --ci

These are software-contract tests, not biological or clinical validation. Phenotype associations are research estimates and do not make a PRS a clinical risk prediction.

Documentation

The code is released under the MIT licence. External tools, GWAS data, and reference resources retain their own licences and access conditions.

About

[Work in progress]

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages