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.
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.txtmetadata.txt
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.)
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:
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