Skip to content

Commit 0c8c33a

Browse files
authored
Merge pull request #58 from sbslee/0.15.0-dev
0.15.0 dev
2 parents bbac2c7 + 83ef1fa commit 0c8c33a

20 files changed

Lines changed: 608 additions & 62 deletions

CHANGELOG.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
Changelog
22
*********
33

4+
0.15.0 (2022-05-03)
5+
-------------------
6+
7+
* Add new optional arguments ``--genes`` and ``--exclude`` to :command:`prepare-depth-of-coverage` command.
8+
* Add new command :command:`slice-bam`.
9+
* Add new command :command:`print-data`.
10+
* Fix typo "statistcs" to "statistics" throughout the package.
11+
* Update :meth:`sdk.utils.simulate_copy_number` method to automatically handle duplicate sample names.
12+
* Improve CNV caller for CYP2A6, CYP2B6, CYP2D6, CYP2E1, GSTM1, SLC22A2, SULT1A1, UGT1A4, UGT2B15, UGT2B17.
13+
* Add new CNV calls for CYP2A6: ``Deletion2Hom``, ``Hybrid5``, ``Hybrid6``, ``PseudogeneDeletion``.
14+
* Add new CNV call for CYP2D6: ``Tandem2F``.
15+
* Add new CNV call for GSTM1: ``Normal,Deletion2``.
16+
* Add new CNV call for SULT1A1: ``Unknown1``.
17+
* Add new CNV call for UGT2B17: ``Deletion,PartialDeletion3``.
18+
419
0.14.0 (2022-04-03)
520
-------------------
621

README.rst

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ currently defined semantic types:
357357
- ``SampleTable[Results]``
358358
* TSV file for storing various results for each sample.
359359
* Requires following metadata: ``Gene``, ``Assembly``, ``SemanticType``.
360-
- ``SampleTable[Statistcs]``
360+
- ``SampleTable[Statistics]``
361361
* TSV file for storing control gene's various statistics on read depth for each sample. Used for converting target gene's read depth to copy number.
362362
* Requires following metadata: ``Control``, ``Assembly``, ``SemanticType``, ``Platform``.
363363
- ``VcfFrame[Consolidated]``
@@ -370,11 +370,12 @@ currently defined semantic types:
370370
* VcfFrame for storing target gene's phased variant data.
371371
* Requires following metadata: ``Platform``, ``Gene``, ``Assembly``, ``SemanticType``, ``Program``.
372372

373-
Wroking with archive files
373+
Working with archive files
374374
--------------------------
375375

376376
To demonstrate how easy it is to work with PyPGx archive files, below we will
377-
show some examples. First, download an archive:
377+
show some examples. First, download an archive to play with, which has
378+
``SampleTable[Results]`` as semantic type:
378379

