*********** loadSQMlite *********** =========== =============== loadSQMlite R Documentation =========== =============== Load tables generated by ``sqm2tables.py``, ``sqmreads2tables.py`` or ``combine-sqm-tables.py`` into R. ------------------------------------------------------------------------------------------------------- Description ~~~~~~~~~~~ This function takes the path to the output directory generated by ``sqm2tables.py``, ``sqmreads2tables.py`` or ``combine-sqm-tables.py`` a SQMlite object. The SQMlite object will contain taxonomic and functional profiles, but no detailed information on ORFs, contigs or bins. However, it will also have a much smaller memory footprint. A SQMlite object can be used for plotting and exporting, but it can not be subsetted. Usage ~~~~~ .. code:: R loadSQMlite(tables_path, tax_mode = "allfilter") Arguments ~~~~~~~~~ +-----------------+------------------------------------------------------+ | ``tables_path`` | character, tables directory generated by | | | ``sqm2table.py``, ``sqmreads2tables.py`` or | | | ``combine-sqm-tables.py``. | +-----------------+------------------------------------------------------+ | ``tax_mode`` | character, which taxonomic classification should be | | | loaded? SqueezeMeta applies the identity thresholds | | | described in `Luo et al., | | | 2014 `__. | | | Use ``allfilter`` for applying the minimum identity | | | threshold to all taxa (default), ``prokfilter`` for | | | applying the threshold to Bacteria and Archaea, but | | | not to Eukaryotes, and ``nofilter`` for applying no | | | thresholds at all. | +-----------------+------------------------------------------------------+ Value ~~~~~ SQMlite object containing the parsed tables. The SQMlite object structure ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The SQMlite object is a nested list which contains the following information: +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | **lvl1** | **lvl2** | **lvl3** | **type** | **rows/names** | **columns** | **data** | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | **$taxa** | **$superkingdom** | **$abund** | *numeric | superkingdoms | samples | abundances | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$percent** | *numeric | superkingdoms | samples | percentages | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$phylum** | **$abund** | *numeric | phyla | samples | abundances | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$percent** | *numeric | phyla | samples | percentages | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$class** | **$abund** | *numeric | classes | samples | abundances | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$percent** | *numeric | classes | samples | percentages | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$order** | **$abund** | *numeric | orders | samples | abundances | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$percent** | *numeric | orders | samples | percentages | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$family** | **$abund** | *numeric | families | samples | abundances | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$percent** | *numeric | families | samples | percentages | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$genus** | **$abund** | *numeric | genera | samples | abundances | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$percent** | *numeric | genera | samples | percentages | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$species** | **$abund** | *numeric | species | samples | abundances | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$percent** | *numeric | species | samples | percentages | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | **$functions** | **$KEGG** | **$abund** | *numeric | KEGG ids | samples | abundances | | | | | matrix* | | | (reads) | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$bases** | *numeric | KEGG ids | samples | abundances | | | | | matrix* | | | (bases) | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$tpm** | *numeric | KEGG ids | samples | tpm | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$copy_number** | *numeric | KEGG ids | samples | avg. copies | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$COG** | **$abund** | *numeric | COG ids | samples | abundances | | | | | matrix* | | | (reads) | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$bases** | *numeric | COG ids | samples | abundances | | | | | matrix* | | | (bases) | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$tpm** | *numeric | COG ids | samples | tpm | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$copy_number** | *numeric | COG ids | samples | avg. copies | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$PFAM** | **$abund** | *numeric | PFAM ids | samples | abundances | | | | | matrix* | | | (reads) | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$bases** | *numeric | PFAM ids | samples | abundances | | | | | matrix* | | | (bases) | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$tpm** | *numeric | PFAM ids | samples | tpm | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$copy_number** | *numeric | PFAM ids | samples | avg. copies | | | | | matrix* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | **$total_reads** | | | *numeric | samples | (n/a) | total reads | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | **$misc** | **$project_name** | | *character | (empty) | (n/a) | project | | | | | vector* | | | name | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$samples** | | *character | (empty) | (n/a) | samples | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$tax_names_long** | **$superkingdom** | *character | short names | (n/a) | full names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$phylum** | *character | short names | (n/a) | full names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$class** | *character | short names | (n/a) | full names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$order** | *character | short names | (n/a) | full names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$family** | *character | short names | (n/a) | full names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$genus** | *character | short names | (n/a) | full names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | | **$species** | *character | short names | (n/a) | full names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$tax_names_short** | | *character | full names | (n/a) | short names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$KEGG_names** | | *character | KEGG ids | (n/a) | KEGG names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$KEGG_paths** | | *character | KEGG ids | (n/a) | KEGG | | | | | vector* | | | hiararchy | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$COG_names** | | *character | COG ids | (n/a) | COG names | | | | | vector* | | | | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$COG_paths** | | *character | COG ids | (n/a) | COG | | | | | vector* | | | hierarchy | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ | | **$ext_annot_sources** | | *character | (empty) | (n/a) | external | | | | | vector* | | | databases | +------------------+------------------------+-------------------+------------+----------------+-------------+-------------+ If external databases for functional classification were provided to SqueezeMeta or SqueezeMeta_reads via the ``-extdb`` argument, the corresponding abundance, tpm and copy number profiles will be present in ``SQM$functions`` (e.g. results for the CAZy database would be present in ``SQM$functions$CAZy``). Additionally, the extended names of the features present in the external database will be present in ``SQM$misc`` (e.g. ``SQM$misc$CAZy_names``). Note that results generated by SqueezeMeta_reads will contain only read abundances, but not bases, tpm or copy number estimations. See Also ~~~~~~~~ ``plotBars`` and ``plotFunctions`` will plot the most abundant taxa and functions in a SQMlite object. ``exportKrona`` will generate Krona charts reporting the taxonomy in a SQMlite object. Examples ~~~~~~~~ .. code:: R ## Not run: ## (outside R) ## Run SqueezeMeta on the test data. /path/to/SqueezeMeta/scripts/SqueezeMeta.pl -p Hadza -f raw -m coassembly -s test.samples ## Generate the tabular outputs! /path/to/SqueezeMeta/utils/sqm2tables.py Hadza Hadza/results/tables ## Now go into R. library(SQMtools) Hadza = loadSQMlite("Hadza/results/tables") # Where Hadza is the path to the SqueezeMeta output directory. # Note that this is not the whole SQM project, just the directory containing the tables. # It would also work with tables generated by sqmreads2tables.py, or combine-sqm-tables.py plotTaxonomy(Hadza) plotFunctions(Hadza) exportKrona(Hadza, 'myKronaTest.html') ## End(Not run)