Skip to content

Commit 00c2dfd

Browse files
committed
fix: Use Path rather than str for file path
1 parent 218aa4f commit 00c2dfd

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ A command-line tool for genomic-wide association studies (GWAS) data validation
44

55
## Features
66

7-
- Validate:
8-
- Input: GWAS Submission template that contains top associations
7+
- Validate:
8+
- Input: File path of GWAS Submission template that contains top associations
99
- Output: Validation report of top associations
1010

1111
## Installation
@@ -102,4 +102,3 @@ poetry run pre-commit run --all-files
102102
## License
103103

104104
[License](LICENSE)
105-

src/gwas_assoc/cli.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def cli() -> None:
3333

3434

3535
@cli.command()
36-
@click.argument("file", type=click.Path(exists=True))
37-
def validate(file: str) -> None:
36+
@click.argument("_file", type=click.Path(exists=True))
37+
def validate(_file: str) -> None:
3838
"""Validate SNPs in an Excel file."""
39-
file_path = Path(file)
39+
file_path = Path(_file)
4040

4141
console.print(f"Starting validation of [bold]{file_path}[/]")
4242

@@ -50,7 +50,7 @@ def validate(file: str) -> None:
5050

5151
try:
5252
validator = SnpValidator()
53-
result = validator.validate_snps(file)
53+
result = validator.validate_snps(file_path)
5454
progress.update(task, completed=True)
5555
except Exception as e:
5656
progress.update(

src/gwas_assoc/commands/validate.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self) -> None:
2929
"""
3030
self.ensembl_api_url = "https://rest.ensembl.org/variation/human/"
3131

32-
def _get_study_tags(self, file_path: str) -> Set:
32+
def _get_study_tags(self, file_path: Path) -> Set:
3333
# Read study sheet to get study tags
3434
console.print("[info]Reading study tags...[/]")
3535
try:
@@ -44,7 +44,7 @@ def _get_study_tags(self, file_path: str) -> Set:
4444
print_error(f"Error reading study sheet: {str(e)}")
4545
return set()
4646

47-
def _get_schema_version(self, file_path: str) -> str:
47+
def _get_schema_version(self, file_path: Path) -> str:
4848
"""Get the schema version from the meta sheet of the Excel file"""
4949
console.print("[info]Reading schema version...[/]")
5050
meta_df = pd.read_excel(file_path, sheet_name="meta")
@@ -224,7 +224,7 @@ def _validate_associations_against_template(
224224
pd.DataFrame(invalid_rows) if invalid_rows else pd.DataFrame()
225225
)
226226

227-
def validate_snps(self, file_path: str) -> bool:
227+
def validate_snps(self, file_path: Path) -> bool:
228228
"""
229229
Validate SNPs from an Excel file
230230

0 commit comments

Comments
 (0)