Giter Site home page Giter Site logo

smith-chem-wisc / metanetwork Goto Github PK

View Code? Open in Web Editor NEW
8.0 6.0 5.0 126.36 MB

R 6.61% Dockerfile 0.01% HTML 71.57% CSS 0.53% Assembly 0.03% SAS 0.01% C 0.84% TeX 0.13% C++ 20.22% Makefile 0.01% Shell 0.01% Perl 0.01% JavaScript 0.04% Batchfile 0.01%

metanetwork's Introduction

MetaNetwork

Network analysis and visualization of proteomics data using weighted gene correlation network analysis. This file details how to run MetaNetwork. MetaNetwork's wiki contains an overview of the options available for MetaNetwork's WGCNA workflow and a vignette that details how to use and interpret MetaNetwork's results.

How to Run MetaNetwork

(Reccomended) Run from Docker

  1. Download Docker compatible with your operating system.
  2. Open Terminal (Mac) or Powershell (Windows).
  3. Run the following code to download and launch MetaNetwork:
docker pull avc167/metanetwork:latest

docker run -p 3838:3838 avc167/metanetwork:latest

Open a web browser and type localhost:3838 (Windows) or 0.0.0.0:3838 into the search bar. MetaNetwork will now be visible.

IMPORTANT NOTE FOR MAC USERS

Docker for MacOS requires users to allocate memory for its processes. If not enough memory is allocated to MetaNetwork, it will crash without warning or throwing an error message while processing data. To increase the amount of memory allocated to MetaNetwork, you must open the Docker Desktop application and navigate to settings (circled in red in the below image): image

Then click Resources, and use the slider to increase the amount of memory and/or CPUs allocated to MetaNetwork's processes. Typically 10 GB of memory enables an analysis of ~8000 proteins without memory issues. image

Using MetaNetwork

When running MetaNetwork for the first time, it will take a few moments to load the necessary R packages. The GUI will then be visible. image

While running MetaNetwork, the R console will contain all the messages and any potential errors occuring. Once MetaNetwork is finished running, it will automatically generate plots and data tables in the WGCNA Diagnostics, Module Eigenprotein Analysis, g:Profiler Enrichment, and Data Analysis tabs. The data will also be downloadable under the Download tab.

MetaNetwork Workflow

Uploading data file

The data file should be in the format of UniProt Accessions, any optional identifiers (like gene symbol for example), then data, as shown in the example below. image

In the example, the first column is Accessions, and the following columns are data. The heading is the name of the sample. The first column must have a heading of "Accession."

Uploading experimental groups file

The experimental groups file should contain one column of sample identifiers and one column of experimental groups. These columns must be labeled as SampleID and Experiment. The column labeled SampleID must be matched to the column heading for the columns in the data file, as seen in the image below. image

The second columns, Experiment, lists the experimental condition to which the sample belongs.

Uploading UniProt Data Table File

Finally, the UniProt Data Table upload should be a .tsv or .tab file downloaded from UniProt containing an Entry column, Protein name column, and Gene name column. image

Other ways to run MetaNetwork

(Not recommended) Installing and running MetaNetwork via RStudio (Windows and MacOS)

  1. Install RStudio
  2. Type the following commands into the console of RStudio to run MetaNetwork on either Windows or MacOS:
if(!require(shiny)) install.packages("shiny", dependencies = TRUE)
shiny::runGitHub("MetaNetwork", "smith-chem-wisc")

image

(Not recommended) Installing and running MetaNetwork via RGui

  1. Please see instructions below for setting up Pandoc in the system environment.
  2. Then, MetaNetwork will be ready to run using the following commands:
install.packages("shiny") 
shiny::runGitHub("MetaNetwork", "smith-chem-wisc")

image

System Requirements

MetaNetwork requires:

  • R 4.0.2 or later
  • RStudio 1.3.1073 (optional but recommended)

MacOS

On MacOS, we recommend using RStudio to run MetaNetwork because the install.pandoc() command is not supported, complicating Pandoc installation. Fortunately, RStudio is packaged with its own Pandoc, so MetaNetwork will be fully functional on MacOS.

Windows

