*********** loadSQMlite *********** .. container:: =========== =============== loadSQMlite R Documentation =========== =============== .. rubric:: Load tables generated by ``sqm2tables.py``, ``sqmreads2tables.py`` or ``combine-sqm-tables.py`` into R. :name: loadSQMlite .. rubric:: Description :name: 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. .. rubric:: Usage :name: usage .. code:: R loadSQMlite(tables_path, tax_mode = "allfilter") .. rubric:: Arguments :name: 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., | | | 201 | | | 4 `__. | | | 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. | +-----------------+---------------------------------------------------+ .. rubric:: Value :name: value SQMlite object containing the parsed tables. .. rubric:: The SQMlite object structure :name: the-sqmlite-object-structure The SQMlite object is a nested list which contains the following information: +---------+---------+---------+---------+---------+---------+---------+ | * | * | * | * | **rows/ | **co | * | | *lvl1** | *lvl2** | *lvl3** | *type** | names** | lumns** | *data** | +---------+---------+---------+---------+---------+---------+---------+ | ** | **$ | **$ | * | superk | samples | abu | | $taxa** | superki | abund** | numeric | ingdoms | | ndances | | | ngdom** | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$pe | * | superk | samples | perc | | | | rcent** | numeric | ingdoms | | entages | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$p | **$ | * | phyla | samples | abu | | | hylum** | abund** | numeric | | | ndances | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$pe | * | phyla | samples | perc | | | | rcent** | numeric | | | entages | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$ | **$ | * | classes | samples | abu | | | class** | abund** | numeric | | | ndances | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$pe | * | classes | samples | perc | | | | rcent** | numeric | | | entages | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$ | **$ | * | orders | samples | abu | | | order** | abund** | numeric | | | ndances | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$pe | * | orders | samples | perc | | | | rcent** | numeric | | | entages | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$f | **$ | * | f | samples | abu | | | amily** | abund** | numeric | amilies | | ndances | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$pe | * | f | samples | perc | | | | rcent** | numeric | amilies | | entages | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$ | **$ | * | genera | samples | abu | | | genus** | abund** | numeric | | | ndances | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$pe | * | genera | samples | perc | | | | rcent** | numeric | | | entages | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$sp | **$ | * | species | samples | abu | | | ecies** | abund** | numeric | | | ndances | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$pe | * | species | samples | perc | | | | rcent** | numeric | | | entages | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | **$func | ** | **$ | * | KEGG | samples | abu | | tions** | $KEGG** | abund** | numeric | ids | | ndances | | | | | matrix* | | | (reads) | +---------+---------+---------+---------+---------+---------+---------+ | | | **$ | * | KEGG | samples | abu | | | | bases** | numeric | ids | | ndances | | | | | matrix* | | | (bases) | +---------+---------+---------+---------+---------+---------+---------+ | | | * | * | KEGG | samples | tpm | | | | *$tpm** | numeric | ids | | | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | ** | * | KEGG | samples | avg. | | | | $copy_n | numeric | ids | | copies | | | | umber** | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | * | **$ | * | COG ids | samples | abu | | | *$COG** | abund** | numeric | | | ndances | | | | | matrix* | | | (reads) | +---------+---------+---------+---------+---------+---------+---------+ | | | **$ | * | COG ids | samples | abu | | | | bases** | numeric | | | ndances | | | | | matrix* | | | (bases) | +---------+---------+---------+---------+---------+---------+---------+ | | | * | * | COG ids | samples | tpm | | | | *$tpm** | numeric | | | | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | ** | * | COG ids | samples | avg. | | | | $copy_n | numeric | | | copies | | | | umber** | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | ** | **$ | * | PFAM | samples | abu | | | $PFAM** | abund** | numeric | ids | | ndances | | | | | matrix* | | | (reads) | +---------+---------+---------+---------+---------+---------+---------+ | | | **$ | * | PFAM | samples | abu | | | | bases** | numeric | ids | | ndances | | | | | matrix* | | | (bases) | +---------+---------+---------+---------+---------+---------+---------+ | | | * | * | PFAM | samples | tpm | | | | *$tpm** | numeric | ids | | | | | | | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | ** | * | PFAM | samples | avg. | | | | $copy_n | numeric | ids | | copies | | | | umber** | matrix* | | | | +---------+---------+---------+---------+---------+---------+---------+ | ** | | | * | samples | (n/a) | total | | $total_ | | | numeric | | | reads | | reads** | | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | ** | **$ | | *ch | (empty) | (n/a) | project | | $misc** | project | | aracter | | | name | | | _name** | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$sa | | *ch | (empty) | (n/a) | samples | | | mples** | | aracter | | | | | | | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$ta | **$ | *ch | short | (n/a) | full | | | x_names | superki | aracter | names | | names | | | _long** | ngdom** | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$p | *ch | short | (n/a) | full | | | | hylum** | aracter | names | | names | | | | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$ | *ch | short | (n/a) | full | | | | class** | aracter | names | | names | | | | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$ | *ch | short | (n/a) | full | | | | order** | aracter | names | | names | | | | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$f | *ch | short | (n/a) | full | | | | amily** | aracter | names | | names | | | | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$ | *ch | short | (n/a) | full | | | | genus** | aracter | names | | names | | | | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | | **$sp | *ch | short | (n/a) | full | | | | ecies** | aracter | names | | names | | | | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$tax | | *ch | full | (n/a) | short | | | _names_ | | aracter | names | | names | | | short** | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | * | | *ch | KEGG | (n/a) | KEGG | | | *$KEGG_ | | aracter | ids | | names | | | names** | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | * | | *ch | KEGG | (n/a) | KEGG | | | *$KEGG_ | | aracter | ids | | hi | | | paths** | | vector* | | | ararchy | +---------+---------+---------+---------+---------+---------+---------+ | | **$COG_ | | *ch | COG ids | (n/a) | COG | | | names** | | aracter | | | names | | | | | vector* | | | | +---------+---------+---------+---------+---------+---------+---------+ | | **$COG_ | | *ch | COG ids | (n/a) | COG | | | paths** | | aracter | | | hi | | | | | vector* | | | erarchy | +---------+---------+---------+---------+---------+---------+---------+ | | * | | *ch | (empty) | (n/a) | e | | | *$ext_a | | aracter | | | xternal | | | nnot_so | | vector* | | | da | | | urces** | | | | | tabases | +---------+---------+---------+---------+---------+---------+---------+ | | | | | | | | +---------+---------+---------+---------+---------+---------+---------+ 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. .. rubric:: See Also :name: 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. .. rubric:: Examples :name: 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)