Skip to content

Commit

Permalink
documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
aewebb80 committed Sep 17, 2019
1 parent 4e19bae commit 0631083
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 53 deletions.
4 changes: 2 additions & 2 deletions pgpipe/admixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.. code-block:: bash
python admixture.py
admixture.py
*************
Example usage
Expand All @@ -22,7 +22,7 @@
.. code-block:: bash
python admixture.py --binary-ped-prefix hapmap3 --pop 3
admixture.py --binary-ped-prefix hapmap3 --pop 3
############
Dependencies
Expand Down
35 changes: 32 additions & 3 deletions pgpipe/bed_tasks.py → pgpipe/bed_utilities.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
#!/usr/bin/env python
'''
Utilites for BED-formatted files
Automates various utilites for BED-formatted files. This currently includes: i)
subtract from a BED that overlap with a second BED file; ii) extend a BED upstream,
downstream, or both upstream and downstream; iii) sort a single BED; iv) merge
features within one or more BED files; v) create a BED of complementary features.
Automates various utilites for BED-formatted files. This currently includes:
MORE INFO.
##################
Command-line Usage
##################
The BED utilites function may be called using the following command:
.. code-block:: bash
bed_utilites.py
*************
Example usage
*************
Extend flanks (i.e. both upstream and downstream) by 10kb:
.. code-block:: bash
bed_utilites.py --bed input.bed chr22.vcf.gz --utility extend --extend-flanks 10000
Merge multiple BED files:
.. code-block:: bash
bed_utilites.py --beds Input_BEDs --utility merge
############
Dependencies
############
* `BEDtools <https://bedtools.readthedocs.io/en/latest/>`_
############################
Input Command-line Arguments
Expand Down
46 changes: 31 additions & 15 deletions pgpipe/eigenstrat_fstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,37 @@
Automates the calculation of multiple admixture statistics, including: Patterson's D,
F4 statistic, F4-ratio statistic, and F3 statistic.
##################
Command-line Usage
##################
The admixture statistics automater may be called using the following command:
.. code-block:: bash
eigenstrat_fstats.py
*************
Example usage
*************
Command-line to calculate Patterson's D:
.. code-block:: bash
eigenstrat_fstats.py --eigenstrat-prefix snps --calc-admix-statistic D --admix-w-pop French --admix-x-pop Yoruba --admix-y-pop Vindija --admix-z-pop Chimp
Command-line to calculate the F4-ratio:
.. code-block:: bash
eigenstrat_fstats.py --eigenstrat-prefix snps --calc-admix-statistic F4-ratio --admix-a-pop Altai --admix-b-pop Vindija --admix-c-pop Yoruba --admix-x-pop French --admix-o-pop Chimp
############
Dependencies
############
* `AdmixTools <https://github.com/DReichLab/AdmixTools>`_
* `admixr <https://github.com/bodkan/admixr>`_
############################
Input Command-line Arguments
############################
Expand Down Expand Up @@ -139,21 +170,6 @@
Argument used to define a file of population(s) to represent C in the supported
admixure statistic. If multiple populations the statistic will be repeated until each
population has represented C.
##########################
Example Command-line Usage
##########################
Command-line to calculate Patterson's D:
.. code-block:: bash
python eigenstrat_fstats.py --eigenstrat-prefix snps --calc-admix-statistic D --admix-w-pop French --admix-x-pop Yoruba --admix-y-pop Vindija --admix-z-pop Chimp
Command-line to calculate the F4-ratio:
.. code-block:: bash
python eigenstrat_fstats.py --eigenstrat-prefix snps --calc-admix-statistic F4-ratio --admix-a-pop Altai --admix-b-pop Vindija --admix-c-pop Yoruba --admix-x-pop French --admix-o-pop Chimp
'''

import os
Expand Down
33 changes: 24 additions & 9 deletions pgpipe/plink_ld.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
'''
Automates the calculation of multiple LD statistics using Plink.
##################
Command-line Usage
##################
The LD statistics automater may be called using the following command:
.. code-block:: bash
plink_ld.py
*************
Example usage
*************
Command-line to calculate Lewontin's D-prime statistic
.. code-block:: bash
plink_ld.py --ped-prefix hapmap1 --ld-format table --ld-statistic r2 --table-d-statistic dprime
############
Dependencies
############
* `plink 1.9 <https://www.cog-genomics.org/plink2/>`_
* `plink 2.0 <https://www.cog-genomics.org/plink/2.0/>`
############################
Input Command-line Arguments
############################
Expand Down Expand Up @@ -89,15 +113,6 @@
multiple times if desired.
**--table-snps** *<snp_filename>*
Argument used to define a file with one or more SNP(s) for LD analysis.
##########################
Example Command-line Usage
##########################
Command-line to calculate Lewontin's D-prime statistic
.. code-block:: bash
python plink_ld.py --ped-prefix hapmap1 --ld-format table --ld-statistic r2 --table-d-statistic dprime
'''

