Coder Social home page Coder Social logo

linket's People

Contributors

hy4m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

linket's Issues

issue in using different distance matrix for mantel test ()

I want give bray curtis distance in spec_dist and euclidean distance in env_dist but unfortunately I unable to give and it automatically taking euclidean distance for both the data. How to set different distance matrix for both the data in matel_test() function.

rand_forest() error

library(linkET)
data("varespec", package = "vegan")
data("varechem", package = "vegan")
random_forest(varespec[1:3], varechem[1:3])
#> Error:  'rp.importance' is not an exported object from 'namespace:rfPermute'

Created on 2021-10-11 by the reprex package (v2.0.1)

cov/cor中有遗漏值

想请问一下大家,一开始我的环境数据有缺失,默认参数时
mantel_test() using 'euclidean' dist method for 'spec'.
mantel_test() using 'euclidean' dist method for 'env'.
我尝试着设置spec_dist = "bray", env_dist = "euclidean",这时候报错
Error in purrr::pmap():
ℹ In index: 1.
Caused by error in cor():
! cov/cor中有遗漏值
Run rlang::last_trace() to see where the error occurred.
Warning messages:
1: In .FUN(.data, ...) : you have empty rows: their dissimilarities may be
meaningless in method “bray”
2: In .FUN(.data, ...) : missing values in results
我的丰度数据是没有任何缺失值的。我把环境数据里的缺失值填补了,却还是不能实现丰度数据采用'bray',环境数据采用'euclidean',这是为什么呢

当设置extra_mat参数时报错

library(linkET)
correlate(mtcars) %>% 
  qcorrplot(extra_mat = list(extra = matrix(1, nrow = 11, ncol = 11))) +
  geom_square()
#> Error in as_md_tbl(data, ...): 参数没有用(extra_mat = list(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)))

Created on 2021-09-23 by the reprex package (v2.0.0)

How to deal with the dataframe with NA?

Hi Houyun,

I want to see the correlation between two dataframe using linkET, but one dataframe has missing values - NA.

Should I move out the rows with NA? Or replace the NA using 0?
What I am doing now is to replace the NA with 0, but not sure if it is right.

Could you give me some suggestions?

Best,

Bing

namespace ‘vctrs’ 0.5.1 is already loaded, but >= 0.5.2 is required

Hi Houyun,

When I try to load the linkET package --- library(linkET) today, error shown as below.
Error
namespace ‘vctrs’ 0.5.1 is already loaded, but >= 0.5.2 is required

I tried to reinstall the linkET package and the vctrs package, but failed.
install.packages("devtools")
devtools::install_github("Hy4m/linkET", force = TRUE)
install.packages("vctrs")

What can I do for this problem?

Best,

Bing

实现更复杂的连接

嗨, @Hy4m ,这不算一个issue,只是请教您一个问题,这个linkET包可否实现下图这种更为复杂的连接,这是一篇文献中给出的mantel分析结果图,文中并未给出作图代码,有可能是AI拼接成的图。如果现有的版本无法实现的话,就当作一个建议吧,如果可以分组连接到corrplot的两个轴上,会是一个非常实用且酷的功能,everything is linkable, hhh。谢谢啦!
bed74c291317c4735e7437889685d19

Multiple results for CFLAGS found, something is wrong.FALSE

从Github安装失败:错误: Failed to install 'linkET' from GitHub:
Multiple results for CFLAGS found, something is wrong.FALSE
以下是我的版本信息:
_
platform aarch64-apple-darwin20
arch aarch64
os darwin20
system aarch64, darwin20
status
major 4
minor 2.3
year 2023
month 03
day 15
svn rev 83980
language R
version.string R version 4.2.3 (2023-03-15)
nickname Shortstop Beagle

我从您的GitHub库也没找到tar.gz源文件,请问您这怎么解决?

聚类时报错

library(linkET)
as_matrix_data(mtcars, cluster = "all")
#> Error in attr(x, i) <- attrs[[i]]: cannot set attribute on a symbol

Created on 2021-09-26 by the reprex package (v2.0.0)

Caused by error in `spec_dist()`: ! could not find function "spec_dist"

Hi,

Thank you for this great package!

I use your code example (linkET v.0.07.1) below:

mantel_test(varespec, varechem,
spec_select = list(spec01 = 1:5, spec02 = 6:12))
'mantel_test()' using 'bray' dist method for 'spec'.
'mantel_test()' using 'euclidean' dist method for 'env'.

which applies bray to spec.

However, on my 16S amplicon dataset, I would like to manually specify the distance for spec and chem becaue by default it always applies euclidean distances to my species data but I want to use Bray-Curtis.

In the help manual to mantel_test(), I found that you can specify spec_dist = and env_dist =, however, the function dist_func() does not seem to offer the usually applied distances found in e.g. vegan::vegdist(method = "bray").

Could you please provide an example of how to specify e.g. Bray-Curtis using dist_func().
Also when looking up the help page for dist_func() one gets redirected to gdist(), without a clear explanation of how they relate and are supposed to be implemented in the mantel_test().

