MixALime

Reading dataset

Creating a project

The first necessary step of every MixALime session is initiating a project by means of the create command. The command creates a standalone *.init file that is easily portable between machines and should be enough to carry out all the other steps of a pipeline. That's also the only step where you need to feed MixALime any external datasets, i.e. read counts data. In the simplest case, it is enough to run this command:

> mixalime create MyProject path_to_dataset

Here, MyProject is your custom project name: choose it wisely as you'll refer to it in all the other steps. path_to_dataset is a path to your dataset, it can be:

Unless you supply create with a --no-pretty option, it should greet you with a progress bar soon enough. For most projects this step is fast and should not take more than a minute or two, but huge datasets might take some time to be read and preprocessed.

Data formats

MIXALIME supports two file formats for counts data: VCF/BCF and BED-like.

VCF/BCF

MIXALIME works with VCF and BCF files with pysam, a well-tested and recognized library in the bioinformatics community, hence no extra preprocessing is expected to be necessary on the user side. Files can be packed as well and that should cause no problems.

BED-like

Read counts data can also be stored in tabular files inspired by the BED format. Your BED-like files can have the following columns:

Name Mandatory Description
#chr / chr Yes Chromosome/contig name
start / pos Yes SNV position, 0-based
ref Yes Reference allele nucleotide characters
alt Yes Alternative allele nucleotide characters
ref_count Yes Reference allele read count
alt_count Yes Alternative allele read count
id No Name/ID of an SNV, e.g. rs12722
db No dbSNP membership, 1/0
qual No SNP calling quality
bad No BAD for a particular SNV

MIXALIME can deal with some variations of those names, but it is better if you stick with the recommended names. Note that mandatory columns must be present, whereas optional ones are used at the filtering step, if applicable.

Any other columns present in a file are ignored.

A BED-like file can be comma, tab or space separated. It can also be compressed, just like VCF/BCF.

Supplying BAD

By default, MixALime assumes BAD=1 for all SNVs. This is fine when dealing with diploid organisms and the effect of CNVs is considered negligible, but in other cases it is best to submit BAD maps when possible. There are two ways to pass BAD maps to MixALime:

a) Through the bad column when using a BED-like format or via a custom bad field in a VCF/BCF-file.

b) Through an interval mapping file with columns #chr (name of a chromosome), start (start of an interval), end (end of an interval), bad (a BAD corresponding to all SNVs present in the interval). Please note that intervals are half-open, i.e. [start, end). This BAD-map file can be submitted through the --bad-maps option:

> mixalime create MyProject path_to_dataset --bad-maps my_interval_file.tsv

Filters

create provides some built-in filters, namely:

Name Description Default value
--min-qual <int> Minimal allowed SNV quality 10
--min-cnt <int> Minimal allowed number of counts supporting each of the alleles. This option will carry on to the fit step, as it constitutes a left-truncation boundary for the model 5
--max-cover <int> Maximal value of ref_count + alt_count allowed for an SNV. In some cases, the allelic counts at extra high-covered SNPs can be unreliable, e.g. if the data is rich in PCR duplicates; such SNPs should be excluded from the subsequent analysis Infinity
--filter-db Omit SNVs that are not present in dbSNP, uses DB tag for filtering Disabled
--filter-rs Omit SNVs whose IDs do not start with rs, uses ID for filtering Disabled
--filter-name "<str>" Custom regex-compatible pattern: SNVs whose IDs are not in an agreement with the pattern shall be omitted Disabled
--filter-chr "<str>" Custom regex-compatible pattern: SNVs whose chromosome/contig names are not in an agreement with the pattern shall be omitted Disabled
--drop-bad <float> / -d <float> Omits SNVs that come from a particular BAD region. Can be reused to exclude multiple BADs from the further steps of the pipeline Disabled

Other options

There are extra options that can be of potential interest:

Name Description Default value
--default-bad <float> If no BAD information is present for a particular SNV (or for no SNVs at all), the SNV will be assumed to come from a region with this value of BAD 1
--compression <str> All MixALime project files can be compressed to reduce the volume they occupy on a disk and to make transferring them between computational devices an easier task. However, each time MixALime reads or writes such a file, it has to compress/decompress data, and that might take quite some time when datasets are huge. In those cases, it might be better to disable compression by passing the raw argument lzma
--no-pretty Disables fancy output. Might be useful if your terminal can't handle it --pretty

The latter --no-pretty option is a recurrent one for all of the MixALime commands, so we won't mention it ever again in this tutorial.

On this page