Skip to content

Commit

Permalink
Merge pull request #47 from compneurobilbao/feature-selective-covar-c…
Browse files Browse the repository at this point in the history
…orrection

ENH: Feature selective covar correction
  • Loading branch information
JGarciaCondado authored Sep 23, 2024
2 parents b8785e6 + 480bcbc commit 8a05ad5
Show file tree
Hide file tree
Showing 4 changed files with 314 additions and 196 deletions.
24 changes: 18 additions & 6 deletions src/ageml/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,13 @@ def configure_parser(self):
help=messages.factors_long_description,
)

# Optional arguments
self.parser.add_argument("--covariates", metavar="FILE", help=messages.covar_long_description)
self.parser.add_argument("--clinical", metavar="FILE", help=messages.clinical_long_description)
self.parser.add_argument("--covariates", metavar="FILE", required=False,
help=messages.covar_long_description)
self.parser.add_argument("--clinical", metavar="FILE", required=False,
help=messages.clinical_long_description)
self.parser.add_argument("--covcorr_mode", metavar="MODE", required=False,
choices=["cn", "each", "all"],
help=messages.covcorr_mode_long_description)


class ClinicalGroups(Interface):
Expand Down Expand Up @@ -280,7 +284,11 @@ def configure_parser(self):
)

# Optional arguments
self.parser.add_argument("--covariates", metavar="FILE", help=messages.covar_long_description)
self.parser.add_argument("--covariates", metavar="FILE", required=False,
help=messages.covar_long_description)
self.parser.add_argument("--covcorr_mode", metavar="MODE", required=False,
choices=["cn", "each", "all"],
help=messages.covcorr_mode_long_description)


class ClinicalClassification(Interface):
Expand Down Expand Up @@ -364,8 +372,12 @@ def configure_parser(self):
)

# Optional arguments
self.parser.add_argument("--covariates", metavar="FILE", help=messages.covar_long_description)

self.parser.add_argument("--covariates", metavar="FILE", required=False,
help=messages.covar_long_description)
self.parser.add_argument("--covcorr_mode", metavar="MODE", required=False,
choices=["cn", "each", "all"],
help=messages.covcorr_mode_long_description)

def configure_args(self, args):
"""Configure argumens with required fromatting for modelling.
Expand Down
8 changes: 8 additions & 0 deletions src/ageml/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@
"https://github.com/compneurobilbao/ageml/blob/main/docs/input_file_specification.md#clinical-file"
)

covcorr_mode_long_description = (
"Mode for covariate correlation.\n"
"Must be one of 'cn', 'each', or 'all'. Default is 'cn'.\n"
"cn: Covariate correction is done using only the control group subjects.\n"
"all: Covariate correction is done using the whole dataset, all subjects.\n"
"each: Covariate correction is done for each clinical group subjects separately.\n"
)

systems_long_description = (
"Path to input .txt file containing the features to use to model each system. \n"
"Each new line corresponds to a different system. The parser follows a formatting \n"
Expand Down
Loading

0 comments on commit 8a05ad5

Please sign in to comment.