kenhanscombe / ukbtools

An R package to manipulate and explore UK Biobank data
https://kenhanscombe.github.io/ukbtools/
96 stars 26 forks source link

errors #31

Closed stevenlehrer closed 4 years ago

stevenlehrer commented 4 years ago

get these errors

uk <- ukb_df("ukb43365") Error in html_table_nodes[[data.pos]] : subscript out of bounds In addition: Warning message: XML content does not seem to be XML: './ukb43365.html'

uk <– ukb_df("ukb43365", path = "/sc/arion/work/lehres01") Error: unexpected input in "uk <▒"

kenhanscombe commented 4 years ago

The first error says the files do not exist; the second looks like a typo?

  1. Is the prefix of your UKB fileset (.tab, .r, .html) ukb43365?

  2. Where are these 3 files?

stevenlehrer commented 4 years ago

The three files are in /sc/arion/work/lehres01. The path exists and I can see the 3 files. The prefix is ukb43365


From: Ken Hanscombe notifications@github.com Sent: Wednesday, September 16, 2020 5:37 PM To: kenhanscombe/ukbtools ukbtools@noreply.github.com Cc: stevenlehrer stevenlehrer@hotmail.com; Author author@noreply.github.com Subject: Re: [kenhanscombe/ukbtools] errors (#31)

The first error says the files do not exist; the second looks like a typo?

  1. Is the prefix of your UKB fileset (.tab, .r, .html) ukb43365?

  2. Where are these 3 files?

    • ukb_df("ukb43365") suggests they are in your current working directory. getwd() to see your working directory; list.files() to see if your files are in it.

    • ukb_df("ukb43365", path = "/sc/arion/work/lehres01") suggests the 3 files are in /sc/arion/work/lehres01. Again, does this path exist and is your fileset in it, list.files("/sc/arion/work/lehres01")?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkenhanscombe%2Fukbtools%2Fissues%2F31%23issuecomment-693679009&data=02%7C01%7C%7Cf6674a8eafed4ac4c76b08d85a88a90b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637358890273900976&sdata=6svhzTP4BOuX1BcYCrmKRG%2FuEU1pMkMiAY7cfUpX33M%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQYTDQKRFBYBAHZPAGRP5QLSGEVYFANCNFSM4RO35VOA&data=02%7C01%7C%7Cf6674a8eafed4ac4c76b08d85a88a90b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637358890273910971&sdata=%2FLLNhhCUVDbcXatqQoTJ8wt3jJKXaEvSNKD4LX2VZPM%3D&reserved=0.

kenhanscombe commented 4 years ago

It is standard practice to give a minimum reproducible example, or it's difficult for me to help you. From what you've given above all I can conclude is the files or the path don't exist, or there is some sort of typo in your code. It looks like your problem has nothing to do with ukbtools.

Start a new R session and type:

sessionInfo()
getwd()
list.files("/sc/arion/work/lehres01")

(copy and paste the output)

library("ukbtools")
sessionInfo()

(copy and paste the output)

df <- ukb_df("ukb43365", path = "/sc/arion/work/lehres01")

(copy and paste the output)

stevenlehrer commented 4 years ago

How do I change the bed and fam files to a file for plink?


From: Ken Hanscombe notifications@github.com Sent: Friday, September 18, 2020 5:06 AM To: kenhanscombe/ukbtools ukbtools@noreply.github.com Cc: stevenlehrer stevenlehrer@hotmail.com; Author author@noreply.github.com Subject: Re: [kenhanscombe/ukbtools] errors (#31)

It is standard practice to give a minimum reproducible examplehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fhelp%2Fminimal-reproducible-example&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662637713&sdata=pmEPhgKEr3SUxwZsORsl7CDFtunOVidBj1SMz5n50Qs%3D&reserved=0, or it's difficult for me to help you. From what you've given above all I can conclude is the files or the path don't exist, or there is some sort of typo in your code. It looks like your problem has nothing to do with ukbtools.

Start a new R session and type:

sessionInfo() getwd() list.files("/sc/arion/work/lehres01")

(copy and paste the output)

library("ukbtools") sessionInfo()

(copy and paste the output)

df <- ukb_df("ukb43365", path = "/sc/arion/work/lehres01")

(copy and paste the output)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkenhanscombe%2Fukbtools%2Fissues%2F31%23issuecomment-694750595&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662647705&sdata=Jh3p1ajY7LUZZieCtyp150Ywl9vBRhXdOO1yljIvghw%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQYTDQJNWTYENMXTME3KAJLSGMPHZANCNFSM4RO35VOA&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662657699&sdata=NAe5hHas23Pd1KYaAzc4eEkcyuU%2Fh%2FWAOHDSTz0dQ4k%3D&reserved=0.

stevenlehrer commented 4 years ago

What does this mean?

my_ukb_data <- ukb_df("ukb43365") |--------------------------------------------------| |==================================================| Warning message: data_frame() is deprecated as of tibble 1.1.0. Please use tibble() instead. This warning is displayed once every 8 hours. Call lifecycle::last_warnings() to see where this warning was generated.

my_ukb_key <- ukb_df_field("ukb43365") subgroup_of_interest <- (my_ukb_data$body_mass_index_bmi_0_0 >= 25) ukb_context(my_ukb_data, subset.var = subgroup_of_interest) Error in .subset2(x, i, exact = exact) : subscript out of bounds


From: Ken Hanscombe notifications@github.com Sent: Friday, September 18, 2020 5:06 AM To: kenhanscombe/ukbtools ukbtools@noreply.github.com Cc: stevenlehrer stevenlehrer@hotmail.com; Author author@noreply.github.com Subject: Re: [kenhanscombe/ukbtools] errors (#31)

It is standard practice to give a minimum reproducible examplehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fhelp%2Fminimal-reproducible-example&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662637713&sdata=pmEPhgKEr3SUxwZsORsl7CDFtunOVidBj1SMz5n50Qs%3D&reserved=0, or it's difficult for me to help you. From what you've given above all I can conclude is the files or the path don't exist, or there is some sort of typo in your code. It looks like your problem has nothing to do with ukbtools.

Start a new R session and type:

sessionInfo() getwd() list.files("/sc/arion/work/lehres01")

(copy and paste the output)

library("ukbtools") sessionInfo()

(copy and paste the output)

df <- ukb_df("ukb43365", path = "/sc/arion/work/lehres01")

(copy and paste the output)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkenhanscombe%2Fukbtools%2Fissues%2F31%23issuecomment-694750595&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662647705&sdata=Jh3p1ajY7LUZZieCtyp150Ywl9vBRhXdOO1yljIvghw%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQYTDQJNWTYENMXTME3KAJLSGMPHZANCNFSM4RO35VOA&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662657699&sdata=NAe5hHas23Pd1KYaAzc4eEkcyuU%2Fh%2FWAOHDSTz0dQ4k%3D&reserved=0.

stevenlehrer commented 4 years ago

What does this mean? How do I get the graphs?

my_ukb_data <- ukb_df("ukb43365") |--------------------------------------------------| |==================================================| Warning message: data_frame() is deprecated as of tibble 1.1.0. Please use tibble() instead. This warning is displayed once every 8 hours. Call lifecycle::last_warnings() to see where this warning was generated.

my_ukb_key <- ukb_df_field("ukb43365") subgroup_of_interest <- (my_ukb_data$body_mass_index_bmi_0_0 >= 25) ukb_context(my_ukb_data, subset.var = subgroup_of_interest) Error in .subset2(x, i, exact = exact) : subscript out of bounds

ukb_icd_diagnosis(my_ukb_data, id = "0000000", icd.version = 10) Error: Invalid UKB sample id. Check all ids are included in the supplied data ukb_icd_freq_by(my_ukb_data, reference.var = "body_mass_index_bmi_0_0", freq.pError: Can't subset columns that don't exist. ✖ Column body_mass_index_bmi_0_0 doesn't exist. Run rlang::last_error() to see where the error occurred. In addition: Warning message: In if (!(icd.code == c("^(I2[0-5])", "^(I6[0-9])", "^(J09|J1[0-9]|J2[0-2]|P23|U04)"))) { : the condition has length > 1 and only the first element will be used ukb_icd_freq_by(my_ukb_data, reference.var = "sex_0_0", freq.plot = TRUE) Error: Can't subset columns that don't exist. ✖ Column sex_0_0 doesn't exist. Run rlang::last_error() to see where the error occurred. In addition: Warning message: In if (!(icd.code == c("^(I2[0-5])", "^(I6[0-9])", "^(J09|J1[0-9]|J2[0-2]|P23|U04)"))) { : the condition has length > 1 and only the first element will be used


From: Ken Hanscombe notifications@github.com Sent: Friday, September 18, 2020 5:06 AM To: kenhanscombe/ukbtools ukbtools@noreply.github.com Cc: stevenlehrer stevenlehrer@hotmail.com; Author author@noreply.github.com Subject: Re: [kenhanscombe/ukbtools] errors (#31)

It is standard practice to give a minimum reproducible examplehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fhelp%2Fminimal-reproducible-example&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662637713&sdata=pmEPhgKEr3SUxwZsORsl7CDFtunOVidBj1SMz5n50Qs%3D&reserved=0, or it's difficult for me to help you. From what you've given above all I can conclude is the files or the path don't exist, or there is some sort of typo in your code. It looks like your problem has nothing to do with ukbtools.

Start a new R session and type:

sessionInfo() getwd() list.files("/sc/arion/work/lehres01")

(copy and paste the output)

library("ukbtools") sessionInfo()

(copy and paste the output)

df <- ukb_df("ukb43365", path = "/sc/arion/work/lehres01")

(copy and paste the output)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkenhanscombe%2Fukbtools%2Fissues%2F31%23issuecomment-694750595&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662647705&sdata=Jh3p1ajY7LUZZieCtyp150Ywl9vBRhXdOO1yljIvghw%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQYTDQJNWTYENMXTME3KAJLSGMPHZANCNFSM4RO35VOA&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662657699&sdata=NAe5hHas23Pd1KYaAzc4eEkcyuU%2Fh%2FWAOHDSTz0dQ4k%3D&reserved=0.

kenhanscombe commented 4 years ago

How do I change the bed and fam files to a file for plink? ____ From: Ken Hanscombe notifications@github.com Sent: Friday, September 18, 2020 5:06 AM To: kenhanscombe/ukbtools ukbtools@noreply.github.com Cc: stevenlehrer stevenlehrer@hotmail.com; Author author@noreply.github.com Subject: Re: [kenhanscombe/ukbtools] errors (#31) It is standard practice to give a minimum reproducible examplehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fhelp%2Fminimal-reproducible-example&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662637713&sdata=pmEPhgKEr3SUxwZsORsl7CDFtunOVidBj1SMz5n50Qs%3D&reserved=0, or it's difficult for me to help you. From what you've given above all I can conclude is the files or the path don't exist, or there is some sort of typo in your code. It looks like your problem has nothing to do with ukbtools. Start a new R session and type: sessionInfo() getwd() list.files("/sc/arion/work/lehres01") (copy and paste the output) library("ukbtools") sessionInfo() (copy and paste the output) df <- ukb_df("ukb43365", path = "/sc/arion/work/lehres01") (copy and paste the output) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkenhanscombe%2Fukbtools%2Fissues%2F31%23issuecomment-694750595&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662647705&sdata=Jh3p1ajY7LUZZieCtyp150Ywl9vBRhXdOO1yljIvghw%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQYTDQJNWTYENMXTME3KAJLSGMPHZANCNFSM4RO35VOA&data=02%7C01%7C%7C7d0ac265372b4f315cae08d85bb21338%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637360167662657699&sdata=NAe5hHas23Pd1KYaAzc4eEkcyuU%2Fh%2FWAOHDSTz0dQ4k%3D&reserved=0.

A bed/ (bim)/ fam combination of files is a binary file set for PLINK. Your question doesn't make sense – nothing to do with ukbtools.

kenhanscombe commented 4 years ago

Again, I can't help you unless you give me reproducible example, or at the very least the session info. I take it you found your files?

stevenlehrer commented 4 years ago

If I have an EID, how can I get UKBtools to print the entire row of data associated with the EID, along with the header. I was able to get UKBtools to work on a mainframe.


From: Ken Hanscombe notifications@github.com Sent: Friday, September 25, 2020 6:45 AM To: kenhanscombe/ukbtools ukbtools@noreply.github.com Cc: stevenlehrer stevenlehrer@hotmail.com; Author author@noreply.github.com Subject: Re: [kenhanscombe/ukbtools] errors (#31)

Again, I can't help you unless you give me reproducible example, or at the very least the session info. I take it you found your files?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkenhanscombe%2Fukbtools%2Fissues%2F31%23issuecomment-698860248&data=02%7C01%7C%7C2f67e5bb003243ec00b408d861401424%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637366275120508882&sdata=XgCWiFQB4lPImI6HR0xOeX0UsRtqakKf2hAH82fHY3g%3D&reserved=0, or unsubscribehttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAQYTDQI6IZ6P4VPTRZYEGX3SHRYDPANCNFSM4RO35VOA&data=02%7C01%7C%7C2f67e5bb003243ec00b408d861401424%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637366275120518880&sdata=Lncp6dkkCDh6YAVyxC3tdEQqTebtThgEQqCsOaLakl0%3D&reserved=0.

kenhanscombe commented 4 years ago

Your problems are to do with use of R, nothing to do with this specific package. There are many free R introductions out there. I recommend the tidyverse approach – see R for Data Science.