R Text progress bar error
3
0
Entering edit mode
devyani66 • 0
@devyani66-9451
Last seen 2.9 years ago

I was trying to execute TCGAbiolink package in R. I am facing a error while preparing the file after download... i.e during TCGAprepare function.

Command is-  Dev.met <- TCGAprepare(query = query, dir = "D:/TCGA_DATA/TCGAbiolink/", save = TRUE, filename = "MetDev.rda", reannotate = TRUE)

The error is - Error in txtProgressBar(min = 0, max = length(files), style = 3) :   must have 'max' > 'min'

Can anyone please let me know what I might have done wrong.

Thank you.

TCGA • 2.9k views
1
Entering edit mode
@paultheodorpyl-9453
Last seen 6.0 years ago

The error points out that max has to be larger than min and it would seem that the command length(files) is the likely culprit. My guess would be that somehow your list of files is empty, making length(files) equal zero.

When you check the source code of the function you are calling (e.g. on github here: https://github.com/Bioconductor-mirror/TCGAbiolinks/blob/master/R/TCGAPrepare.R#L99-L127) you can see that it uses all files (expect some specific ones like README etc.) from the directory you specified. Are the files there? Did you provide the path correctly?

Probably the files are either not where you point the function ("D:/TCGA_DATA/TCGAbiolink/"), or you are missing some extra slashes or backslashes in the directory name. I am not a Windows user so I am unsure about how it would have to look, but you should maybe look at ?normalizePath and run the example to see how paths should be formatted on your system.

Cheers,

Paul

0
Entering edit mode
devyani66 • 0
@devyani66-9451
Last seen 2.9 years ago

Thank you for your reply. Yes indeed it was a path problem and it was solved. But now I am getting another error :(

The error is -

0%Error in fread(files[i], header = TRUE, sep = "\t", stringsAsFactors = FALSE,  :
colClasses is unnamed and length 5 but there are 4 columns. See ?data.table for colClasses usage.

You can see the snapshot of the command. I am new to using R too. Any help will be greatly appreciated. Thank you.

Command-

sarc.met <- TCGAprepare(query = sarc.query,
save = TRUE,
filename = "metasarc.rda",
reannotate = TRUE)