Package: pmoss
pMoSS:p-valueModel using theSampleSizepMoSS (p-valueModel using theSampleSize) is a Python code to model thep-valueas an n-dependent function using Monte Carlo cross-validation.This statistical method uses the relationship between thep-valueand the sample size to characterize the data of an experiment and decide, robustly, when the null hypothesis can be rejected.The method is presented atE. Gómez-de-Mariscal, V. Guerrero, A. Sneider, H. Jayatilaka, J. M. Phillip, D. Wirtz and A. Muñoz-Barrutia, "Use of the p-values as a size-dependent function to address practical differences when analyzing large datasets." Scientific Reports, 2021.How to cite@article{gomez2021pvalue,title={Use of the p-values as a size-dependent function to address practical differences when analyzing large datasets},author={G{\'o}mez-de-Mariscal, Estibaliz and Guerrero, Vanesa and Sneider, Alexandra and Jayatilaka, Hasini and Phillip, Jude M. and Wirtz, Denis and Mu{\~{n}}oz-Barrutia, Arrate},journal={Scientific Reports},year={2021},volume={11},number={20942},URL={https://doi.org/10.1038/s41598-021-00199-5},doi={10.1038/s41598-021-00199-5}}Conditions of usepMoSS is an open-source software (OSS) under the BSD 2-Clause License. All the resources provided here are freely available for non-commercial and research purposes. Their use for any other purpose is generally possible, but solely with the explicit permission of the authors. You are expected to include adequate references whenever you present or publish results that are based on the resources provided.Whatch these short tutorials to become an expert user of pMoSSGet pMoSS ready in Google ColabAnalysis of new data using Google ColabBrief descriptionThe method uses Monte Carlo cross-validation to estimate the distribution of thep-valueusing samples of different sizes, and fits an exponential curve. When thep-valueof a certain statistical hypothesis test is treated as a function ofn, it is possible to get quantitative indicators of the data, such as the decay of the function or the minimum data size needed to get statistically significant differences (nα).The following figure illustrates a common output of the method. Here the cell body roundness is tested when cancer cells are treated with Taxol.|(Leftmost) The cell roundness distribution of control cells and cells treated at 1 nM Taxol have lower values than that of cells treated at 50 nM. (Right) The three groups were compared, thep-valueswere estimated andp(n)was fitted for each pair of compared groups. When Taxol at 50 nM is evaluated (blue and yellow dashed curves),nαis lower and the decay ofp(n)is higher (aandcparameters  of the exponential function), i.e. it decreases much faster than the one corresponding comparison of control and Taxol at 1 nM (orange curve).InstallationThis package is tested on Python 3.6 and 3.7.
The code can be used either in a local machine or inLocal MachineYou need to have Python installed previously. For non-expert users, it is highly recommended to download theAnaconda distributionof Python to obtain the dependencies easily.Create a new virtual environment with Python 3.6 to avoid any version compatibility issues. There are three different ways to do it:Create a virtual environment withPython(advanced users).OpenAnaconda Promptand create a virtual environment calledyour_virtualenvusingconda create:condacreate-nyour_virtualenvpython=3.6OpenAnaconda Navigatorand create a virtual environment using the GUI.Open Anaconda Prompt and activate your virtual environment usingconda activate:condaactivateyour_virtualenvOnceyour_virtualnvis activated, install thepmosspython package using pip:pipinstallpmossExamplesWe provide twonotebooks as exampleswith the data used in the reference manuscript. You need to installJupyter Notebook. Do not forget to do it in your virtual environment: activateyour_virtualenvusingconda activate(as it was done in previous lines) and install Jupyter with the following command:pipinstalljupyter
jupyternotebookIn Jupyter, you have access to the directories in your local machine. Once you have downloaded one of the example jupyter notebooks, open it and run the cells.Please, note that the software is not implemented for GPU, so Monte Carlo cross-validation takes quite a long time. The user can target the process by observing for a certainn-value, when a entire cross-validation has finished.Play with already computed p-valuesInReleases, you will find a data.zip file which contains the estimatedp-valuesof the examples:p-valuesfor the morphology changes with the increase of cellular age.p-valuesfor the morphology changes in cancer cells and their protrusions after being treated with Taxol.To avoid heavy computations and make a quick test of the code, download the data. Then, place it into the folder of the cloned repository, so the links in the notebooks work properly. Otherwise, change the links in the notebooks.Google ColabYou could run the notebooks inGoogle Colab. Open the notebook of the examples in Google Colab (File -> Open notebook... -> GitHub -> URL to the notebook). Note that you need to save a copy of this notebook in your drive to keep any change (File -> Save a copy in Drive)Add the following code lines at the beginning of the notebook:If the code and data are located in your drive, then you need to mount it so Google Colab can access to your private files. Otherwise, you can skip this step.fromgoogle.colabimportdrive
drive.mount('/content/drive')Install the package using pip as before or clone this github repository and install the package using!gitclonehttps://github.com/BIIG-UC3M/pMoSS.git
!pipinstall/content/pMoSS/.Modify the paths to access your data considering that your drive is mounted in Google Colab:path='/content/MyDrive/path_to_the_data_in_your_drive/'You are ready to run the code in the notebook!System requirementsOperating systems.WindowsMac OSXLinuxPython version and packages:Python 3.6 (or newer)numpyscipy>=1.1.0pandasmatplotlibxlrd>=1.0.0seabornstatsmodels>=0.9.0glob2pytest-shutilFeedback and contributionsAll kind of feedback is welcome. Specially if it supports the use of the code and a better understanding on how to work with it.Controbutions are also welcome. Please, create a new pull request on a new development branch to add new features, correct bugs or make changes in the code.Please, if possible, use GitHubIssuesto report any bug or ask questions.