Skip to content

Commit decb65a

Browse files
authored
Merge pull request #79 from sbslee/0.20.0-dev
0.20.0 dev
2 parents de490dd + 66c73e6 commit decb65a

File tree

8 files changed

+25
-15
lines changed

8 files changed

+25
-15
lines changed

CHANGELOG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
*********
33

4+
0.20.0 (2023-01-12)
5+
-------------------
6+
7+
* :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.
8+
* :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.
9+
410
0.19.0 (2022-09-13)
511
-------------------
612

README.rst

-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ README
2020
.. image:: https://anaconda.org/bioconda/pypgx/badges/downloads.svg
2121
:target: https://anaconda.org/bioconda/pypgx/files
2222

23-
.. image:: https://anaconda.org/bioconda/pypgx/badges/installer/conda.svg
24-
:target: https://conda.anaconda.org/bioconda
25-
2623
Introduction
2724
============
2825

docs/cli.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -940,15 +940,15 @@ run-ngs-pipeline
940940
CYP2D6 \
941941
CYP2D6-pipeline \
942942
--variants variants.vcf.gz \
943-
--depth-of-coverage depth-of-coverage.tsv \
943+
--depth-of-coverage depth-of-coverage.zip \
944944
--control-statistics control-statistics-VDR.zip
945945
946946
[Example] To genotype the CYP2D6 gene from targeted sequencing data:
947947
$ pypgx run-ngs-pipeline \
948948
CYP2D6 \
949949
CYP2D6-pipeline \
950950
--variants variants.vcf.gz \
951-
--depth-of-coverage depth-of-coverage.tsv \
951+
--depth-of-coverage depth-of-coverage.zip \
952952
--control-statistics control-statistics-VDR.zip \
953953
--platform Targeted
954954

docs/create.py

-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
.. image:: https://anaconda.org/bioconda/pypgx/badges/downloads.svg
4848
:target: https://anaconda.org/bioconda/pypgx/files
4949
50-
.. image:: https://anaconda.org/bioconda/pypgx/badges/installer/conda.svg
51-
:target: https://conda.anaconda.org/bioconda
52-
5350
Introduction
5451
============
5552

pypgx/api/pipeline.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,19 @@ def run_ngs_pipeline(
248248
alleles.to_file(f'{output}/alleles.zip')
249249

250250
if not do_not_plot_allele_fraction:
251-
os.mkdir(f'{output}/allele-fraction-profile')
252-
plot.plot_vcf_allele_fraction(
253-
imported_variants, path=f'{output}/allele-fraction-profile'
254-
)
251+
if imported_variants.data.empty:
252+
message = (
253+
"Cannot plot allele fraction because input VCF is empty. "
254+
"Use '--do-not-plot-allele-fraction' to suppress this "
255+
"warning."
256+
)
257+
warnings.warn(message)
258+
else:
259+
os.mkdir(f'{output}/allele-fraction-profile')
260+
plot.plot_vcf_allele_fraction(
261+
imported_variants,
262+
path=f'{output}/allele-fraction-profile'
263+
)
255264

256265
if large_var and depth_of_coverage is not None:
257266
if isinstance(depth_of_coverage, str):

pypgx/cli/run_ngs_pipeline.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
CYP2D6 \\
2626
CYP2D6-pipeline \\
2727
--variants variants.vcf.gz \\
28-
--depth-of-coverage depth-of-coverage.tsv \\
28+
--depth-of-coverage depth-of-coverage.zip \\
2929
--control-statistics control-statistics-VDR.zip
3030
3131
[Example] To genotype the CYP2D6 gene from targeted sequencing data:
3232
$ pypgx {fuc.api.common._script_name()} \\
3333
CYP2D6 \\
3434
CYP2D6-pipeline \\
3535
--variants variants.vcf.gz \\
36-
--depth-of-coverage depth-of-coverage.tsv \\
36+
--depth-of-coverage depth-of-coverage.zip \\
3737
--control-statistics control-statistics-VDR.zip \\
3838
--platform Targeted
3939
"""

pypgx/sdk/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def from_file(cls, fn):
118118
elif 'SampleTable' in metadata['SemanticType']:
119119
with zf.open(f'{parent}/data.tsv') as fh:
120120
data = pd.read_table(fh, index_col=0)
121+
data.index = data.index.astype(str)
121122
elif 'VcfFrame' in metadata['SemanticType']:
122123
with zf.open(f'{parent}/data.vcf') as fh:
123124
data = pyvcf.VcfFrame.from_file(fh)

pypgx/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.19.0'
1+
__version__ = '0.20.0'

0 commit comments

Comments
 (0)