import os
Expand Down
4 changes: 2 additions & 2 deletions pgpipe/stat_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.. code-block:: bash
python stat_sampler.py
stat_sampler.py
*************
Example usage
Expand All @@ -22,7 +22,7 @@
.. code-block:: bash
python admixture.py --statistic-file merged_chr1_10000.windowed.weir.fst
stat_sampler.py --statistic-file merged_chr1_10000.windowed.weir.fst
--calc-statistic windowed-weir-fst --sampling-scheme random --sample-size 20
############################
Expand Down
6 changes: 3 additions & 3 deletions pgpipe/vcf_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
.. code-block:: bash
python vcf_calc.py
vcf_calc.py
*************
Example usage
Expand All @@ -20,13 +20,13 @@
.. code-block:: bash
python vcf_calc.py --vcf input.vcf --calc-statistic TajimaD --statistic-window-size 10000
vcf_calc.py --vcf input.vcf --calc-statistic TajimaD --statistic-window-size 10000
Command-line to calculate windowed Fst on the two populations within the model *2Pop*:
.. code-block:: bash
python vcf_calc.py --vcf input.vcf.gz --model-file input.model --model 2Pop --calc-statistic windowed-weir-fst --statistic-window-size 10000 --statistic-window-step 10000
vcf_calc.py --vcf input.vcf.gz --model-file input.model --model 2Pop --calc-statistic windowed-weir-fst --statistic-window-size 10000 --statistic-window-step 10000
############
Dependencies
Expand Down
8 changes: 4 additions & 4 deletions pgpipe/vcf_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.. code-block:: bash
python vcf_filter.py
vcf_filter.py
*************
Example usage
Expand All @@ -19,19 +19,19 @@
.. code-block:: bash
python vcf_filter.py --vcf input.bcf --filter-min-alleles 2 --filter-max-alleles 2
vcf_filter.py --vcf input.bcf --filter-min-alleles 2 --filter-max-alleles 2
Command-line to only include chromosome chr1:
.. code-block:: bash
python vcf_filter.py --vcf input.vcf.gz --filter-include-chr chr1
vcf_filter.py --vcf input.vcf.gz --filter-include-chr chr1
Command-line to remove indels and ouput a BCF file:
.. code-block:: bash
python vcf_filter.py --vcf input.vcf --filter-exclude-indels --out-format bcf
vcf_filter.py --vcf input.vcf --filter-exclude-indels --out-format bcf
############
Dependencies
Expand Down
4 changes: 2 additions & 2 deletions pgpipe/vcf_liftover.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.. code-block:: bash
python vcf_liftover.py
vcf_liftover.py
*************
Example usage
Expand All @@ -18,7 +18,7 @@
.. code-block:: bash
python vcf_liftover.py --vcf chr22.vcf.gz --chain hg19ToHg38.over.chain
vcf_liftover.py --vcf chr22.vcf.gz --chain hg19ToHg38.over.chain
############
Dependencies
Expand Down
6 changes: 3 additions & 3 deletions pgpipe/vcf_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
.. code-block:: bash
python vcf_phase.py
vcf_phase.py
*************
Example usage
Expand All @@ -20,13 +20,13 @@
.. code-block:: bash
python vcf_phase.py --vcf input.vcf --phase-algorithm beagle --phase-chr chr1
vcf_phase.py --vcf input.vcf --phase-algorithm beagle --phase-chr chr1
Command-line to phase using SHAPEIT with 100 burn-in iterations:
.. code-block:: bash
python vcf_phase.py --vcf input.vcf.gz --phase-algorithm shapeit --shapeit-burn-iter 100
vcf_phase.py --vcf input.vcf.gz --phase-algorithm shapeit --shapeit-burn-iter 100
############
Dependencies
Expand Down
32 changes: 23 additions & 9 deletions pgpipe/vcf_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@
data for the function to operate. If the specified statistic file does not
contain a BIN_END column, the --statistic-window-size argument may be used.
##################
Command-line Usage
##################
The VCF splitter may be called using the following command:
.. code-block:: bash
vcf_split.py
*************
Example usage
*************
Command-line to split using a statistic file:
.. code-block:: bash
vcf_split.py --vcf input.vcf --split-file input.windowed.weir.fst --split-method statistic-file
############
Dependencies
############
* `BCFtools <https://samtools.github.io/bcftools/bcftools.html>`_
############################
Input Command-line Arguments
############################
Expand Down Expand Up @@ -85,15 +108,6 @@
Argument used to define a BED file of positions to include.
**--filter-exclude-bed** *<position_bed_filename>*
Argument used to define a BED file of positions to exclude.
##########################
Example Command-line Usage
##########################
Command-line to split using a statistic file:
.. code-block:: bash
python vcf_split.py --vcf input.vcf --split-file input.windowed.weir.fst --split-method statistic-file
'''

import os
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'pgpipe/vcf_phase.py',
'pgpipe/four_gamete.py',
'pgpipe/stat_sampler.py',
'pgpipe/bed_tasks.py',
'pgpipe/bed_utilities.py',
'pgpipe/informative_loci_filter.py',
'pgpipe/convert.py',
'pgpipe/vcf_to_ima.py',
Expand Down

0 comments on commit 0631083

Please sign in to comment.