<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 pySalvador 0.1 User Manual
Qi Zheng, Texas A&M University School of Public Health
August 14, 2020
pySalvador 0.1 offers a subset of the user functions that are available in rSalvador. Python users can use pySalvador 0.1 to estimate mutation rates and their confidence intervals under three common models
Step1:  The basic model
We now use the well-known Demerec experimental data for illustration. The data is available in pySalvador.
Step2:  To obtain a maximum likelihood estimate of the expected number of mutations per culture, m, you execute the following.
Step3:  You may watch the iteration process as follows.
Step4:  A 95% confident interval for m can be obtained as follows.
Step5:  Partial plating
We use data from experiment 16 of Luria and Delbruck for illustration. The plating efficiency is known to be 0.4.
Step6:  Accounting for fitness
Now assume that the mutants in Demerec's experiment had a relative fitness of 0.9.
Step7:  Using your own data
pySalvador accepts mutant data as a list. Suppose you have the following 9-culture experiment.
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import pysalvador as sal
Explanation: pySalvador 0.1 User Manual
Qi Zheng, Texas A&M University School of Public Health
August 14, 2020
pySalvador 0.1 offers a subset of the user functions that are available in rSalvador. Python users can use pySalvador 0.1 to estimate mutation rates and their confidence intervals under three common models: the classic mutation model as defined by Lea and Coulson (1949), a modified Lea-Coulson model that allows for partial plating, and another modified model that accounts for mutant fitness.
Installation of pySalvador is straightforward. Users only need to copy the Python code file pysalvador.py into their working directory or folder. However, the user must make sure that the standard Python pakcages numpy and scipy are pre-installed.To enhance flexibility, users may also put the Python code file pysalvador.py in a reserved directory and work from a different directory by adding the "permanent" pysalvador directory to the Python search path. For example, you may create a directory called c:/pysal as the permanent residence for pysalvador.py and then work from another directory by executing the following three Python commands:
```python
import sys
sys.path.append("c:/pysal")
import pysalvador as sal
```
Note that pySlavador is written completely in Python, while a sizable portion of rSalvador is written in C. Not surprisingly, when the maximum of the mutant numbers is large, pySalvador is discernibly slower than rSalvador. However, in practice, the maximum of the numbers of mutants rarely exceeds 500, and hence computing speed is a nonissue for the most part.
End of explanation
demerec=sal.demerec_data
np.transpose(demerec)
Explanation: The basic model
We now use the well-known Demerec experimental data for illustration. The data is available in pySalvador.
End of explanation
sal.newtonLD(demerec)
Explanation: To obtain a maximum likelihood estimate of the expected number of mutations per culture, m, you execute the following.
End of explanation
sal.newtonLD(demerec, show_iter=True)
Explanation: You may watch the iteration process as follows.
End of explanation
sal.confintLD(demerec,show_iter=True)
Explanation: A 95% confident interval for m can be obtained as follows.
End of explanation
luria16=sal.luria_16_data
luria16
sal.newtonLD_plating(luria16,e=0.4,show_iter=True)
sal.confintLD_plating(luria16,e=0.4,show_iter=True)
Explanation: Partial plating
We use data from experiment 16 of Luria and Delbruck for illustration. The plating efficiency is known to be 0.4.
End of explanation
sal.newtonMK(demerec,w=0.9,show_iter=True)
sal.confintMK(demerec,w=0.9,show_iter=True)
Explanation: Accounting for fitness
Now assume that the mutants in Demerec's experiment had a relative fitness of 0.9.
End of explanation
mydata=[0,16,20,2,2,56,3,161,9]
sal.newtonLD(mydata)
sal.confintLD(mydata)
Explanation: Using your own data
pySalvador accepts mutant data as a list. Suppose you have the following 9-culture experiment.
End of explanation
<END_TASK>