Skip to content

Commit

Permalink
README changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhsu3 committed May 28, 2015
1 parent 65d67c0 commit 091d1f3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Installation

Allelic Expression Imbalance
============================
![AEI](doc/source/images/example_aei.png)
[AEI!](doc/source/images/example_aei.png)


Documentation
Expand Down
8 changes: 8 additions & 0 deletions genda/AEI/AEI.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ def single_snp_aei_test2(geno, allelic_ratio, num_threshold=2):
return(ttest_ind(het_combined, homo_combined, equal_var=False)[1])




def single_snp_aei_test_mixture_model(geno, allelic_ration, num_threshold=2):

pass



def dosage_round(geno, threshold = 0.5):
""" Rounds dosage to threshold
"""
Expand Down
22 changes: 22 additions & 0 deletions genda/stats/popgen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
""" Population Genetic based calculations
"""

from genda import calculate_minor_allele_frequency

def calculate_D_prime(geno1, geno2):
""" Calculates pairwise D_prime of genotype with the
geno1 - an array or series
geno2 - an array or series
"""
assert len(geno1) == len(geno2)
p1 = calculate_minor_allele_frequency(geno1)
p2 = calculate_minor_allele_frequency(geno2)


p12 = (geno1 == 2) & (geno2 == 2)
p21 = (geno1 == 0) & (geno2 == 0)
return(p1 * p2)



0 comments on commit 091d1f3

Please sign in to comment.