Need Coding Help

Hi!
I am trying to work through a coding tutorial on R on a public restroom bacteria dataset. I’ll link it here: DIY: public restroom bacteria

As I am importing my data ( The zipfile has been moved to a new location: https://nam11.safelinks.protection.outlook.com/?url=ftp%3A%2F%2Fftp.microbio.me%2Fpub%2Frestroom-data%2Fstudy_1335_split_library_seqs_and_mapping.zip&data=05|02|gekalle1%40live.ndm.edu|ba59b1ac561f4e345f7b08dd5123cb13|23e76ce8053b4267b0d3b497df4bbaf8|1|0|638755936343802153|Unknown|TWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D|0|||&sdata=dLjocUyCZ3uq8OBJk7MdF1Eo9s2Jgj12RjusiVdVSj0%3D&reserved=0)

I am met with an error message: <trying URL
Content type ‘unknown’ length 14700487 bytes (14.0 MB)>

I cannot continue on with the turorial unless I figure this out! Help!

Thank you so much!

Hi,

Yes, the demo data location is now different from the original location. The new location is here:
ftp://ftp.microbio.me/pub/restroom-data/study_1335_split_library_seqs_and_mapping.zip

So, try running the following set of commands which worked for me:

#Download first
zipftp = “ftp://ftp.microbio.me/pub/restroom-data/study_1335_split_library_seqs_and_mapping.zip

#Follow the tutorial’s instructions to process the file further so your file of interested will be the biom file:

zipfile = tempfile(“RestroomBiogeography”)

download.file(zipftp, zipfile)

import_dir ← tempdir()

unzip(zipfile, exdir = import_dir)

biomfile = paste0(import_dir, “/study_1335_closed_reference_otu_table.biom”)

biom = import_biom(biomfile, parseFunction = parse_taxonomy_greengenes)

#Test the final imported file
biom

#biom file should look like this

phyloseq-class experiment-level object
otu_table() OTU Table: [ 4467 taxa and 109 samples ]
tax_table() Taxonomy Table: [ 4467 taxa by 7 taxonomic ranks ]

Hi Valerie,
The first command is working,the ziptfile= tempfile action is working as well but when I try to do the download.file (zipftp, zipfile). This is the message I got :download.file(zipftp, zipfile)
trying URL ‘ftp://ftp.microbio.me/pub/restroom-data/study_1335_split_library_seqs_and_mapping.zip
Content type ‘unknown’ length 14700487 bytes (14.0 MB)
Error in download.file(zipftp, zipfile) :
cannot open URL ‘ftp://ftp.microbio.me/pub/restroom-data/study_1335_split_library_seqs_and_mapping.zip

My PI, Dr. Kerr, tried as well and got the same error message.

What do we do?

contuniation of error message:

In addition: Warning messages:
1: In download.file(zipftp, zipfile) :
downloaded length 0 != reported length 0
2: In download.file(zipftp, zipfile) :
URL ‘ftp://ftp.microbio.me/pub/restroom-data/study_1335_split_library_seqs_and_mapping.zip’: Timeout of 60 seconds was reached

Hi. Here is the solution that should alternatively work:

a) Use pre-downloaded .zip file instead of downloading it from the website: Download the file (we renamed to “restroom.zip”) using the link below (instead of the one provided in the website).

#After download, I dragged the file to the Desktop (you can use a different directory)
#After download, the folder you downloaded will be called “restroom”.

b) Follow the adjusted code below to load the file. Note, I downloaded the folder to my Desktop, so in the code below, you will see that, but you can set a different directory. I suggest to set working directory to the directory where your restroom.zip file will be. In my case it’s ~/Desktop/C-MOOR/Phyloseq.

#Load phyloseq
 library(phyloseq)

#Set working directory to Desktop
setwd("~/Desktop/")

#Import data
zipfile2 = ("~/Desktop/restroom.zip")

#create the temporary directory for the unpacked file(s) from the .zip file.
import_dir <- tempdir()

#Import from the sample data file.
sdfile = paste0(import_dir, "/study_1335_mapping_file.txt")
sample_metadata = import_qiime_sample_data(sdfile)

#Import from the .biom file.
biomfile = paste0(import_dir, "/study_1335_closed_reference_otu_table.biom")
biom = import_biom(biomfile, parseFunction = parse_taxonomy_greengenes)
biom

c) Let us know if that works and we can continue troubleshooting.