-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
181 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
"""Module contains csv2parquet subcommand entry point function.""" | ||
|
||
# std import | ||
from __future__ import annotations | ||
|
||
import logging | ||
import pathlib | ||
import sys | ||
|
||
# 3rd party import | ||
import click | ||
|
||
# project import | ||
from variantplaner import cli, exception, extract, io | ||
|
||
|
||
@cli.main.group("csv2parquet", chain=True) | ||
@click.pass_context | ||
@click.option( | ||
"-i", | ||
"--input-path", | ||
help="Path to vcf input file", | ||
type=click.Path(exists=True, dir_okay=False, readable=True, allow_dash=True, path_type=pathlib.Path), | ||
required=True, | ||
) | ||
@click.option( | ||
"-c", | ||
"--chrom2length-path", | ||
help="CSV file that associates a chromosome name with its size", | ||
type=click.Path(dir_okay=False, writable=True, path_type=pathlib.Path), | ||
) | ||
@click.option( | ||
"-a", | ||
"--append", | ||
help="Switch in append mode", | ||
type=bool, | ||
is_flag=True, | ||
) | ||
@click.option( | ||
"-C", | ||
"--chrom-col", | ||
type=str, | ||
default="chr", | ||
show_default=True, | ||
) | ||
@click.option( | ||
"-p",f | ||
"--position-col", | ||
type=str, | ||
default="pos", | ||
show_default=True, | ||
) | ||
@click.option( | ||
"-r", | ||
"--ref-col", | ||
type=str, | ||
default="ref", | ||
show_default=True, | ||
) | ||
@click.option( | ||
"-a", | ||
"--alt-col", | ||
type=str, | ||
default="alt", | ||
show_default=True, | ||
) | ||
@click.option( | ||
"-s", | ||
"--separator", | ||
type=str, | ||
default="," | ||
show_default=True, | ||
) | ||
def csv2parquet( | ||
ctx: click.Context, | ||
input_path: pathlib.Path, | ||
chrom2length_path: pathlib.Path, | ||
*, | ||
append: bool, | ||
chrom_col: str | None, | ||
pos_col: str | None, | ||
ref_col: str | None, | ||
alt_col: str | None, | ||
separator_col: str | None, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.