379380
.. code-block:: text
380381
@@ -389,6 +390,14 @@ Let's print its metadata:
389390
Assembly=GRCh37
390391
SemanticType=SampleTable[Results]
391392
393+
Now print its main data (but display first sample only):
394+
395+
.. code-block:: text
396+
397+
$ pypgx print-data grch37-CYP2D6-results.zip | head -n 2
398+
Genotype Phenotype Haplotype1 Haplotype2 AlternativePhase VariantData CNV
399+
HG00276_PyPGx *4/*5 Poor Metabolizer *4;*10;*74;*2; *10;*74;*2; ; *4:22-42524947-C-T:0.913;*10:22-42526694-G-A,22-42523943-A-G:1.0,1.0;*74:22-42525821-G-T:1.0;*2:default; DeletionHet
400+
392401
We can unzip it to extract files inside (note that ``tmpcty4c_cr`` is the
393402
original folder name):
394403

@@ -500,7 +509,7 @@ input data is from whole genome sequencing (WGS) or targeted sequencing
500509
This pipeline supports SV detection based on copy number analysis for genes
501510
that are known to have SV. Therefore, if the target gene is associated with
502511
SV (e.g. CYP2D6) it's strongly recommended to provide a
503-
``CovFrame[DepthOfCoverage]`` file and a ``SampleTable[Statistcs]`` file in
512+
``CovFrame[DepthOfCoverage]`` file and a ``SampleTable[Statistics]`` file in
504513
addtion to a VCF file containing SNVs/indels. If the target gene is not
505514
associated with SV (e.g. CYP3A5) providing a VCF file alone is enough. You can
506515
visit the `Genes <https://pypgx.readthedocs.io/en/latest/genes.html>`__ page
@@ -515,6 +524,9 @@ HaplotypeCaller). See the `Variant caller choice <https://pypgx.readthedocs.
515524
io/en/latest/faq.html#variant-caller-choice>`__ section for detailed
516525
discussion on when to use either option.
517526

527+
Check out the `GeT-RM WGS tutorial <https://pypgx.readthedocs.io/en/latest/
528+
tutorials.html#get-rm-wgs-tutorial>`__ to see this pipeline in action.
529+
518530
Chip pipeline
519531
-------------
520532

@@ -534,6 +546,9 @@ The pipeline currently does not support SV detection. Please post a GitHub
534546
issue if you want to contribute your development skills and/or data for
535547
devising an SV detection algorithm.
536548

549+
Check out the `Coriell Affy tutorial <https://pypgx.readthedocs.io/en/latest/
550+
tutorials.html#coriell-affy-tutorial>`__ to see this pipeline in action.
551+
537552
Long-read pipeline
538553
------------------
539554

@@ -664,11 +679,13 @@ For getting help on the CLI:
664679
prepare-depth-of-coverage
665680
Prepare a depth of coverage file for all target
666681
genes with SV from BAM files.
682+
print-data Print the main data of specified archive.
667683
print-metadata Print the metadata of specified archive.
668684
run-chip-pipeline Run genotyping pipeline for chip data.
669685
run-long-read-pipeline
670686
Run genotyping pipeline for long-read sequencing data.
671687
run-ngs-pipeline Run genotyping pipeline for NGS data.
688+
slice-bam Slice BAM file for all genes used by PyPGx.
672689
test-cnv-caller Test CNV caller for target gene.
673690
train-cnv-caller Train CNV caller for target gene.
674691

docs/cli.rst

Lines changed: 71 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ For getting help on the CLI:
5555
prepare-depth-of-coverage
5656
Prepare a depth of coverage file for all target
5757
genes with SV from BAM files.
58+
print-data Print the main data of specified archive.
5859
print-metadata Print the metadata of specified archive.
5960
run-chip-pipeline Run genotyping pipeline for chip data.
6061
run-long-read-pipeline
6162
Run genotyping pipeline for long-read sequencing data.
6263
run-ngs-pipeline Run genotyping pipeline for NGS data.
64+
slice-bam Slice BAM file for all genes used by PyPGx.
6365
test-cnv-caller Test CNV caller for target gene.
6466
train-cnv-caller Train CNV caller for target gene.
6567
@@ -201,13 +203,13 @@ compute-control-statistics
201203
[Example] For the VDR gene from WGS data:
202204
$ pypgx compute-control-statistics \
203205
VDR \
204-
control-statistcs.zip \
206+
control-statistics.zip \
205207
1.bam 2.bam
206208
207209
[Example] For a custom region from targeted sequencing data:
208210
$ pypgx compute-control-statistics \
209211
chr1:100-200 \
210-
control-statistcs.zip \
212+
control-statistics.zip \
211213
bam.list \
212214
--bed probes.bed
213215
@@ -218,7 +220,7 @@ compute-copy-number
218220
219221
$ pypgx compute-copy-number -h
220222
usage: pypgx compute-copy-number [-h] [--samples-without-sv TEXT [TEXT ...]]
221-
read-depth control-statistcs copy-number
223+
read-depth control-statistics copy-number
222224
223225
Compute copy number from read depth for target gene.
224226
@@ -233,7 +235,7 @@ compute-copy-number
233235
Positional arguments:
234236
read-depth Input archive file with the semantic type
235237
CovFrame[ReadDepth].
236-
control-statistcs Input archive file with the semantic type
238+
control-statistics Input archive file with the semantic type
237239
SampleTable[Statistics].
238240
copy-number Output archive file with the semantic type
239241
CovFrame[CopyNumber].
@@ -703,6 +705,7 @@ prepare-depth-of-coverage
703705
704706
$ pypgx prepare-depth-of-coverage -h
705707
usage: pypgx prepare-depth-of-coverage [-h] [--assembly TEXT] [--bed PATH]
708+
[--genes TEXT [TEXT ...]] [--exclude]
706709
depth-of-coverage bams [bams ...]
707710
708711
Prepare a depth of coverage file for all target genes with SV from BAM files.
@@ -713,22 +716,26 @@ prepare-depth-of-coverage
713716
have star alleles defined only by SNVs/indels (e.g. CYP3A5).
714717
715718
Positional arguments:
716-
depth-of-coverage Output archive file with the semantic type
717-
CovFrame[DepthOfCoverage].
718-
bams One or more input BAM files. Alternatively, you can
719-
provide a text file (.txt, .tsv, .csv, or .list)
720-
containing one BAM file per line.
719+
depth-of-coverage Output archive file with the semantic type
720+
CovFrame[DepthOfCoverage].
721+
bams One or more input BAM files. Alternatively, you can
722+
provide a text file (.txt, .tsv, .csv, or .list)
723+
containing one BAM file per line.
721724
722725
Optional arguments:
723-
-h, --help Show this help message and exit.
724-
--assembly TEXT Reference genome assembly (default: 'GRCh37')
725-
(choices: 'GRCh37', 'GRCh38').
726-
--bed PATH By default, the input data is assumed to be WGS. If
727-
it's targeted sequencing, you must provide a BED file
728-
to indicate probed regions. Note that the 'chr' prefix
729-
in contig names (e.g. 'chr1' vs. '1') will be
730-
automatically added or removed as necessary to match
731-
the input BAM's contig names.
726+
-h, --help Show this help message and exit.
727+
--assembly TEXT Reference genome assembly (default: 'GRCh37')
728+
(choices: 'GRCh37', 'GRCh38').
729+
--bed PATH By default, the input data is assumed to be WGS. If
730+
it's targeted sequencing, you must provide a BED file
731+
to indicate probed regions. Note that the 'chr' prefix
732+
in contig names (e.g. 'chr1' vs. '1') will be
733+
automatically added or removed as necessary to match
734+
the input BAM's contig names.
735+
--genes TEXT [TEXT ...]
736+
List of genes to include.
737+
--exclude Exclude specified genes. Ignored when --genes is not
738+
used.
732739
733740
[Example] From WGS data:
734741
$ pypgx prepare-depth-of-coverage \
@@ -741,6 +748,22 @@ prepare-depth-of-coverage
741748
bam.list \
742749
--bed probes.bed
743750
751+
print-data
752+
==========
753+
754+
.. code-block:: text
755+
756+
$ pypgx print-data -h
757+
usage: pypgx print-data [-h] input
758+
759+
Print the main data of specified archive.
760+
761+
Positional arguments:
762+
input Input archive file.
763+
764+
Optional arguments:
765+
-h, --help Show this help message and exit.
766+
744767
print-metadata
745768
==============
746769

@@ -876,7 +899,7 @@ run-ngs-pipeline
876899
CovFrame[DepthOfCoverage].
877900
--control-statistics PATH
878901
Archive file with the semantic type
879-
SampleTable[Statistcs].
902+
SampleTable[Statistics].
880903
--platform TEXT Genotyping platform (default: 'WGS') (choices: 'WGS',
881904
'Targeted')
882905
--assembly TEXT Reference genome assembly (default: 'GRCh37')
@@ -897,7 +920,7 @@ run-ngs-pipeline
897920
Do not plot copy number profile.
898921
--do-not-plot-allele-fraction
899922
Do not plot allele fraction profile.
900-
--cnv-caller PATH Archive file with the semantic type Model[CNV]. By
923+
--cnv-caller PATH Archive file with the semantic type Model[CNV]. By
901924
default, a pre-trained CNV caller in the ~/pypgx-bundle
902925
directory will be used.
903926
@@ -913,17 +936,43 @@ run-ngs-pipeline
913936
CYP2D6-pipeline \
914937
--variants variants.vcf.gz \
915938
--depth-of-coverage depth-of-coverage.tsv \
916-
--control-statistcs control-statistics-VDR.zip
939+
--control-statistics control-statistics-VDR.zip
917940
918941
[Example] To genotype the CYP2D6 gene from targeted sequencing data:
919942
$ pypgx run-ngs-pipeline \
920943
CYP2D6 \
921944
CYP2D6-pipeline \
922945
--variants variants.vcf.gz \
923946
--depth-of-coverage depth-of-coverage.tsv \
924-
--control-statistcs control-statistics-VDR.zip \
947+
--control-statistics control-statistics-VDR.zip \
925948
--platform Targeted
926949
950+
slice-bam
951+
=========
952+
953+
.. code-block:: text
954+
955+
$ pypgx slice-bam -h
956+
usage: pypgx slice-bam [-h] [--assembly TEXT] [--genes TEXT [TEXT ...]]
957+
[--exclude]
958+
input output
959+
960+
Slice BAM file for all genes used by PyPGx.
961+
962+
Positional arguments:
963+
input Input BAM file. It must be already indexed to allow
964+
random access.
965+
output Output BAM file.
966+
967+
Optional arguments:
968+
-h, --help Show this help message and exit.
969+
--assembly TEXT Reference genome assembly (default: 'GRCh37')
970+
(choices: 'GRCh37', 'GRCh38').
971+
--genes TEXT [TEXT ...]
972+
List of genes to include.
973+
--exclude Exclude specified genes. Ignored when --genes is not
974+
used.
975+
927976
test-cnv-caller
928977
===============
929978

docs/create.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@
384384
- ``SampleTable[Results]``
385385
* TSV file for storing various results for each sample.
386386
* Requires following metadata: ``Gene``, ``Assembly``, ``SemanticType``.
387-
- ``SampleTable[Statistcs]``
387+
- ``SampleTable[Statistics]``
388388
* TSV file for storing control gene's various statistics on read depth for each sample. Used for converting target gene's read depth to copy number.
389389
* Requires following metadata: ``Control``, ``Assembly``, ``SemanticType``, ``Platform``.
390390
- ``VcfFrame[Consolidated]``
@@ -397,11 +397,12 @@
397397
* VcfFrame for storing target gene's phased variant data.
398398
* Requires following metadata: ``Platform``, ``Gene``, ``Assembly``, ``SemanticType``, ``Program``.
399399
400-
Wroking with archive files
400+
Working with archive files
401401
--------------------------
402402
403403
To demonstrate how easy it is to work with PyPGx archive files, below we will
404-
show some examples. First, download an archive:
404+
show some examples. First, download an archive to play with, which has
405+
``SampleTable[Results]`` as semantic type:
405406
406407
.. code-block:: text
407408
@@ -416,6 +417,14 @@
416417
Assembly=GRCh37
417418
SemanticType=SampleTable[Results]
418419
420+
Now print its main data (but display first sample only):
421+
422+
.. code-block:: text
423+
424+
$ pypgx print-data grch37-CYP2D6-results.zip | head -n 2
425+
Genotype Phenotype Haplotype1 Haplotype2 AlternativePhase VariantData CNV
426+
HG00276_PyPGx *4/*5 Poor Metabolizer *4;*10;*74;*2; *10;*74;*2; ; *4:22-42524947-C-T:0.913;*10:22-42526694-G-A,22-42523943-A-G:1.0,1.0;*74:22-42525821-G-T:1.0;*2:default; DeletionHet
427+
419428
We can unzip it to extract files inside (note that ``tmpcty4c_cr`` is the
420429
original folder name):
421430
@@ -527,7 +536,7 @@
527536
This pipeline supports SV detection based on copy number analysis for genes
528537
that are known to have SV. Therefore, if the target gene is associated with
529538
SV (e.g. CYP2D6) it's strongly recommended to provide a
530-
``CovFrame[DepthOfCoverage]`` file and a ``SampleTable[Statistcs]`` file in
539+
``CovFrame[DepthOfCoverage]`` file and a ``SampleTable[Statistics]`` file in
531540
addtion to a VCF file containing SNVs/indels. If the target gene is not
532541
associated with SV (e.g. CYP3A5) providing a VCF file alone is enough. You can
533542
visit the `Genes <https://pypgx.readthedocs.io/en/latest/genes.html>`__ page
@@ -542,6 +551,9 @@
542551
io/en/latest/faq.html#variant-caller-choice>`__ section for detailed
543552
discussion on when to use either option.
544553
554+
Check out the `GeT-RM WGS tutorial <https://pypgx.readthedocs.io/en/latest/
555+
tutorials.html#get-rm-wgs-tutorial>`__ to see this pipeline in action.
556+
545557
Chip pipeline
546558
-------------
547559
@@ -561,6 +573,9 @@
561573
issue if you want to contribute your development skills and/or data for
562574
devising an SV detection algorithm.
563575
576+
Check out the `Coriell Affy tutorial <https://pypgx.readthedocs.io/en/latest/
577+
tutorials.html#coriell-affy-tutorial>`__ to see this pipeline in action.
578+
564579
Long-read pipeline
565580
------------------
566581

0 commit comments

Comments
 (0)