import random from stamp.metagenomics.plugins.statisticalTests.Fishers import Fishers from stamp.metagenomics.plugins.statisticalTests.ChiSquare import ChiSquare from stamp.metagenomics.plugins.statisticalTests.ChiSquareYates import ChiSquareYates from stamp.metagenomics.plugins.statisticalTests.GTest import GTest from stamp.metagenomics.plugins.statisticalTests.GTestYates import GTestYates from stamp.metagenomics.plugins.statisticalTests.Permutation import Permutation from stamp.metagenomics.plugins.statisticalTests.DiffBetweenProp import DiffBetweenProp from stamp.metagenomics.plugins.statisticalTests.Bootstrap import Bootstrap from stamp.metagenomics.plugins.statisticalTests.Barnard import Barnard fishers = Fishers() chiSquare = ChiSquare() chiSquareYates = ChiSquareYates() gTest = GTest() gTestYates = GTestYates() permutation = Permutation() diffBetweenProp = DiffBetweenProp() bootstrap = Bootstrap() barnard = Barnard() sampleSizes = [5, 10, 15, 25] def mean(x): if len(x) == 0: return 0 sum = 0.0 for i in xrange(0, len(x)):
import random from stamp.metagenomics.plugins.statisticalTests.Fishers import Fishers from stamp.metagenomics.plugins.statisticalTests.GTest import GTest from stamp.metagenomics.plugins.statisticalTests.GTestYates import GTestYates from stamp.metagenomics.plugins.statisticalTests.DiffBetweenProp import DiffBetweenProp fishers = Fishers() gTest = GTest() gTestYates = GTestYates() diffBetweenProp = DiffBetweenProp() numReplicates = 10000 # number of samples to draw popSize = 1000000 # size of underlying population propInSS = [0.1] # proportion of sequences in subsystem (SS) of interest sampleSize1 = [1000] # sample size for community 1 sampleSize2 = [2000] # sample size for community 2 for sampleSizeIndex in xrange(0, len(sampleSize1)): print 'Considering communities with a sample size of: ' + str(sampleSize1[sampleSizeIndex]) + ' and ' + str(sampleSize2[sampleSizeIndex]) for prop in propInSS: print ' Proportion of sequences in subsystem of interest: ' + str(prop) totalSamples1 = sampleSize1[sampleSizeIndex] totalSamples2 = sampleSize2[sampleSizeIndex] fishersResults = [] gTestResults = [] gTestYatesResults = []
import math import random from stamp.metagenomics.plugins.statisticalTests.Fishers import Fishers from stamp.metagenomics.plugins.statisticalTests.ChiSquare import ChiSquare from stamp.metagenomics.plugins.statisticalTests.ChiSquareYates import ChiSquareYates from stamp.metagenomics.plugins.statisticalTests.GTest import GTest from stamp.metagenomics.plugins.statisticalTests.GTestYates import GTestYates from stamp.metagenomics.plugins.statisticalTests.Permutation import Permutation from stamp.metagenomics.plugins.statisticalTests.DiffBetweenProp import DiffBetweenProp from stamp.metagenomics.plugins.statisticalTests.Bootstrap import Bootstrap fishers = Fishers() chiSquare = ChiSquare() chiSquareYates = ChiSquareYates() gTest = GTest() gTestYates = GTestYates() permutation = Permutation() diffBetweenProp = DiffBetweenProp() bootstrap = Bootstrap() sampleSize = 50 def mean(x): if len(x) == 0: return 0 sum = 0.0 for i in xrange(0, len(x)): sum += x[i]
import random from stamp.metagenomics.plugins.statisticalTests.Fishers import Fishers from stamp.metagenomics.plugins.statisticalTests.GTest import GTest from stamp.metagenomics.plugins.statisticalTests.GTestYates import GTestYates from stamp.metagenomics.plugins.statisticalTests.DiffBetweenProp import DiffBetweenProp fishers = Fishers() gTest = GTest() gTestYates = GTestYates() diffBetweenProp = DiffBetweenProp() numReplicates = 10000 # number of samples to draw popSize = 1000000 # size of underlying population propInSS = [0.1] # proportion of sequences in subsystem (SS) of interest sampleSize1 = [1000] # sample size for community 1 sampleSize2 = [2000] # sample size for community 2 for sampleSizeIndex in xrange(0, len(sampleSize1)): print 'Considering communities with a sample size of: ' + str( sampleSize1[sampleSizeIndex]) + ' and ' + str( sampleSize2[sampleSizeIndex]) for prop in propInSS: print ' Proportion of sequences in subsystem of interest: ' + str( prop) totalSamples1 = sampleSize1[sampleSizeIndex] totalSamples2 = sampleSize2[sampleSizeIndex]