Skip to content

Commit

Permalink
add --efo_id parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
nebfield committed Jul 31, 2024
1 parent a2dc50a commit cc11c8a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ params {
scorefile = null
pgs_id = null
trait_efo = null
efo_id = null // synonym for trait_efo, which is deprecated
pgp_id = null
efo_direct = false

Expand Down
6 changes: 5 additions & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@
"description": "A comma separated list of PGS Catalog publications, e.g. PGP000001",
"pattern": "PGP[0-9]{6}"
},
"trait_efo": {
"efo_id": {
"type": "string",
"description": "A comma separated list of PGS Catalog EFO traits, e.g. EFO_0004214"
},
"trait_efo": {
"type": "string",
"description": "DEPRECATED: A comma separated list of PGS Catalog EFO traits, e.g. EFO_0004214"
},
"efo_direct": {
"type": "boolean",
"description": "Return only PGS tagged with exact EFO term (e.g. no PGS for child/descendant terms in the ontology)"
Expand Down
11 changes: 10 additions & 1 deletion workflows/pgsc_calc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,16 @@ workflow PGSCCALC {
// make sure accessions look sensible before querying PGS Catalog
def pgs_id = WorkflowPgscCalc.prepareAccessions(params.pgs_id, "pgs_id")
def pgp_id = WorkflowPgscCalc.prepareAccessions(params.pgp_id, "pgp_id")
def trait_efo = WorkflowPgscCalc.prepareAccessions(params.trait_efo, "trait_efo")

// temporarily handle parameter synonym (--trait_efo -> --efo_id)
def traits = [params.trait_efo, params.efo_id].findAll { it != null }.join(",")

if (params.trait_efo) {
println "WARNING: --trait_efo is deprecated and will be removed in a future release, please use --efo_id"
}

def trait_efo = WorkflowPgscCalc.prepareAccessions(traits, "trait_efo")

def accessions = pgs_id + pgp_id + trait_efo

if (!accessions.every { it.value == "" }) {
Expand Down

0 comments on commit cc11c8a

Please sign in to comment.