Skip to content

Commit

Permalink
Harmonise CLI argument names
Browse files Browse the repository at this point in the history
  • Loading branch information
MattWellie committed Oct 21, 2024
1 parent fac8b3f commit eae1e36
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions src/talos/CPG/MakePhenopackets.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ def main(output: str, dataset: str, seq_type: str, tech: str = 'short-read', hpo

def cli_main():
parser = ArgumentParser(description='Generate a PED file for Talos')
parser.add_argument('dataset', help='The dataset to query for')
parser.add_argument('output', help='The output file')
parser.add_argument('type', help='Sequencing type (exome or genome)')
parser.add_argument('--dataset', help='The dataset to query for')
parser.add_argument('--output', help='The output file')
parser.add_argument('--type', help='Sequencing type (exome or genome)')
parser.add_argument('--hpo', help='HPO ontology file')
parser.add_argument('--tech', help='Sequencing technology', default='short-read')
args = parser.parse_args()
Expand Down
4 changes: 2 additions & 2 deletions src/talos/CPG/convert_ePED_to_phenopackets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

def cli_main():
parser = ArgumentParser()
parser.add_argument('ped_file', help='path to the extended PED file')
parser.add_argument('output', help='stem path to write phenopacket and new PED file')
parser.add_argument('--input', help='path to the extended PED file')
parser.add_argument('--output', help='stem path to write phenopacket and new PED file')
args = parser.parse_args()
main(args.ped_file, args.output)

Expand Down
4 changes: 2 additions & 2 deletions src/talos/CreateTalosHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
def cli_main():
get_logger(__file__).info('Running HTML builder')
parser = ArgumentParser()
parser.add_argument('--results', help='Path to analysis results', required=True)
parser.add_argument('--input', help='Path to analysis results', required=True)
parser.add_argument('--panelapp', help='PanelApp data', required=True)
parser.add_argument('--output', help='Final HTML filename', required=True)
parser.add_argument('--latest', help='Optional second report, latest variants only')
parser.add_argument('--split_samples', help='divides samples into sub-reports', type=int)
args = parser.parse_args()
main(args.results, args.panelapp, args.output, args.latest, args.split_samples)
main(args.input, args.panelapp, args.output, args.latest, args.split_samples)


def main(results: str, panelapp: str, output: str, latest: str | None = None, split_samples: int | None = None):
Expand Down
2 changes: 1 addition & 1 deletion src/talos/FindGeneSymbolMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def match_symbol_to_ensg(gene_symbol: str, session: ClientSession) -> tupl
def cli_main():
parser = ArgumentParser()
parser.add_argument('--panelapp', help='Path to the PanelApp results file', required=True)
parser.add_argument('--out_path', help='where to write the output (.json)', required=True)
parser.add_argument('--output', help='where to write the output (.json)', required=True)
args = parser.parse_args()

main(args.panelapp, out_path=args.out_path)
Expand Down
6 changes: 3 additions & 3 deletions src/talos/GeneratePanelData.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ def match_participants_to_panels(participant_hpos: PhenotypeMatchedPanels, hpo_p
def cli_main():
get_logger(__file__).info('Starting HPO~Panel matching')
parser = ArgumentParser()
parser.add_argument('cohort_file', help='GA4GH Cohort/PhenoPacket File')
parser.add_argument('output', help='Path to write PhenotypeMatchedPanels to (JSON)')
parser.add_argument('--input', help='GA4GH Cohort/PhenoPacket File')
parser.add_argument('--output', help='Path to write PhenotypeMatchedPanels to (JSON)')
parser.add_argument('--hpo', help='Local copy of HPO obo file', required=True)
args = parser.parse_args()
main(ga4gh_cohort_file=args.cohort_file, panel_out=args.output, hpo_file=args.hpo)
main(ga4gh_cohort_file=args.input, panel_out=args.output, hpo_file=args.hpo)


def main(ga4gh_cohort_file: str, panel_out: str, hpo_file: str):
Expand Down
8 changes: 4 additions & 4 deletions src/talos/HPOFlagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,19 @@ def filter_and_write_out(annotated_results: ResultData, out_path: str):

def cli_main():
parser = ArgumentParser(description='')
parser.add_argument('--results', help='The Result data in JSON form')
parser.add_argument('--input', help='The Result data in JSON form')
parser.add_argument('--gene_map', help='A map of gene symbol to ENSG for all genes in this analysis')
parser.add_argument('--gen2phen', help='path to the genotype-phenotype file')
parser.add_argument('--phenio', help='A phenio DB file')
parser.add_argument('--out', help='Annotated full output')
parser.add_argument('--output', help='Annotated full output')
parser.add_argument('--phenout', help='Annotated phenotype-only output')
args = parser.parse_args()
main(
result_file=args.results,
result_file=args.input,
gene_map=args.gene_map,
gen2phen=args.gen2phen,
phenio=args.phenio,
out_path=args.out,
out_path=args.output,
phenout=args.phenout,
)

Expand Down
4 changes: 2 additions & 2 deletions src/talos/MatchGenesToPhenotypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ def cli_main():
parser = ArgumentParser()
parser.add_argument('--g2p', help='path to the genotype-phenotype file', required=True)
parser.add_argument('--gs2id', help='path to JSON with gene symbol to Ensembl gene ID', required=True)
parser.add_argument('--panels', help='path to the participant-HPO-panels file', required=True)
parser.add_argument('--input', help='path to GeneratePanelData output', required=True)
parser.add_argument('--phenio', help='path to the phenio db file', required=True)
parser.add_argument('--output', help='where to write the output (.json)', required=True)
args = parser.parse_args()
main(gen2phen_path=args.g2p, gs2id=args.gs2id, panels_path=args.panels, phenio_db=args.phenio, out_path=args.output)
main(gen2phen_path=args.g2p, gs2id=args.gs2id, panels_path=args.input, phenio_db=args.phenio, out_path=args.output)


def main(gen2phen_path: str, gs2id: str, panels_path: str, phenio_db: str, out_path: str, min_similarity: float = 14.0):
Expand Down
12 changes: 6 additions & 6 deletions src/talos/MinimiseOutputForSeqr.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

def cli_main():
parser = ArgumentParser()
parser.add_argument('input_file', help='the input file to process')
parser.add_argument('output_file', help='the output file to write to')
parser.add_argument('pheno_file', help='the output file for phenotype-matched data', default=None)
parser.add_argument('--input', help='the input file to process')
parser.add_argument('--output', help='the output file to write to')
parser.add_argument('--pheno', help='the output file for phenotype-matched data', default=None)
parser.add_argument('--external_map', help='mapping of internal to external IDs for seqr', default=None)
args = parser.parse_args()

main(input_file=args.input_file, output=args.output_file, ext_map=args.external_map)
if args.pheno_file:
main(input_file=args.input_file, output=args.pheno_file, ext_map=args.external_map, pheno_match=True)
main(input_file=args.input, output=args.output, ext_map=args.external_map)
if args.pheno:
main(input_file=args.input, output=args.pheno, ext_map=args.external_map, pheno_match=True)


def main(input_file: str, output: str, ext_map: str | None = None, pheno_match: bool = False):
Expand Down
4 changes: 2 additions & 2 deletions src/talos/QueryPanelapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ def get_best_moi(gene_dict: dict):
def cli_main():
parser = ArgumentParser()
parser.add_argument('--panels', help='JSON of per-participant panels', default=None)
parser.add_argument('--out_path', required=True, help='destination for results')
parser.add_argument('--output', required=True, help='destination for results')
args = parser.parse_args()
main(panels=args.panels, out_path=args.out_path)
main(panels=args.panels, out_path=args.output)


def main(panels: str | None, out_path: str):
Expand Down
4 changes: 2 additions & 2 deletions src/talos/RunHailFiltering.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def cli_main():
parser.add_argument('--mt', required=True, help='path to input MT')
parser.add_argument('--panelapp', required=True, help='panelapp JSON')
parser.add_argument('--pedigree', required=True, help='Cohort Pedigree')
parser.add_argument('--vcf_out', help='Where to write the VCF', required=True)
parser.add_argument('--output', help='Where to write the VCF', required=True)
parser.add_argument('--clinvar', help='HT containing ClinvArbitration annotations', required=True)
parser.add_argument('--pm5', help='HT containing clinvar PM5 annotations, optional', default=None)
parser.add_argument('--checkpoint', help='Where/whether to checkpoint, String path', default=None)
Expand All @@ -795,7 +795,7 @@ def cli_main():
mt_path=args.mt,
panel_data=args.panelapp,
pedigree=args.pedigree,
vcf_out=args.vcf_out,
vcf_out=args.output,
clinvar=args.clinvar,
pm5=args.pm5,
checkpoint=args.checkpoint,
Expand Down
4 changes: 2 additions & 2 deletions src/talos/RunHailFilteringSV.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ def cli_main():
parser.add_argument('--mt', required=True, help='path to input MT')
parser.add_argument('--panelapp', type=str, required=True, help='panelapp JSON')
parser.add_argument('--pedigree', type=str, required=True, help='Cohort Pedigree')
parser.add_argument('--vcf_out', help='Where to write the VCF', required=True)
parser.add_argument('--output', help='Where to write the VCF', required=True)
args = parser.parse_args()
main(mt_path=args.mt, panelapp_path=args.panelapp, pedigree=args.pedigree, vcf_out=args.vcf_out)
main(mt_path=args.mt, panelapp_path=args.panelapp, pedigree=args.pedigree, vcf_out=args.output)


def main(mt_path: str, panelapp_path: str, pedigree: str, vcf_out: str):
Expand Down
4 changes: 2 additions & 2 deletions src/talos/ValidateMOI.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,15 @@ def cli_main():
parser = ArgumentParser(description='Startup commands for the MOI testing phase of Talos')
parser.add_argument('--labelled_vcf', help='Category-labelled VCF')
parser.add_argument('--labelled_sv', help='Category-labelled SV VCF', default=[], nargs='+')
parser.add_argument('--out_json', help='Prefix to write JSON results to', required=True)
parser.add_argument('--output', help='Prefix to write JSON results to', required=True)
parser.add_argument('--panelapp', help='Path to JSON file of PanelApp data', required=True)
parser.add_argument('--pedigree', help='Path to joint-call PED file', required=True)
parser.add_argument('--participant_panels', help='panels per participant', default=None)
args = parser.parse_args()

main(
labelled_vcf=args.labelled_vcf,
out_json=args.out_json,
out_json=args.output,
panelapp=args.panelapp,
pedigree=args.pedigree,
labelled_sv=args.labelled_sv,
Expand Down
6 changes: 3 additions & 3 deletions src/talos/VcfToMt.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,14 @@ def cli_main():
"""

parser = ArgumentParser(description='Takes a VEP annotated VCF and makes it a MT')
parser.add_argument('vcf', help='Path to the annotated VCF')
parser.add_argument('output', help='output MatrixTable path')
parser.add_argument('--input', help='Path to the annotated VCF')
parser.add_argument('--output', help='output MatrixTable path')
parser.add_argument('--am', help='Hail Table containing AlphaMissense annotations', default=None)
args, unknown = parser.parse_known_args()
if unknown:
raise ValueError(f'Whats the deal with {unknown}?')

main(vcf_path=args.vcf, output_path=args.output, alpha_m=args.am)
main(vcf_path=args.input, output_path=args.output, alpha_m=args.am)


def main(vcf_path: str, output_path: str, alpha_m: str | None = None):
Expand Down

0 comments on commit eae1e36

Please sign in to comment.