Bioconductor / GenomicDataCommons

Provide R access to the NCI Genomic Data Commons portal.
http://bioconductor.github.io/GenomicDataCommons/
84 stars 23 forks source link

Error in gdc_token() : file.exists(token_file) is not TRUE #90

Closed SisiChen16 closed 2 years ago

SisiChen16 commented 2 years ago

I was trying to get token authentication, I managed to download a token as "txt" file, and tried the three ways of gdc_token as below, but none of them worked. The error message keeps popping up, as "Error in gdc_token(): file.exists(token_file) is not TRUE", I don't know what to do.

  1. As a string stored in the environment variable, GDC_TOKEN
  2. As a file, stored in the file named by the environment variable, GDC_TOKEN_FILE
  3. In a file in the user home directory, called .gdc_token
LiNk-NY commented 2 years ago

Hi @SisiChen16

Please make sure that the path to the token is correct.

Within the R session, you can check if the environment variable is specified using Sys.getenv("GDC_TOKEN").

You can add the contents of the token within the ~/.Renviron file as GDC_TOKEN="token_text" and then check using the code above. (as long as you don't start R with the --no-environ flag in the command line)

I don't see an issue with the code.

Best regards, Marcel

SisiChen16 commented 2 years ago

Hi Marcel,

The problem has been solved, thank you so much!

Best wishes, Sisi

SisiChen16 commented 2 years ago

Hi Marcel,

I encountered another problem when I'm trying to use Bam slicing, the code I used and output are as below:

image

It says "Error in slicing(file_ids[1], regions = "chrX:84058346-84188199", token = gdc_token()) : missing(token) is not TRUE". As I managed to run the token = gdc_token() in the previous step, I assume the token authentication is approved, but why does it still show missing(token) here?

Best wishes, Sisi

seandavi commented 2 years ago

@SisiChen16, I think the last piece was a bug. See #91. Should be fixed in 1.19.3 now on github if you want to try it.