includeNegativeGrowthFlag=False
try:
    opts, args = getopt.getopt(sys.argv[1:], 'fn', ['force-manual', 'negative'])
    for o, a in opts:
        if o in ("-f", "--force-manual"):
            forceManualFlag = True
        elif o in ('-n', '--negative'):
            includeNegativeGrowthFlag = True
except:
    print 'ERROR: only flags admitted are -f [--force-manual] and -n [--negative].'
    sys.exit()
    
runningFlags=[forceManualFlag,includeNegativeGrowthFlag]

# 1. data reading
data300 = library.dataReader('data/300ppmSetsLight.v2.txt')
data1000 = library.dataReader('data/1000ppmSetsLight.v2.txt')

# 2. calculating the max growth rates
print 'fitting data for 300 pppm...'
maxGrowthRates300, uvValues300, growthLag300, recovery300 = library.characteristicParameterFinder(data300,runningFlags)

print
print 'fitting data for 1,000 pppm...'
maxGrowthRates1000, uvValues1000, growthLag1000, recovery1000 = library.characteristicParameterFinder(data1000,runningFlags)


# 3. plotting
print
print 'plotting the figure...'
figureFile='results/figureTPT'
    matplotlib.pyplot.ylim([-0.5e5, 10e5])
    matplotlib.pyplot.xlabel('time (days)')
    matplotlib.pyplot.ylabel('number of cells (x 1e5)')
    matplotlib.pyplot.yticks(
        (0, 1e5, 2e5, 3e5, 4e5, 5e5, 6e5, 7e5, 8e5, 9e5, 10e5),
        ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))

    matplotlib.pyplot.legend(numpoints=1, loc=1, frameon=False)

    matplotlib.pyplot.savefig(figureFile)
    matplotlib.pyplot.clf()

    return None


### MAIN

# 1. data reading
data300 = library.dataReader('../data/300ppmSet3.txt')
data1000 = library.dataReader('../data/1000ppmSet3.txt')

# 2. fitting the data to sigmoidal function
print 'fitting data for 300 pppm...'
dataGrapherEpocs(data300, '300')

print
print 'fitting data for 1000 ppm...'
dataGrapherEpocs(data1000, '1000')

print '... graphs completed.'
        localCells=dataStructure[epocLabel][1]
        
        highResolutionTime=numpy.linspace(min(shiftedTime),max(shiftedTime),resolution)

        if len(localCells) > 2: # dealing with sets of at least 2 data points
            print figureLabel+'_'+epocLabel,'\t',

            fittedTrajectory=library.dataFitter(shiftedTime,localCells)
            b=library.peval(highResolutionTime,fittedTrajectory[0])

            checkFit(highResolutionTime,b,shiftedTime,localCells,figureLabel+'_'+epocLabel)

    return None

### MAIN

# 1. data reading
data300=library.dataReader('data/300ppmSet3.txt')
data1000=library.dataReader('data/1000ppmSet3.txt')

# 2. fitting the data to sigmoidal function
print 'fitting data for 300 pppm...'
dataGrapherSingle(data300,'300')

print
print 'fitting data for 1000 ppm...'
dataGrapherSingle(data1000,'1000')

print '... graphs completed.'

try:
    opts, args = getopt.getopt(sys.argv[1:], 'fn',
                               ['force-manual', 'negative'])
    for o, a in opts:
        if o in ("-f", "--force-manual"):
            forceManualFlag = True
        elif o in ('-n', '--negative'):
            includeNegativeGrowthFlag = True
except:
    print 'ERROR: only flags admitted are -f [--force-manual] and -n [--negative].'
    sys.exit()

runningFlags = [forceManualFlag, includeNegativeGrowthFlag]

# 1. data reading
data300 = library.dataReader('data/300ppmSetsLight.v2.txt')
data1000 = library.dataReader('data/1000ppmSetsLight.v2.txt')

# 2. calculating the max growth rates
print 'fitting data for 300 pppm...'
maxGrowthRates300, uvValues300, growthLag300, recovery300 = library.characteristicParameterFinder(
    data300, runningFlags)

print
print 'fitting data for 1,000 pppm...'
maxGrowthRates1000, uvValues1000, growthLag1000, recovery1000 = library.characteristicParameterFinder(
    data1000, runningFlags)

# 3. plotting
print
print 'plotting the figure...'
Exemple #5
0
generations=['n0','n50','n100','n150','n200','n250']
thresholds=thresholdsCase1.definer()

### working on each experiment

x=[0,1,2,3,4,5]
eps=0.0
barWidth=0.33

for i in range(len(thresholds)):

    # 1. reading data
    print
    print 'reading the data...'

    before=library.dataReader(case,generations[i],thresholds[i][0],'without')
    after=library.dataReader(case,generations[i],thresholds[i][1],'with')

    averagesBefore=[numpy.mean(element) for element in before]
    averagesAfter=[numpy.mean(element) for element in after]
    
    print averagesBefore
    print averagesAfter

    statistic,pvalue=scipy.stats.mannwhitneyu(averagesBefore,averagesAfter)

    print 'statistics:',statistic,pvalue

    xPos=x[i]-barWidth/2.
    increment=numpy.mean(averagesAfter)-numpy.mean(averagesBefore)
    noise=numpy.sqrt(numpy.var(averagesBefore)+numpy.var(averagesAfter))