Thank you for helping and for sharing your expertise!

How can I use the subscription or superscription in LinkET

as the title, and i had tried several ways to achieve this.

  • scale_x_discrete: not in avail. And there are glaring wrong with the square.
  • ggtext::markdown: not in avail.
  • linkET::element_formula: with parse=T, there is nothing change with the orgin label, that is, remain displaying CO[2] on the figure.
  • linkET::latex_formula: not in avail. this function change CO[2] to CO *'['*, 2, *']'* and then just straightfoward display in the figure.

here's the figure with problem, and code attach it. Figure is the result when try the function ggtext::element_markdown and scale_x_discrete as description above.
github issues

qcorrplot(correlate(na.omit(eda.lon[,3:9])), type = "lower", diag = F)+
  geom_square() +
  # geom_tile()+
  scale_x_discrete(labels = eda.abbr)+
  scale_y_discrete(labels = eda.abbr)
  geom_couple(aes(colour = pd, size = rd), 
              data = mantel.mod, 
              curvature = nice_curvature()) +
  # geom_mark(r = NA,size = 3,only_mark = T)+
  scale_fill_gradientn(colours = RColorBrewer::brewer.pal(11, "RdBu"),breaks = seq(1, -1, -0.4),limits = c(-1,1)) +
  scale_size_manual(values = c(0.5, 1, 2)) +
  scale_colour_manual(values = color_pal(3)) +
  guides(size = guide_legend(title = "Mantel's r",
                             override.aes = list(colour = "grey35"), 
                             order = 2),
         colour = guide_legend(title = "Mantel's p", 
                               override.aes = list(size = 3), 
                               order = 1),
         fill = guide_colorbar(title = "Pearson's r", order = 3))+
  theme(
    axis.text = element_markdown(color = "black",size = 10))

Unsure about the mantel test result

Hi Houyun,

I carefully looked into the changing trend of my two matrixes, and not sure my command lines were right. So, could you please help me have a check? I attached my data and code.

data_and_code.zip

Thank you very much.

Best,

Bing

关于geom_square函数设定数据范围的问题

您好,我在绘制mantel test相关性热图的时候没有展示对角线上的相关性数据,但是这让我的相关性热图的方块都很小。我的相关性热图的相关性系数范围时-0.2到0.2(排除了对角线上的相关系数),现在我想将geom_square的范围调到-0.2到0.2之间,我应该怎么做呢?

can we set spec_dist to none when the input is bray distance?

Hi,

As you mentioned in other posts, the row sum of the OTU table can not be zero in order to use the bray distance in the mantel_test().

I checked the out table I am working with, and there was no zero row sum:

> sum(rowSums(otuITS.OR) == 0)
[1] 0

Still encountered the error:

Error in `purrr::pmap()`:
ℹ In index: 1.
Caused by error in `cor()`:
! missing observations in cov/cor
Run `rlang::last_trace()` to see where the error occurred.
Warning messages:
1: In .FUN(.data, ...) : you have empty rows: their dissimilarities may be
                 meaningless in method “bray”
2: In .FUN(.data, ...) : missing values in results

With this, I wondered whether we could calculate bray distance and use this matrix as input for the mantel_test? - I did not get an error for using the vegdist() to calculate the bray distance. Also, does the mantel_test scale for the env matrix?

Maybe something like this:

dist16S = as.matrix(vegdist(otu16S, method = "bray", upper = T, diag = T))
mantest.16S = mantel_test(
  spec = dist16S,
  env = scale(soilprop16S),
  spec_dist = "none",
  env_dist = "euclidean",
)

Thank you,
Xiao

Need a cor_tbl.

When i use the example for qcorrplot
correlate(mtcars) %>% as_md_tbl() %>% qcorrplot()
it's return :
Error: Need a cor_tbl.

How to add significant level stars in qcorrplot function?

Hi,

This linkET is fantastic!When I use this package to draw a basic correlation heatmap, I want to add significant level stars on the color blocks to represent the P-values, but I have not been successful. Could you help me check if this package can achieve this? I would greatly appreciate any response from you.

Data volume

Hello, I would like to inquire if the linkET package can run a data volume of over 20000 lines?

what methods to calculate the correlation (r) and p.value in Mantel_test()

Thanks for your great package!

When I perform a mantel_test analysis using the default parameters (mantel_fun = "mantel"), I am a little confused as to how the correlation r-values ​​and p-values ​​are calculated.
After checking the source code, I guessed that the Pearson was used. If so, I would like to know if other methods can be used to calculate the correlation, such as Spearman.

PS: I also tried adding "method='spearman'" to the mantel_test function, but the step ran for more than 2 hours with no results. On the contrary, without adding this parameter, it only took half an hour to complete.

Thanks in advance for your help!

Best!
xiaojjia

Feature requirement for showing the positive or negative correlation in the plot

Hi Houyun,

Could you add one feature requirement to show the negative correlation using the dotted curves and the positive correlation using the solid curves? Then it will be easier for people to directly see the negative or positive correlation between two matrixes.

For now, all my correlated curves are solid.
image

Best,

Bing

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.