Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module-Traits Relationship results: display NA in all cells! #4

Open
Yansong-weilab opened this issue Dec 27, 2023 · 7 comments
Open
Labels
FAQ Frequency Asked Question

Comments

@Yansong-weilab
Copy link

No description provided.

@Yansong-weilab Yansong-weilab changed the title method method 1 还会回归吗王老师 Dec 27, 2023
@Yansong-weilab
Copy link
Author

/
WGCNA在这一步没有显示模块基因和表型的相关性

@ShawnWx2019
Copy link
Owner

ShawnWx2019 commented Jan 25, 2024

这种情况一般是材料命名规则的问题,比如sample_name中包含了空格-等特殊字符,read.table读入R作为colname的时候会将这些特殊字符转译成. 比如你准备的表达量矩阵表格为:

GeneID sample 01 sample 02 sample 03
Gene01 123 345 3345
Gene02 123 2 123

read.table读入R之后会变为

GeneID sample.01 sample.02 sample.03
Gene01 123 345 3345
Gene02 123 2 123

但是trait data读入R后sample id作为column不会被转义

sample_id normal hot cold
sample 01 1 0 0
sample 02 0 1 0
sample 03 0 0 1

这样在计算相关性的时候根据表达量矩阵计算的eigengene矩阵的sample id的为sample.01 sample.02 sample.03, 而表型数据的sample id 为 sample 01 sample 02 sample 03, 这两项不匹配,所以都是NA。

要解决这个问题,要么将表达量矩阵中sample name规范化,不要用特殊字符,比如改写成sample_01 sample_02 sample_03, 下划线_是不会被转义的,要么将traitdata中的sample id中的特殊字符都换成., 总之统一一下就不会出错了

@ShawnWx2019 ShawnWx2019 added the FAQ Frequency Asked Question label Jan 25, 2024
@ShawnWx2019 ShawnWx2019 changed the title method 1 还会回归吗王老师 Module-Traits Relationship results: display NA in all cells! Jan 25, 2024
@ShawnWx2019
Copy link
Owner

Auto translated by GPT3

The issue here is typically related to the naming conventions of the data. For example, if the sample_name contains spaces, hyphens, or other special characters, the read.table function in R may interpret these special characters as periods when assigning them as column names. For instance, if your expression matrix table looks like this:

| GeneID | sample 01 | sample 02 | sample 03 |
|--------|-----------|-----------|-----------|
| Gene01 | 123       | 345       | 3345      |
| Gene02 | 123       | 2         | 123       |

After reading into R using read.table, it will become:

| GeneID | sample.01 | sample.02 | sample.03 |
|--------|-----------|-----------|-----------|
| Gene01 | 123       | 345       | 3345      |
| Gene02 | 123       | 2         | 123       |

However, when reading trait data into R, the sample ID is not escaped as a column name:

| sample_id | normal | hot | cold |
|-----------|--------|-----|------|
| sample 01 | 1      | 0   | 0    |
| sample 02 | 0      | 1   | 0    |
| sample 03 | 0      | 0   | 1    |

So, when calculating correlations, the sample IDs in the eigengene matrix calculated from the expression matrix are sample.01, sample.02, sample.03, while the sample IDs in the phenotype data are sample 01, sample 02, sample 03. These do not match, resulting in NA values.

To address this issue, you can either standardize the sample names in the expression matrix by avoiding special characters, for example, rewrite them as sample_01, sample_02, sample_03 (underscores are not escaped). Alternatively, you can replace special characters in the sample IDs of the trait data with periods. In summary, ensure consistency in naming conventions to avoid errors.

@YJchen1222
Copy link

您好,我也在Module-Traits Relationship 此步驟遇到問題。
我的問題是點選start analysis後,網頁沒有任何反應,TBtools-II跳出對話框顯示finished。
我已經檢查過任何輸入進去的數據,請問會是什麼原因導致的呢?

@ShawnWx2019
Copy link
Owner

您好,我也在Module-Traits Relationship 此步驟遇到問題。 我的問題是點選start analysis後,網頁沒有任何反應,TBtools-II跳出對話框顯示finished。 我已經檢查過任何輸入進去的數據,請問會是什麼原因導致的呢?

报错后将debug dialog中的信息粘贴过来

image

@YJchen1222
Copy link

YJchen1222 commented Mar 14, 2024

您好,後來仔細檢查trait data format有問題,才出現此問題。
感謝您的回覆。

@ShawnWx2019
Copy link
Owner

您好,後來仔細檢查trait data format有問題,才出現此問題。 感謝您的回覆。

嗯 后续会更新,目前只接受tab分割的txt,后续会通过bruceR import 函数自动判断类型来导入。等我有时间了更新一波吧....😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FAQ Frequency Asked Question
Projects
None yet
Development

No branches or pull requests

3 participants