pegasus.write_results_to_excel
- pegasus.write_results_to_excel(results, output_file, ndigits=3)[source]
Write DE analysis results into Excel workbook.
- Parameters
results (
Dict[str, Dict[str, pd.DataFrame]], orDict[str, Dict[str, Dict[str, pd.DataFrame]]]) – DE marker dictionary generated bypg.markers.output_file (
str) – File name to which the marker dictionary is written.ndigits (
int, optional, default:3) – Round non p-values and q-values tondigitsafter decimal point in the excel.
- Return type
None- Returns
NoneMarker information is written to file with name
output_file.In the generated Excel workbook, –
If
conditionisNoneinpg.de_analysis: Each tab stores DE result of up/down-regulated genes of cells within one cluster, and its name follows the pattern: “cluster_id|up” or “cluster_id|dn”.If
conditionis notNoneinpg.de_analysis: Each tab stores DE result of up/down-regulated genes of cells within one cluster under one condition level. The tab’s name follows the pattern: “cluster_id|cond_level|up” or “cluster_id|cond_level|dn”.Notice that the tab name in Excel only allows at most 31 characters. Therefore, some of the resulting tab names may be truncated if their names are longer than this threshold.
Examples
>>> pg.write_results_to_excel(marker_dict, "result.de.xlsx")