Nephele Tutorials

Importing Nephele Results into Phyloseq

These are some general instructions for how to import the outputs from Nephele into phyloseq.

Software requirements

Please refer to the websites linked here for installation and usage instructions:

  • R
  • phyloseq - installing phyloseq will also install the other packages used in this tutorial.
  • RStudio - not required, but helpful if you are new to R.

Tutorial

  1. Download and unzip the PipelineResults folder from your Nephele job. This folder contains all of the data and files used in processing your job.
  2. In the files pane of RStudio, navigate to the outputs directory inside your unzipped folder. Under the "More" dropdown, choose Set As Working Directory.

    Screenshot with RStudio Set As Working Directory
  3. In the Console, enter the following

    library(phyloseq)
  4. To import the data as a phyloseq object, use phyloseq's import_biom or import_mothur commands.
    • DADA2

      mydata <- import_biom(BIOMfilename = "taxa_species.biom")
    • mothur

      mydata <- import_mothur(mothur_shared_file = "combo.trim.contigs.good.unique.good.filter.unique.precluster.pick.opti_mcc.shared", 
          mothur_constaxonomy = "combo.trim.contigs.good.unique.good.filter.unique.precluster.pick.opti_mcc.0.03.cons.taxonomy")
    • QIIME1
      You may see a warning message when importing the biom file from QIIME1.

      mydata <- import_biom(BIOMfilename = "otus/otu_table_mc2_w_tax_no_pynast_failures.biom")
      ## Warning in strsplit(conditionMessage(e), "\n"): input string 1 is invalid
      ## in this locale
  5. Import the sample metadata with import_qiime_sample_data and merge it with the phyloseq object. Subsititute the name of your mapping file for map_file.txt inside the quotes.

    mapfile <- import_qiime_sample_data("map_file.txt")
    mydata <- merge_phyloseq(mydata, mapfile)
    mydata
    ## phyloseq-class experiment-level object
    ## otu_table()   OTU Table:         [ 6084 taxa and 10 samples ]
    ## sample_data() Sample Data:       [ 10 samples by 7 sample variables ]
    ## tax_table()   Taxonomy Table:    [ 6084 taxa by 7 taxonomic ranks ]
  6. (Optional) By default, phyloseq will name the taxonomy levels "Rank1" up to "Rank7". To rename the levels, you can access the taxonomy table column names. Here is an example:

    ncol(tax_table(mydata))  ## check if taxonomy is 6 or 7-level and give the names accordingly
    ## [1] 7
    colnames(tax_table(mydata)) <- c("Kingdom", "Phylum", "Class", "Order", "Family", 
        "Genus", "Species")
  7. (Optional) To add a tree to the phyloseq object, use the ape package.

    library(ape)
  8. To read in QIIME1's tree file, use read.tree.

    tree <- read.tree("otus/rep_set.tre")
    tree
    ## 
    ## Phylogenetic tree with 6084 tips and 6082 internal nodes.
    ## 
    ## Tip labels:
    ##  New.CleanUp.ReferenceOTU24147, New.CleanUp.ReferenceOTU580, N
    ## ew.CleanUp.ReferenceOTU23996, New.CleanUp.ReferenceOTU12876, New.
    ## CleanUp.ReferenceOTU12823, New.CleanUp.ReferenceOTU12877, ...
    ## Node labels:
    ##  , 0.987, 0.886, 0.738, 0.829, 0.743, ...
    ## 
    ## Unrooted; includes branch lengths.
  9. To add the tree to the mydata phyloseq object, use phy_tree.

    phy_tree(mydata) <- tree
    mydata
    ## phyloseq-class experiment-level object
    ## otu_table()   OTU Table:         [ 6084 taxa and 10 samples ]
    ## sample_data() Sample Data:       [ 10 samples by 7 sample variables ]
    ## tax_table()   Taxonomy Table:    [ 6084 taxa by 7 taxonomic ranks ]
    ## phy_tree()    Phylogenetic Tree: [ 6084 tips and 6082 internal nodes ]