chr1swallace / coloc

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

Issue with plotting #89

Closed bethleegy closed 1 year ago

bethleegy commented 2 years ago

Hi there,

I am trying to plot the coloc.abf object as per the S3 method for class 'coloc_abf' mentioned in the vignette. However, after I have the coloc.abf run and save as an object without any issues, when I run plot(coloc_object) I get the following error:

Error in:=(c("z", "df"), tstrsplit(variable, "\\.")) : Check that is.data.table(DT) == TRUE. Otherwise, := and:=(...) are defined for use in j, once only and in particular ways. See help(":="). In addition: Warning messages: 1: In melt(x, id.vars = c("snp", "position"), measure.vars = grep("z.df", : The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(x). In the next version, this warning will become an error. 2: In melt(x, id.vars = c("snp", "position"), measure.vars = grep("PP", : The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(x). In the next version, this warning will become an error.

Any insight would be appreciated. Thank you!

chr1swallace commented 2 years ago

I'm afraid I don't see this error with my test data. Could you please share the object you are trying to plot, so I can debug? Thanks.


From: bethleegy @.> Sent: 31 May 2022 22:57 To: chr1swallace/coloc @.> Cc: Subscribed @.***> Subject: [chr1swallace/coloc] Issue with plotting (Issue #89)

Hi there,

I am trying to plot the coloc.abf object as per the S3 method for class 'coloc_abf' mentioned in the vignette. However, after I have the coloc.abf run and save as an object without any issues, when I run plot(coloc_object) I get the following error:

Error in :=(c("z", "df"), tstrsplit(variable, "\.")) : Check that is.data.table(DT) == TRUE. Otherwise, := and :=(...) are defined for use in j, once only and in particular ways. See help(":="). In addition: Warning messages: 1: In melt(x, id.vars = c("snp", "position"), measure.vars = grep("z.df", : The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(x). In the next version, this warning will become an error. 2: In melt(x, id.vars = c("snp", "position"), measure.vars = grep("PP", : The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is deprecated, and this redirection is now deprecated as well. To continue using melt methods from reshape2 while both libraries are attached, e.g. melt.list, you can prepend the namespace like reshape2::melt(x). In the next version, this warning will become an error.

Any insight would be appreciated. Thank you!

— Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fchr1swallace%2Fcoloc%2Fissues%2F89&data=05%7C01%7Ccew54%40universityofcambridgecloud.onmicrosoft.com%7C16c5d66a09dd4430fb6508da4350affd%7C49a50445bdfa4b79ade3547b4f3986e9%7C0%7C0%7C637896311068317533%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SdZNiAaSkeQbon80eWWOt7p19EnshJX4JEcnaKZkbaQ%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAQWR2D5DMLGB7UIVU6FOHDVM2DOBANCNFSM5XO6NBWA&data=05%7C01%7Ccew54%40universityofcambridgecloud.onmicrosoft.com%7C16c5d66a09dd4430fb6508da4350affd%7C49a50445bdfa4b79ade3547b4f3986e9%7C0%7C0%7C637896311068317533%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OIwxiUuovHFlkJMvT3CkjR4TNb%2Fhq5WMJqwY2SR8tQo%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

bethleegy commented 2 years ago

Thank you for the response.

The coloc object as an RDa is attached here: https://drive.google.com/file/d/1bXem88hdT2P74k4XgG5pN9SAvLrDOIVf/view?usp=sharing

bethleegy commented 2 years ago

Hi there! I was able to debug by converting m and m2 into a data.table. After the melt m and m2 were data frames and not data tables which caused the error with :=. I hope this helps!

chr1swallace commented 1 year ago

thank you so much for debugging - I will make the change in the method.


From: bethleegy @.> Sent: 28 June 2022 19:54 To: chr1swallace/coloc @.> Cc: Chris Wallace @.>; Comment @.> Subject: Re: [chr1swallace/coloc] Issue with plotting (Issue #89)

Hi there! I was able to debug by converting m and m2 into a data.table. I hope this helps!

— Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fchr1swallace%2Fcoloc%2Fissues%2F89%23issuecomment-1169104286&data=05%7C01%7Ccew54%40universityofcambridgecloud.onmicrosoft.com%7C16c3c53779f8422253d908da5937bdd3%7C49a50445bdfa4b79ade3547b4f3986e9%7C0%7C0%7C637920393181161822%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=q2ws6zXD0jFoagffzt9c5MgGXcPBP%2BcCaEDLtSvvdIw%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAQWR2AINPKS2DDDPYO3OVDVRNC7JANCNFSM5XO6NBWA&data=05%7C01%7Ccew54%40universityofcambridgecloud.onmicrosoft.com%7C16c3c53779f8422253d908da5937bdd3%7C49a50445bdfa4b79ade3547b4f3986e9%7C0%7C0%7C637920393181161822%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ToV0sdou3dF394mmTwx0%2BlYRpyJ%2B77jofAXLj1L46Hw%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>