mbtools
has support for aligning shotgun metagenomic reads. Before proceeding
we recommend you preprocess the reads first as described in an earlier vignette.
library(mbtools)
We use minimap2 for everything since it performs as good as other aligners but does not require explicit building of the reference. This way your reference database can just be a (compressed) fasta file.
As example data we will use 3 samples generated with the polyester read sampler from a list of 10 reference genomes in equal abundances.
Let's create our file list for the example data and reference database:
fi <- system.file("extdata/shotgun", package = "mbtools") %>% find_read_files() ref <- system.file("extdata/genomes/zymo_mock.fna.gz", package = "mbtools")
Which are 3 paired-end files.
fi
As always we will need A config object.
config <- config_align( reference = ref, threads = 3, use_existing = FALSE ) config
This will be sufficient to align reads. As always the first argument can also be an
artifact from quality_control
or preprocess
.
alns <- align_short_reads(fi, config)
You will get an output artifact that logs the created alignments...
alns$alignments
...the size of all the alignments on disk...
print(alns$disk_size, unit = "auto")
...and the logs in case something goes wrong.
cat(alns$logs[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.