Skip to content

Commit 3e617bb

Browse files
Merge pull request #44 from jeromekelleher/fix-indexing-issues
Fix indexing issues
2 parents 3fe6a3a + 4f532ee commit 3e617bb

37 files changed

+896
-869
lines changed

bio2zarr/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def bio2zarr():
1414
# up in the right way.
1515
bio2zarr.add_command(cli.vcf2zarr)
1616
bio2zarr.add_command(cli.plink2zarr)
17+
bio2zarr.add_command(cli.vcf_partition)
1718

1819
if __name__ == "__main__":
1920
bio2zarr()

bio2zarr/cli.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import coloredlogs
44

55
from . import vcf
6+
from . import vcf_utils
67
from . import plink
78
from . import provenance
89

@@ -15,6 +16,7 @@
1516

1617
version = click.version_option(version=provenance.__version__)
1718

19+
1820
# Note: logging hasn't been implemented in the code at all, this is just
1921
# a first pass to try out some ways of doing things to see what works.
2022
def setup_logging(verbosity):
@@ -155,3 +157,15 @@ def plink2zarr():
155157

156158

157159
plink2zarr.add_command(convert_plink)
160+
161+
162+
@click.command
163+
@version
164+
@click.argument("vcf_path", type=click.Path())
165+
@click.option("-i", "--index", type=click.Path(), default=None)
166+
@click.option("-n", "--num-parts", type=int, default=None)
167+
# @click.option("-s", "--part-size", type=int, default=None)
168+
def vcf_partition(vcf_path, index, num_parts):
169+
indexed_vcf = vcf_utils.IndexedVcf(vcf_path, index)
170+
regions = indexed_vcf.partition_into_regions(num_parts=num_parts)
171+
click.echo("\n".join(map(str, regions)))

bio2zarr/csi.py

Lines changed: 0 additions & 150 deletions
This file was deleted.

bio2zarr/tbi.py

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)