Skip to content

Commit 902b2c0

Browse files
committed
Update docs
1 parent 48f514e commit 902b2c0

File tree

5 files changed

+116
-30
lines changed

5 files changed

+116
-30
lines changed

README.rst

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Installation
2929

3030
The following packages are required to run PyPGx:
3131

32-
.. list-table:: Dependencies and their availability in Anaconda and PyPI
32+
.. list-table::
3333
:header-rows: 1
3434

3535
* - Package
@@ -212,22 +212,67 @@ For getting help on a specific submodule (e.g. utils):
212212
CLI examples
213213
============
214214

215-
Run NGS pipeline for CYP2D6:
215+
We can print the metadata of an archive file:
216+
217+
.. code-block:: text
218+
219+
$ pypgx print-metadata CYP2D6-copy-number.zip
220+
221+
Above will print:
222+
223+
.. code-block:: text
224+
225+
Gene=CYP2D6
226+
Assembly=GRCh37
227+
SemanticType=CovFrame[CopyNumber]
228+
Platform=WGS
229+
Control=VDR
230+
Samples=None
231+
232+
We can run the NGS pipeline for the *CYP2D6* gene:
216233

217234
.. code-block:: text
218235
219-
$ pypgx run-ngs-pipeline \
220-
CYP2D6 \
221-
CYP2D6-pipeline \
222-
--vcf input.vcf \
223-
--panel ref.vcf \
224-
--tsv input.tsv \
225-
--control-statistics control-statistics-VDR.zip
236+
$ pypgx run-ngs-pipeline \
237+
CYP2D6 \
238+
CYP2D6-pipeline \
239+
--vcf input.vcf \
240+
--panel ref.vcf \
241+
--tsv input.tsv \
242+
--control-statistics control-statistics-VDR.zip
243+
244+
Above will create a number of archive files:
245+
246+
.. code-block:: text
247+
248+
Saved VcfFrame[Imported] to: CYP2D6-pipeline/imported-variants.zip
249+
Saved VcfFrame[Phased] to: CYP2D6-pipeline/phased-variants.zip
250+
Saved VcfFrame[Consolidated] to: CYP2D6-pipeline/consolidated-variants.zip
251+
Saved SampleTable[Alleles] to: CYP2D6-pipeline/alleles.zip
252+
Saved CovFrame[ReadDepth] to: CYP2D6-pipeline/read-depth.zip
253+
Saved CovFrame[CopyNumber] to: CYP2D6-pipeline/copy-number.zip
254+
Saved SampleTable[CNVCalls] to: CYP2D6-pipeline/cnv-calls.zip
255+
Saved SampleTable[Genotypes] to: CYP2D6-pipeline/genotypes.zip
256+
Saved SampleTable[Results] to: CYP2D6-pipeline/results.zip
226257
227258
API examples
228259
============
229260

230-
Predict phenotype based on two haplotype calls:
261+
We can obtain allele function for the *CYP2D6* gene:
262+
263+
.. code:: python3
264+
265+
>>> import pypgx
266+
>>> pypgx.get_function('CYP2D6', '*1')
267+
'Normal Function'
268+
>>> pypgx.get_function('CYP2D6', '*4')
269+
'No Function'
270+
>>> pypgx.get_function('CYP2D6', '*22')
271+
'Uncertain Function'
272+
>>> pypgx.get_function('CYP2D6', '*140')
273+
'Unknown Function'
274+
275+
We can predict phenotype for the *CYP2D6* gene based on two haplotype calls:
231276

232277
.. code:: python3
233278
@@ -240,5 +285,3 @@ Predict phenotype based on two haplotype calls:
240285
'Indeterminate'
241286
>>> pypgx.predict_phenotype('CYP2D6', '*1', '*1x2') # Gene duplication
242287
'Ultrarapid Metabolizer'
243-
>>> pypgx.predict_phenotype('CYP2B6', '*1', '*4') # *4 has increased function
244-
'Rapid Metabolizer'

