chr1swallace / coloc

Repo for the R package coloc
144 stars 44 forks source link

check_dataset #72

Closed MoMaz123 closed 2 years ago

MoMaz123 commented 2 years ago

Hi, I am trying to use my.res <- finemap.abf(dataset=D1,p1 = 1e-04), now preparing the dateset, with

beta <- read.csv("C:/Users/xxxx/Desktop/beta.csv") varbeta <- read.csv("C:/Users/xxxx/Desktop/varbeta.csv") MAF <- read.csv("C:/Users/xxxx/Desktop/MAF.csv") LD <- read.csv("C:/Users/xxxx/Desktop/LD.csv", row.names=1)

list_of_df <- list(beta,varbeta, "N" = 18000,"sdY" = 7,"type" = 'quant', MAF, LD)

names(list_of_df) <- c("beta","varbeta", "N" = 18000,"sdY" = 7,"type" = 'quant', "MAF", "LD")

check_dataset(list_of_df)

but having this error

Error in check_dataset(list_of_df) : dataset : MAF should be a numeric, strictly >0 & <1

please advise, thanks.

chr1swallace commented 2 years ago

It says that some of your MAF values are either not numeric or are <=0 or are >= 1

On Thu, 2022-01-13 at 02:55 -0800, MoMaz123 wrote:

Hi, I am trying to use my.res <- finemap.abf(dataset=D1,p1 = 1e-04), now preparing the dateset, with beta <- read.csv("C:/Users/xxxx/Desktop/beta.csv") varbeta <- read.csv("C:/Users/xxxx/Desktop/varbeta.csv") MAF <- read.csv("C:/Users/xxxx/Desktop/MAF.csv") LD <- read.csv("C:/Users/xxxx/Desktop/LD.csv", row.names=1) list_of_df <- list(beta,varbeta, "N" = 18000,"sdY" = 7,"type" = 'quant', MAF, LD) names(list_of_df) <- c("beta","varbeta", "N" = 18000,"sdY" = 7,"type" = 'quant', "MAF", "LD") check_dataset(list_of_df) but having this error Error in check_dataset(list_of_df) : dataset : MAF should be a numeric, strictly >0 & <1 please advise, thanks. — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.Message ID: @.***>

MoMaz123 commented 2 years ago

thanks, that inst accurate because:

str(MAF) 'data.frame': 100 obs. of 1 variable: $ EA_FREQ: num 0.000833 0.005551 0.002558 0.13733 0.000172 ...

right?

chr1swallace commented 2 years ago

MAF is supposed to be of class numeric, you have a data.frame

On Thu, 2022-01-13 at 03:00 -0800, MoMaz123 wrote:

thanks, that inst accurate because:

str(MAF) 'data.frame': 100 obs. of 1 variable: $ EA_FREQ: num 0.000833 0.005551 0.002558 0.13733 0.000172 ... right? — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

MoMaz123 commented 2 years ago

Thanks indeed, now I have done:

MAF <- as.vector(MAF [,1]) str(MAF)

also changed the LD to matrix LD=data.matrix(LD) now I am having this error,

check_dataset(list_of_df) Error in check_dataset(list_of_df) : dataset : lengths of inputs don't match:

MoMaz123 commented 2 years ago

they all having the same length,

str(beta) 'data.frame': 100 obs. of 1 variable: $ BETA: num 0.2305 -0.0634 0.012 0.0232 -0.5869 ... str(varbeta) 'data.frame': 100 obs. of 1 variable: $ SE: num 0.2474 0.0762 0.1222 0.0154 0.4904 ... str(MAF) num [1:100] 0.000833 0.005551 0.002558 0.13733 0.000172 ... dim(LD) [1] 100 100

chr1swallace commented 2 years ago

what is length(beta)?

On Thu, 2022-01-13 at 03:37 -0800, MoMaz123 wrote:

they all having the same length,

str(beta) 'data.frame': 100 obs. of 1 variable: $ BETA: num 0.2305 -0.0634 0.012 0.0232 -0.5869 ... str(varbeta) 'data.frame': 100 obs. of 1 variable: $ SE: num 0.2474 0.0762 0.1222 0.0154 0.4904 ... str(MAF) num [1:100] 0.000833 0.005551 0.002558 0.13733 0.000172 ... dim(LD) [1] 100 100 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

MoMaz123 commented 2 years ago

length(beta) [1] 1

chr1swallace commented 2 years ago

which is not the same as length(MAF). which is what the error says

On Thu, 2022-01-13 at 03:40 -0800, MoMaz123 wrote:

length(beta) [1] 1 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

MoMaz123 commented 2 years ago

Great thanks for pointing out, how can I solve this issues, please.

MoMaz123 commented 2 years ago

that solved, now another one is apear,

Error in check_dataset(dataset, "") : LD rownames != colnames

MoMaz123 commented 2 years ago

beta <- read.csv("C:/Users/x/Desktop/beta.csv") str(beta) length(beta)

beta <- as.vector(beta [,1])

varbeta <- read.csv("C:/Users/x/Desktop/varbeta.csv") str(varbeta) length(varbeta)

varbeta <- as.vector(varbeta [,1])

MAF <- read.csv("C:/Users/x/Desktop/MAF.csv")

MAF <- as.vector(MAF [,1]) str(MAF) class(MAF) length(MAF)

LD <- read.csv("C:/Users/x/Desktop/LD.csv", row.names=1) LD=data.matrix(LD) dim(LD)

list_of_df <- list(beta,varbeta, "N" = 18000,"sdY" = 7,"type" = 'quant', MAF, LD)

names(list_of_df) <- c("beta","varbeta", "N" ,"sdY" , "type" , "MAF", "LD")

check_dataset(list_of_df)

having this error,

check_dataset(list_of_df) Error in check_dataset(list_of_df) : LD rownames != colnames

MoMaz123 commented 2 years ago

but they have the exact same name, Rows and Columns in the LD

chr1swallace commented 2 years ago

well the error says they don't. did you check? identical(rownames(LD),colnames(LD))

On Thu, 2022-01-13 at 04:01 -0800, MoMaz123 wrote:

but they have the exact same name, Rows and Columns in the LD — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

MoMaz123 commented 2 years ago

Great thanks, it's done now. just last question, the SNPs with the highest PP (SNP.PP) are the top hit? Thanks, mo

chr1swallace commented 2 years ago

assuming H4 is true

On Thu, 2022-01-13 at 05:15 -0800, MoMaz123 wrote:

Great thanks, it's done now. just last question, the SNPs with the highest PP (SNP.PP) are the top hit? Thanks, mo — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

MoMaz123 commented 2 years ago

sorry, what is H4?

chr1swallace commented 2 years ago

https://chr1swallace.github.io/coloc/articles/a03_enumeration.html

On Thu, 2022-01-13 at 05:33 -0800, MoMaz123 wrote:

sorry, what is H4? — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>