Package: mgwas-data-exploration-app
mGWAS data exploration app[!NOTE]
This tool was built forScoary2!DescriptionThis is a simple, static HTML/JS data exploration that allows you to explore the results of mGWAS software, particularly large phenotypic datasets.OutputThe app produces two types of HTML files that can be opened in any browser:overview.html: A simple overview of all traits in the dataset.trait.html: A more detailed view of a single trait.The usage of this app is described on the Scoary2wiki.InstallationUsing pip:pip install mgwas-data-exploration-appUsing docker:docker pull troder/scoary-2How to prepare your dataExpected folder structureThe app expects the following folder structure:.
└── workdir
    ├── summary.tsv
    ├── traits.tsv
    ├── tree.nwk
    ├── isolate_info.tsv (optional)
    └── traits
        ├── trait1
        │   ├── coverage-matrix.tsv
        │   ├── meta.json
        │   ├── result.tsv
        │   └── values.tsv
        ├── trait2
        │   └── ...
        └── ...Input argumentssummary_df: A table with the results of the mGWAS analysis. Rows: traits; columns: genes. (Separator: tab)traits_df: A table with the metadata of the traits. Rows: traits; columns: metadata. (Separator: tab)workdir: Folder where the mGWAS output must be located, exepect to find a folder 'traits' with subfolders for each trait.is_numeric: Whether the data is numeric or binary.app_config: A JSON file that overwrites the default app config. See the defaultconfig.json. (Optional)distance_metric: The distance metric for the clustering of binary data. See thescipy documentation.
(Binary data only; default: jaccard)linkage_method: The linkage method for the clustering. One of [single, complete, average, weighted, ward, centroid, median]. (Default: ward)optimal_ordering: Whether to use optimal ordering. Seescipy.cluster.hierarchy.linkage(Default: True)corr_scale: Whether to scale numeric data before clustering. (Numeric data only; default: True)corr_method: The correlation method for numeric data. One of [pearson, kendall, spearman]. (Numeric data only; default: pearson)dendrogram_x_scale: The x-axis scale for the dendrogram. One of [linear, squareroot, log, symlog, logit]. (Default: linear)scores_x_scale: The x-axis scale for the scores plot. One of [linear, manhattan]. (Default: linear)UsageGet help withmgwas-data-exploration-app --helpor reading the docstring ofmain.py.PythonClick here to expand.frommgwas_data_exploration_app.mainimportmgwas_appmgwas_app(summary_df="summary.tsv",# or a pandas.DataFrametraits_df="traits.tsv",# or a pandas.DataFrameworkdir="out",is_numeric=False,app_config="app_config.json",# or dictdistance_metric="jaccard",linkage_method="ward",optimal_ordering=True,corr_scale=True,corr_method="pearson",dendrogram_x_scale="linear",scores_x_scale="linear",)Command lineClick here to expand.mgwas-data-exploration-app\--summarysummary.tsv\--traitstraits.tsv\--workdirout\--is-numericFalse\--app-configNone\--distance-metricjaccard\--linkage-methodward\--optimal-orderingTrue\--corr-scaleTrue\--corr-methodpearson\--dendrogram-x-scalelinear\--scores-x-scalelinearCreditsThis project is built using the following libraries:PapaParsefor parsing the CSV filesBootstrapfor the layoutSlimSelectfor the dropdownsDataTablesandjQueryfor the tablesPlotlyfor the plotsPhylocanvasfor the phylogenetic treesChroma.jsfor the color scalesPopper.jsfor the tooltips