Comments (3)
I tried looking into this issue hoping that I could maybe fix if it was just a matter of switching 2 variable names. And found this in the documentation of the WGCNA class:
class WGCNA(GeneExp):
"""
A class used to do weighted gene co-expression network analysis.
[ . . . ]
:param anndata: if the expression data is in anndata format you should pass it through this parameter. X should be expression matrix. var is a sample information and obs is a gene information.
:param anndata: anndata
So :param anndata:
is repeated twice (the second time it should probably be :type anndata:
), but the documentation states that genes should be stored in the obs field and samples should be in the var field. It is a bit counterintuitive, because, as far as I know, it is usually the other way round (obs = samples and var = genes), but this could explain why they were switched in my previous example.
However in the PyWGCNA_object tutorial it is stated that the data is stored "in AnnData format which rows/obs are samples/sample information and cols/var are genes/gene information" and indeed it is shown that the .obs field contains samples and the .var field contains genes.
I'm a bit confused and don't know if I should transpose my data or not anymore, this can be easily solved by using dataframes instead of anndata objects, but maybe it should be clarified a bit more clearly since an anndata option is available?
from pywgcna.
Hi @lorenzoamir ,
Thank you for mentioning this!
I'll look into this matter in the next few days and update the related documents :)
meanwhile, as you mentioned you can pass data in separate tsv/csv files.
from pywgcna.
Hi @lorenzoamir,
Sorry for the confusion! I was trying to use mostly the similar function/format of input that has been used in the original WGCNA in R.
you were right about the API documentation part. I fixed the documentation so X should be an expression matrix. var is a gene information and obs is a sample information.
for goodSamplesGenes, if you look at the wrapper function (preprocess()
) for the preprocessing steps you can see that I transposed the expression matrix before passing it to the goodSamplesGenes()
function.
goodGenes, goodSamples, allOK = WGCNA.goodSamplesGenes(self.datExpr.to_df().T)
I just updated the documentation! It should reflect on the website in the next few minutes.
Sorry again for the confusion and thanks for pointing it out
Please feel free to reopen this issue if there is still a problem.
from pywgcna.
Related Issues (20)
- how to set figsize HOT 2
- SystemExit: All your genes ended up in one modules! Reconsider your input parameters in order to get more modules. HOT 6
- module_trait_relationships_heatmap HOT 4
- Pandas error HOT 4
- ask for some questions HOT 3
- Image too large. How suppress drawing when using pyWGCNA_obj.preprocess() ? HOT 3
- RecursionError when run pyWGCNA_ct.preprocess() HOT 1
- getDatTraits method might not be suitable for continuous traits. HOT 1
- How adjust parameter in functions??
- error experienced in tutorial HOT 6
- Doubt on application HOT 1
- What other methods to define metadata colors are allowed, besides color labels ('black', 'pink', etc)? HOT 1
- Seeking help on `order` Parameter Usage and Metadata Color Settings HOT 13
- a issue for findModules() HOT 3
- findModules() inappropriately passes all kwargs to pickSoftThreshold() and cuttreeHybrid() HOT 2
- Re-naming modules HOT 1
- In the module Network Plot, Can we label the node as gene_name instead of gene_id ? HOT 2
- Several errors when performing findModules steps individually HOT 8
- 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pywgcna.