Skip to content

Commit

Permalink
improve snp text and ploidy bounds
Browse files Browse the repository at this point in the history
improve snp text
  • Loading branch information
pdimens authored Sep 30, 2024
2 parents 0a9783a + e0590d0 commit 33d155c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion harpy/bin/check_fastq.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
haplotag = re.compile('A[0-9][0-9]C[0-9][0-9]B[0-9][0-9]D[0-9][0-9]')
bxlast = re.compile('BX:Z:A[0-9][0-9]C[0-9][0-9]B[0-9][0-9]D[0-9][0-9]$')

with pysam.FastxFile(fq_in) as fh:
with pysam.FastxFile(fq_in, persist=False) as fh:
N_READS = 0
NO_BX = 0
BAD_BX = 0
Expand Down
11 changes: 4 additions & 7 deletions harpy/snp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ def snp():
"""
Call SNPs and small indels on alignments
**Variant Callers**
- `mpileup`: call variants using bcftools mpileup
- `freebayes`: call variants using freebayes
Provide an additional subcommand `mpileup` or `freebayes` to get more information on using
those variant callers. They are both robust variant callers and neither is recommended over the other.
those variant callers. They are both robust variant callers, but `freebayes` is recommended when ploidy
is greater than **2**.
"""

docstring = {
Expand Down Expand Up @@ -52,7 +49,7 @@ def snp():
@click.option('-x', '--extra-params', type = str, help = 'Additional variant caller parameters, in quotes')
@click.option('-g', '--genome', type=click.Path(exists=True, dir_okay=False, readable=True), required = True, help = 'Genome assembly for variant calling')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "SNP/mpileup", show_default=True, help = 'Output directory name')
@click.option('-n', '--ploidy', default = 2, show_default = True, type=int, help = 'Ploidy of samples')
@click.option('-n', '--ploidy', default = 2, show_default = True, type=click.IntRange(min = 1, max = 2), help = 'Ploidy of samples')
@click.option('-p', '--populations', type=click.Path(exists = True, dir_okay=False, readable=True), help = "Tab-delimited file of sample\<tab\>population")
@click.option('-r', '--regions', type=str, default=50000, show_default=True, help = "Regions where to call variants")
@click.option('-t', '--threads', default = 4, show_default = True, type = click.IntRange(min = 4, max_open = True), help = 'Number of threads to use')
Expand Down Expand Up @@ -156,7 +153,7 @@ def mpileup(inputs, output_dir, regions, genome, threads, populations, ploidy, e
@click.option('-x', '--extra-params', type = str, help = 'Additional variant caller parameters, in quotes')
@click.option('-g', '--genome', type=click.Path(exists=True, dir_okay=False, readable=True), required = True, help = 'Genome assembly for variant calling')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "SNP/freebayes", show_default=True, help = 'Output directory name')
@click.option('-n', '--ploidy', default = 2, show_default = True, type=int, help = 'Ploidy of samples')
@click.option('-n', '--ploidy', default = 2, show_default = True, type=click.IntRange(min=1, max_open=True), help = 'Ploidy of samples')
@click.option('-p', '--populations', type=click.Path(exists = True, dir_okay=False, readable=True), help = "Tab-delimited file of sample\<tab\>population")
@click.option('-r', '--regions', type=str, default=50000, show_default=True, help = "Regions where to call variants")
@click.option('-t', '--threads', default = 4, show_default = True, type = click.IntRange(min = 4, max_open = True), help = 'Number of threads to use')
Expand Down

0 comments on commit 33d155c

Please sign in to comment.