Skip to content

Commit

Permalink
Merge pull request #79 from sbslee/0.20.0-dev
Browse files Browse the repository at this point in the history
0.20.0 dev
  • Loading branch information
sbslee committed Jan 11, 2023
2 parents de490dd + 66c73e6 commit decb65a
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
@@ -1,6 +1,12 @@
Changelog
*********

0.20.0 (2023-01-12)
-------------------

* :issue:`73`: Fix bug in :command:`run-ngs-pipeline` command where empty VCF (i.e. no variants were found in the target gene) was causing error when plotting allele fraction. From now on, a warning will be produced telling users to specify ``--do-not-plot-allele-fraction`` to suppress this warning.
* :issue:`78`: Fix bug in :command:`compute-copy-number` command where it threw an error "Different sample sets found" when the sample name consists of only numbers.

0.19.0 (2022-09-13)
-------------------

Expand Down
3 changes: 0 additions & 3 deletions README.rst
Expand Up @@ -20,9 +20,6 @@ README
.. image:: https://anaconda.org/bioconda/pypgx/badges/downloads.svg
:target: https://anaconda.org/bioconda/pypgx/files

.. image:: https://anaconda.org/bioconda/pypgx/badges/installer/conda.svg
:target: https://conda.anaconda.org/bioconda

Introduction
============

Expand Down
4 changes: 2 additions & 2 deletions docs/cli.rst
Expand Up @@ -940,15 +940,15 @@ run-ngs-pipeline
CYP2D6 \
CYP2D6-pipeline \
--variants variants.vcf.gz \
--depth-of-coverage depth-of-coverage.tsv \
--depth-of-coverage depth-of-coverage.zip \
--control-statistics control-statistics-VDR.zip
[Example] To genotype the CYP2D6 gene from targeted sequencing data:
$ pypgx run-ngs-pipeline \
CYP2D6 \
CYP2D6-pipeline \
--variants variants.vcf.gz \
--depth-of-coverage depth-of-coverage.tsv \
--depth-of-coverage depth-of-coverage.zip \
--control-statistics control-statistics-VDR.zip \
--platform Targeted
Expand Down
3 changes: 0 additions & 3 deletions docs/create.py
Expand Up @@ -47,9 +47,6 @@
.. image:: https://anaconda.org/bioconda/pypgx/badges/downloads.svg
:target: https://anaconda.org/bioconda/pypgx/files
.. image:: https://anaconda.org/bioconda/pypgx/badges/installer/conda.svg
:target: https://conda.anaconda.org/bioconda
Introduction
============
Expand Down
17 changes: 13 additions & 4 deletions pypgx/api/pipeline.py
Expand Up @@ -248,10 +248,19 @@ def run_ngs_pipeline(
alleles.to_file(f'{output}/alleles.zip')

if not do_not_plot_allele_fraction:
os.mkdir(f'{output}/allele-fraction-profile')
plot.plot_vcf_allele_fraction(
imported_variants, path=f'{output}/allele-fraction-profile'
)
if imported_variants.data.empty:
message = (
"Cannot plot allele fraction because input VCF is empty. "
"Use '--do-not-plot-allele-fraction' to suppress this "
"warning."
)
warnings.warn(message)
else:
os.mkdir(f'{output}/allele-fraction-profile')
plot.plot_vcf_allele_fraction(
imported_variants,
path=f'{output}/allele-fraction-profile'
)

if large_var and depth_of_coverage is not None:
if isinstance(depth_of_coverage, str):
Expand Down
4 changes: 2 additions & 2 deletions pypgx/cli/run_ngs_pipeline.py
Expand Up @@ -25,15 +25,15 @@
CYP2D6 \\
CYP2D6-pipeline \\
--variants variants.vcf.gz \\
--depth-of-coverage depth-of-coverage.tsv \\
--depth-of-coverage depth-of-coverage.zip \\
--control-statistics control-statistics-VDR.zip
[Example] To genotype the CYP2D6 gene from targeted sequencing data:
$ pypgx {fuc.api.common._script_name()} \\
CYP2D6 \\
CYP2D6-pipeline \\
--variants variants.vcf.gz \\
--depth-of-coverage depth-of-coverage.tsv \\
--depth-of-coverage depth-of-coverage.zip \\
--control-statistics control-statistics-VDR.zip \\
--platform Targeted
"""
Expand Down
1 change: 1 addition & 0 deletions pypgx/sdk/utils.py
Expand Up @@ -118,6 +118,7 @@ def from_file(cls, fn):
elif 'SampleTable' in metadata['SemanticType']:
with zf.open(f'{parent}/data.tsv') as fh:
data = pd.read_table(fh, index_col=0)
data.index = data.index.astype(str)
elif 'VcfFrame' in metadata['SemanticType']:
with zf.open(f'{parent}/data.vcf') as fh:
data = pyvcf.VcfFrame.from_file(fh)
Expand Down
2 changes: 1 addition & 1 deletion pypgx/version.py
@@ -1 +1 @@
__version__ = '0.19.0'
__version__ = '0.20.0'

0 comments on commit decb65a

Please sign in to comment.