If running in the RGui, MetaNetwork requires the installation of (Pandoc)[https://pandoc.org/] and (Rtools)[https://cran.r-project.org/bin/windows/Rtools/]. For Windows computers, run the following code in RGui to install Pandoc:

install.packages(c("installr", "rmarkdown"))
installr::install.pandoc()

Pandoc will begin downloading and require a restart before MetaNetwork will function correctly. After the computer is restarted, open RGui again and run.

rmarkdown::find_pandoc()

This command should return the version and location of the Pandoc installation.

For Anaconda users: Due to a bug in RStudio, installations of RStudio from conda will not be able to find the Pandoc folder. As a result, we recommend downloading RStudio directly from the RStudio website.

metanetwork's People

Contributors

avcarr2 avatar trishorts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

metanetwork's Issues

Nice job 👍🏻

Dear team, the project looks pretty good, awesome job! I'll have to include it in my functional analysis workflows.

Keep up with the good work!

When some genes are constant, error in displaying TOM Plot

I noticed that if you get the console warning saying (paraphrased), "Some genes are constant. Considering removing", you will also throw an error in the TOM Plot. The error indicates that the number of colors in the color bar on the left-hand side of the tom plot does not match the number of colors in the top bar.

I believe that it is related to the constant columns of genes, because the vignette data, which contains no constant measurements, works normally.

Need to implement a function that removes constant columns and see if that fixes the issue.

For now, the "beer-analysis" branch has disabled the TOM plots.

New to MetaNetwork

I have tried to follow the instructions for installing and using the software on R , it seems to me without problems, but I can not see the results. I don't understand why. I enclose the processes of R

rmarkdown::find_pandoc()
$version
[1] ‘2.12’

$dir
[1] "C:/PROGRA3/ANACON1/Scripts"

install.packages("shiny")
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/shiny_1.6.0.zip'
Content type 'application/zip' length 5473411 bytes (5.2 MB)
downloaded 5.2 MB

package ‘shiny’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Administrator\AppData\Local\Temp\2\Rtmpms46z1\downloaded_packages

shiny::runGitHub("MetaNetwork", "smith-chem-wisc")
Downloading https://github.com/smith-chem-wisc/MetaNetwork/archive/master.tar.gz
Loading required package: shiny
Loading required package: tidyverse
-- Attaching packages ------------------- tidyverse 1.3.1 --
v ggplot2 3.3.5 v purrr 0.3.4
v tibble 3.1.2 v dplyr 1.0.7
v tidyr 1.1.3 v stringr 1.4.0
v readr 1.4.0 v forcats 0.5.1
-- Conflicts ---------------------- tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
Loading required package: BiocManager
Bioconductor version 3.13 (BiocManager 1.30.16), R 4.1.0
(2021-05-18)
Loading required package: devtools
Loading required package: usethis

Attaching package: ‘devtools’

The following object is masked from ‘package:BiocManager’:

install

Loading required package: WGCNA
Loading required package: dynamicTreeCut
Loading required package: fastcluster

Attaching package: ‘fastcluster’

The following object is masked from ‘package:stats’:

hclust

Attaching package: ‘WGCNA’

The following object is masked from ‘package:stats’:

cor

Loading required package: openxlsx
Loading required package: pheatmap
Loading required package: plotly

Attaching package: ‘plotly’

The following object is masked from ‘package:ggplot2’:

last_plot

The following object is masked from ‘package:stats’:

filter

The following object is masked from ‘package:graphics’:

layout

Loading required package: shinythemes
Loading required package: shinyWidgets
Loading required package: gprofiler2
Loading required package: ggdendro
Loading required package: withr
Loading required package: zip

Attaching package: ‘zip’

The following objects are masked from ‘package:utils’:

unzip, zip

Loading required package: rmarkdown
'getOption("repos")' replaces Bioconductor standard
repositories, see '?repositories' for details

replacement repositories:
CRAN: https://cran.rstudio.com/

Creating a new generic function for ‘data’ in the global environment
Creating a new generic function for ‘plotDendroAndColors’ in the global environment
Creating a new generic function for ‘gost’ in the global environment
Creating a new generic function for ‘gostplot’ in the global environment

Listening on http://127.0.0.1:7518

-- Column specification ---------------------------------------------
cols(
.default = col_double(),
Accession = col_character(),
Gene = col_character()
)
i Use spec() for the full column specifications.

-- Column specification ---------------------------------------------
cols(
SampleID = col_character(),
ExperimentalGroup = col_character()
)

-- Column specification ---------------------------------------------
cols(
.default = col_double(),
Accession = col_character(),
Gene = col_character()
)
i Use spec() for the full column specifications.

-- Column specification ---------------------------------------------
cols(
SampleID = col_character(),
ExperimentalGroup = col_character()
)

-- Column specification ---------------------------------------------
cols(
Entry = col_character(),
Protein names = col_character(),
Gene names = col_character(),
Organism = col_character(),
Status = col_character(),
Gene ontology (biological process) = col_character(),
Gene ontology (cellular component) = col_character(),
Gene ontology (molecular function) = col_character(),
Gene ontology IDs = col_character()
)

pickSoftThreshold: will use block size 1407.
pickSoftThreshold: calculating connectivity for given powers...
..working on genes 1 through 1407 of 1407
Power SFT.R.sq slope truncated.R.sq mean.k. median.k. max.k.
1 1 0.237 0.998 0.892 372.000 377.0000 551.00
2 2 0.115 -0.403 0.820 147.000 143.0000 298.00
3 3 0.502 -0.884 0.899 70.700 64.3000 186.00
4 4 0.667 -1.140 0.935 38.400 31.6000 126.00
5 5 0.748 -1.300 0.948 22.700 16.9000 90.60
6 6 0.797 -1.370 0.968 14.200 9.4700 67.50
7 7 0.800 -1.470 0.968 9.360 5.5800 51.70
8 8 0.820 -1.520 0.972 6.400 3.4000 40.60
9 9 0.850 -1.540 0.984 4.510 2.1200 32.50
10 10 0.852 -1.560 0.982 3.260 1.3400 26.40
11 12 0.859 -1.620 0.967 1.810 0.5900 18.20
12 14 0.848 -1.680 0.942 1.070 0.2660 13.00
13 16 0.315 -2.660 0.293 0.669 0.1270 9.63
14 18 0.319 -2.580 0.306 0.435 0.0657 7.31
15 20 0.895 -1.690 0.976 0.292 0.0331 5.66
Calculating module eigengenes block-wise from all genes
Flagging genes and samples with too many missing values...
..step 1
..Working on block 1 .
Warning in WGCNA::blockwiseModules(cleaned_data@Data[, -1], power = parameters@power, :
NAs introduced by coercion
TOM calculation: adjacency..
..will not use multithreading.
Fraction of slow calculations: 0.000000
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
....clustering..
....detecting modules..
..done.
....calculating module eigengenes..
moduleEigengenes : Working on ME for module 1
moduleEigengenes : Working on ME for module 2
moduleEigengenes : Working on ME for module 3
moduleEigengenes : Working on ME for module 4
moduleEigengenes : Working on ME for module 5
moduleEigengenes : Working on ME for module 6
moduleEigengenes : Working on ME for module 7
moduleEigengenes : Working on ME for module 8
moduleEigengenes : Working on ME for module 9
moduleEigengenes : Working on ME for module 10
moduleEigengenes : Working on ME for module 11
moduleEigengenes : Working on ME for module 12
moduleEigengenes : Working on ME for module 13
....checking kME in modules..
..removing 20 genes from module 1 because their KME is too low.
..removing 17 genes from module 2 because their KME is too low.
..removing 10 genes from module 3 because their KME is too low.
..removing 1 genes from module 4 because their KME is too low.
..removing 33 genes from module 5 because their KME is too low.
..removing 9 genes from module 6 because their KME is too low.
..removing 5 genes from module 7 because their KME is too low.
..removing 6 genes from module 8 because their KME is too low.
..removing 5 genes from module 9 because their KME is too low.
..removing 2 genes from module 11 because their KME is too low.
..merging modules that are too close..
mergeCloseModules: Merging modules whose distance is less than 0.25
multiSetMEs: Calculating module MEs.
Working on set 1 ...
moduleEigengenes: Calculating 14 module eigengenes in given set.
multiSetMEs: Calculating module MEs.
Working on set 1 ...
moduleEigengenes: Calculating 12 module eigengenes in given set.
Calculating new MEs...
multiSetMEs: Calculating module MEs.
Working on set 1 ...
moduleEigengenes: Calculating 12 module eigengenes in given set.
Coordinate system already present. Adding new coordinate system, which will replace the existing one.
summarise() has grouped output by 'ExperimentalGroup'. You can override using the .groups argument.
TOM calculation: adjacency..
..will not use multithreading.
Fraction of slow calculations: 0.000000
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.

Location of Non-data columns parameter

Hello. In the MetaNetwork Wiki the workflow step , Data file format, indicates that there exists somewhere a setting one can change to indicate how many non-data columns there are. This seems to default to 1 but I would like to have for example Gene names and Protein names in the data file following the Accession column. Where can I set this value to e.g. 3? It doesn't appear in the web browser GUI.

I'm running Linux Mint v20.3 and have used the latest Docker to run MetaNetwork. Browser is FireFox, latest version.

Best regards,
Brian

Rastering/anti-aliasing error in TOM plot

This issue is created to address the bug where the TOM plot is generated with a white line running across it. I've looked into this pretty deeply, but I can't figure out where the error is coming from. There are three possibilities:

  1. The error is caused by the R graphics device.
  2. The error is caused by an interaction between the internet browser that MetaNetwork is running in and R.
  3. The error is completely caused by the internet browser in which MetaNetwork is running.

I haven't personally encountered this issue yet, but it has been reported a few times. I am using Google Chrome as the browser in which MetaNetwork is running. I will continue looking into this bug. It appears that the TOM plot is the only one running into this issue. It is also the only plot output as a png file rather than a pdf. I'm going to change the TOM plot output file extension to jpg and see if that solves the issue by bypassing any issues with png file writing.

Issues connecting to g:Profiler via the gprofiler2 package api

User currently experiencing a series of errors.

  1. Error 500 from the g:Profiler server. I sent in a support ticket, and the issue was fixed on the g:Profiler server.
  2. Warning: Error in : Empty reply from server. Support ticket submitted.
  3. Error 400 from the server.

The issue is entirely on the g:Profiler side of the server, which points to the larger issue of relying on a large chunk of code for the gene ontology enrichment analysis portion of MetaNetwork's workflow that we don't maintain ourselves. There's no way that we can port a version of g:Profiler into the MetaNetwork Docker container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.