Package: rots-py
rots-pyPython implementation of theReproducibility-Optimized Test Statistic (ROTS)for gene ranking from theBioconductor ROTSpackage.ROTS belongs to a familly of gene ranking statistics that aim to rank genes based on evidence for differential expression in two-group comparisons. ROTS is a non-parametric method that uses a permutation test to assess the significance of the observed differential expression. ROTS is designed to be robust to outliers and to be reproducible across different studies.NOTE: Data should have at least two non-null values per row for both groups.Installationpip install rots-pyUsagefromrotspyimportrots,plot_rots,get_summary# Load datadata=...group=...# Run ROTSresult=rots(data,group,B=500,log=True,verbose=True,progress=True)# Get the rankingranking_statistic=result["d"]fdr=result["fdr"]logFC=result["logfc"]pvalue=result["p"]# Get the summary of result with FDR threshold of 0.05summary=get_summary(result,fdr_c=0.05)# Plot volcano plot from the resultsplot_rots(result,fdr=0.05,type="volcano")Methodsrots(...)Runs the ROTS analysis on the given data. Returns a Python dictionary.Parametersdata: A pandas dataframe with genes/proteins as rows and samples as columns. (required)group: A pandas series with the group labels for each sample. (required)B: Number of permutations to perform. Default is 500. (optional)K: Top-list size. (optional)paried: Whether the samples are paired. Default is False. (optional)seed: Seed for the random number generator. Default is None. (optional)a1: Parameter for the ROTS statistic. If both a1 and a2 are specified optimization step is skipped. (optional)a2: Parameter for the ROTS statistic. If both a1 and a2 are specified optimization step is skipped. (optional)log: Whether data is log-transformed. Default is False. (optional)progress: Whether to show a progress bar. Default is False. (optional)verbose: Whether to print the progress of the analysis. Default is False. (optional)ReturnsPythondictobject with the following keys:data: The original dataframe used for the inputB: Number of permutationsd: ROTS test statistic for each gene/proteinlogfc: Log2 fold changep: P-valueFDR: False Detection Ratea1: Optimized parameter a1a2: Optimized parameter a2k: Top list size (Noneif optimization skipped)R: Reproducibility score (Noneif optimization skipped)Z: Z-score (Noneif optimization skipped)ztable: Z-score tablecl: Group labels for each sampleget_summary(...)Returns a summary of the ROTS results.Parametersrots_res: The result of therotsfunction. (required)fdr_c: The FDR threshold for the summary. Default isNone(required ifn_featuresis not specified)n_features: The number of top rows to show in the summary. Default isNone(required iffdris not specified)verbose: Whether to print the summary. Default isTrue(optional)ReturnsA pandas dataframe with the following columns:Row: The row names of the input dataframeROTS Statistic: The ROTS statistic for each rowpvalue: The p-value for each rowFDR: The FDR for each rowplot(...)Plots the ROTS results.Parametersrots_res: The result of therotsfunction. (required)fdr: The FDR threshold for the plot. Default is0.05(required)type: The type of plot to generate. (required)"volcano""heatmap""ma""reproducibility""pvalue""pca"AcknowledgementsThis package was developed as part of theEDISSprogram in collaboration with Coffey Lab at theTurku Biosciencecenter.Changelog1.4.0Added support for Python 3.9 on Linux1.3.0Added support for Python 3.8 on Linux1.2.0Addedget_summaryfunctionAddedplot_rotsfunctionModified the import statement tofrom rotspy import ...More optimizationsBug fixes1.1.0Ported parts of code to Cython for better performanceFixed bugs1.0.3Bug fixes1.0.2Bug fixesAdded numba for better performance1.0.0Initial release