rondolab / MR-PRESSO

Performs the Mendelian Randomization Pleiotropy RESidual Sum and Outlier (MR-PRESSO) method.
83 stars 30 forks source link

Error in Ops.data.frame #2

Closed dongjt0727 closed 5 years ago

dongjt0727 commented 6 years ago

I want use it with my data, but always failed like this "Error in Ops.data.frame(data[, c(BetaOutcome, BetaExposure)], sign(data[, : ‘*’ only defined for equally-sized data frames"

rondolab commented 6 years ago

Hi, could you tell me more about the command you ran? Quick question, are you defining the arguments BetaOutcome, BetaExposure and SdOutcome, SdExposure as characters referring to the column names of the dataframe defined by the argument data. Best.

jean997 commented 6 years ago

I have also gotten this error. I am attaching some data that reproduces it. test_data_mrp.tsv.gz The commands I used are

library(readr)
library(MRPRESSO)
dat <- read_tsv("test_data_mrp.tsv.gz")
x <- mr_presso(BetaOutcome = "beta_hat_2", BetaExposure = "beta_hat_1",
              SdOutcome = "seb2", SdExposure = "seb1", OUTLIERtest = TRUE,
              DISTORTIONtest = TRUE, data = dat,
              NbDistribution = 1000,  SignifThreshold = 0.05)
jean997 commented 6 years ago

I think the problem comes from using tbl_df objects. I believe that as written, the mr_presso function is only compatible with data.frame.

rondolab commented 5 years ago

Thank you for your feedback, this is indeed the issue. The analysis runs if "dat" is converted to data.frame. x <- mr_presso(BetaOutcome = "beta_hat_2", BetaExposure = "beta_hat_1", SdOutcome = "seb2", SdExposure = "seb1", OUTLIERtest = TRUE, DISTORTIONtest = TRUE, data = as.data.frame(dat), NbDistribution = 1000, SignifThreshold = 0.05) We have added an error to avoid this issue. Best.

z-bluesky commented 8 months ago

I had the same problem when running the vlnplot and dimplot functions in the Seurat package: VlnPlot(scRNAlist[[i]], features = c("nFeature_RNA")) Error in Ops.data.frame(guide_loc, panel_loc) : ‘==’ only defined for equally-sized data frames But I use this line of code, restart the session and it works, finally!!!! remotes::install_github("thomasp85/patchwork")