docs/create.py

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
5757
The following packages are required to run PyPGx:
5858
59-
.. list-table:: Dependencies and their availability in Anaconda and PyPI
59+
.. list-table::
6060
:header-rows: 1
6161
6262
* - Package
@@ -196,22 +196,67 @@
196196
CLI examples
197197
============
198198
199-
Run NGS pipeline for CYP2D6:
199+
We can print the metadata of an archive file:
200+
201+
.. code-block:: text
202+
203+
$ pypgx print-metadata CYP2D6-copy-number.zip
204+
205+
Above will print:
206+
207+
.. code-block:: text
208+
209+
Gene=CYP2D6
210+
Assembly=GRCh37
211+
SemanticType=CovFrame[CopyNumber]
212+
Platform=WGS
213+
Control=VDR
214+
Samples=None
215+
216+
We can run the NGS pipeline for the *CYP2D6* gene:
200217
201218
.. code-block:: text
202219
203-
$ pypgx run-ngs-pipeline \\
204-
CYP2D6 \\
205-
CYP2D6-pipeline \\
206-
--vcf input.vcf \\
207-
--panel ref.vcf \\
208-
--tsv input.tsv \\
209-
--control-statistics control-statistics-VDR.zip
220+
$ pypgx run-ngs-pipeline \\
221+
CYP2D6 \\
222+
CYP2D6-pipeline \\
223+
--vcf input.vcf \\
224+
--panel ref.vcf \\
225+
--tsv input.tsv \\
226+
--control-statistics control-statistics-VDR.zip
227+
228+
Above will create a number of archive files:
229+
230+
.. code-block:: text
231+
232+
Saved VcfFrame[Imported] to: CYP2D6-pipeline/imported-variants.zip
233+
Saved VcfFrame[Phased] to: CYP2D6-pipeline/phased-variants.zip
234+
Saved VcfFrame[Consolidated] to: CYP2D6-pipeline/consolidated-variants.zip
235+
Saved SampleTable[Alleles] to: CYP2D6-pipeline/alleles.zip
236+
Saved CovFrame[ReadDepth] to: CYP2D6-pipeline/read-depth.zip
237+
Saved CovFrame[CopyNumber] to: CYP2D6-pipeline/copy-number.zip
238+
Saved SampleTable[CNVCalls] to: CYP2D6-pipeline/cnv-calls.zip
239+
Saved SampleTable[Genotypes] to: CYP2D6-pipeline/genotypes.zip
240+
Saved SampleTable[Results] to: CYP2D6-pipeline/results.zip
210241
211242
API examples
212243
============
213244
214-
Predict phenotype based on two haplotype calls:
245+
We can obtain allele function for the *CYP2D6* gene:
246+
247+
.. code:: python3
248+
249+
>>> import pypgx
250+
>>> pypgx.get_function('CYP2D6', '*1')
251+
'Normal Function'
252+
>>> pypgx.get_function('CYP2D6', '*4')
253+
'No Function'
254+
>>> pypgx.get_function('CYP2D6', '*22')
255+
'Uncertain Function'
256+
>>> pypgx.get_function('CYP2D6', '*140')
257+
'Unknown Function'
258+
259+
We can predict phenotype for the *CYP2D6* gene based on two haplotype calls:
215260
216261
.. code:: python3
217262
@@ -224,8 +269,6 @@
224269
'Indeterminate'
225270
>>> pypgx.predict_phenotype('CYP2D6', '*1', '*1x2') # Gene duplication
226271
'Ultrarapid Metabolizer'
227-
>>> pypgx.predict_phenotype('CYP2B6', '*1', '*4') # *4 has increased function
228-
'Rapid Metabolizer'
229272
""".format(**d)
230273

231274
readme_file = f'{utils.PROGRAM_PATH}/README.rst'
@@ -327,7 +370,7 @@
327370
Introduction
328371
============
329372
330-
This section describes software development kit (SDK) for PyPGx.
373+
This section describes the software development kit (SDK) for PyPGx.
331374
332375
utils
333376
=====

docs/sdk.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SDK
77
Introduction
88
============
99

10-
This section describes software development kit (SDK) for PyPGx.
10+
This section describes the software development kit (SDK) for PyPGx.
1111

1212
utils
1313
=====

docs/tutorials.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Now that we have all the files we need, let's run the next-generation sequencing
3636
--tsv GeT-RM.tsv.gz \
3737
--control-statistics control-statistics-VDR.zip
3838
39-
Above will create a number of archive files in the ``CYP2D6-pipeline`` directory:
39+
Above will create a number of archive files:
4040

4141
.. code-block:: text
4242

pypgx/api/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,16 +1674,16 @@ def parsecnv(x):
16741674

16751675
return sum([parsecnv(x) for x in allele.split('+')])
16761676

1677-
def print_metadata(archive):
1677+
def print_metadata(input):
16781678
"""
16791679
Print the metadata of specified archive.
16801680
16811681
Parameters
16821682
----------
1683-
archive : pypgx.Archive
1683+
input : pypgx.Archive
16841684
Archive file.
16851685
"""
1686-
zf = zipfile.ZipFile(archive)
1686+
zf = zipfile.ZipFile(input)
16871687
parent = zf.filelist[0].filename.split('/')[0]
16881688
with zf.open(f'{parent}/metadata.txt') as f:
16891689
print(f.read().decode('utf-8').strip())

0 commit comments

Comments
 (0)