Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import picrust2 failed: "cannot open compressed file" #92

Open
azahorik opened this issue Jan 19, 2023 · 1 comment
Open

import picrust2 failed: "cannot open compressed file" #92

azahorik opened this issue Jan 19, 2023 · 1 comment

Comments

@azahorik
Copy link

I'm trying to import picrust2 output. I have a tab-delimited text metadata file with two columns: SampleID and SampleType. I have the KO prediction files (pred_metagenome_unstrat.tsv.gz and pred_metagenome_unstrat_descrip.tsv.gz). I have set the working directory in R to the directory where all of these files are located.

I ran the following commands:

sam_tab <- system.file(
"extdata", "metadata.txt",
package = "microbiomeMarker")

annual_KO_tab <- system.file(
"extdata",
"annual_KO_pred_metagenome_unstrat.tsv.gz",
package = "microbiomeMarker"
)

annual.ko <-
import_picrust2(
annual_KO_tab,
sam_tab,
trait = "KO"
)

And got the following error:

Error in open.connection(file, "rt") : cannot open the connection
In addition: Warning message:
In open.connection(file, "rt") :
cannot open compressed file '', probable reason 'Invalid argument'

I have tried:

  • Specifying the full filepath.
  • Using the gzipped and unzipped versions of the prediction files.
  • Using the versions with and without the added description column.
  • Because I had renamed the files to specify traits and experiment, I reverted to the original filenames.

Regardless, I keep getting the same error. I can't see what I'm doing wrong here. Please advise. I've attached my metadata file and one of the picrust2 output files.

Note: The picrust2 output file was in tsv/tsv.gz format for this, but I had to convert to tab delimited .txt in order to upload it to github. This wasn't the format used in R.
annual_KO_pred_metagenome_unstrat.txt
metadata.txt

@azahorik
Copy link
Author

Further note: I am using R 4.2.2 in RStudio in Windows 10. I am running RStudio as administrator. (Since sometimes Windows can be weird about write perms.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant