Command line interface

(Source code)

$ limix -q download http://rest.s3for.me/limix/plink_example.tar.gz &\
  limix -q download http://rest.s3for.me/limix/small_example.hdf5 &\
  limix -q download http://rest.s3for.me/limix/small_example.csv.bz2 &\
  limix -q download http://rest.s3for.me/limix/ex0/phenotype.gemma
$ limix -q extract plink_example.tar.gz &\
  limix -q extract small_example.csv.bz2

Introduction

Limix now provides a couple of its functionalities via command line.

$ limix --help
Usage: limix [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --verbose / -q, --quiet  Enable or disable verbose mode.
  --version                    Show the version and exit.
  -h, --help                   Show this message and exit.

Commands:
  download          Download file from the specified URL.
  estimate-kinship  Estimate a kinship matrix.
  extract           Extract a file.
  remove            Remove a file.
  scan              Perform genome-wide association scan.
  see               Show an overview of multiple file types.

You can quickly explore common file types used in genetics, as examples given bellow will demonstrate.

Kinship

Heatmap representing a plink kinship matrix. Setup:

limix download http://rest.s3for.me/limix/small_example.grm.raw.bz2
limix extract small_example.grm.raw.bz2

Command:

limix see small_example.grm.raw

(Source code, png)

_images/cmd-2.png

BIMBAM file formats

Phenotype:

$ limix see phenotype.gemma --filetype=bimbam-pheno
     0    1    2
0  1.2 -0.3 -1.5
1  NaN  1.5  0.3
2  2.7  1.1  NaN
3 -0.2 -0.7  0.8
4  3.3  2.4  2.1

[5 rows x 3 columns]

HDF5

The following command shows the hierarchy of a HDF5 file:

$ limix see small_example.hdf5
/
  +--genotype
     +--col_header
     |  +--chrom [|S8, (100,), None]
     |  +--pos [int64, (100,), None]
     +--matrix [uint8, (183, 100), None]
     +--row_header
        +--sample_ID [|S7, (183,), None]

CSV

CSV files have their delimiter automatically detected and a preview can be shown as

$ limix see small_example.csv
Reading small_example.csv... done (0.08 seconds).
               0   1   2   3   4   5   6   ... 459 460 461 462 463 464 465
0  snp_22_16050408   A   A   A   A   A   A ...   B   B   B   B   B   B   B
1  snp_22_16050612   A   A   A   A   A   A ...   B   B   B   B   B   B   B
2  snp_22_16050678   A   A   A   A   A   A ...   B   B   B   B   B   B   B
3  snp_22_16051107   A   A   A   A   A   A ...   B   B   B   B   B   B   B
4  snp_22_16051249   A   A   A   A   A   A ...   B   B   B   C   C   B   B

[5 rows x 466 columns]

Image

An image can be seen via

$ limix -q see dali.jpg

(Source code, png)

_images/cmd-3.png

GWAS

$ limix scan --help
Usage: limix scan [OPTIONS] PHENOTYPES_FILE GENOTYPE_FILE

  Perform genome-wide association scan.

  This analysis requires minimally the specification of one phenotype
  (PHENOTYPES_FILE) and genotype data (GENOTYPE_FILE).

  The --filter option allows for selecting a subset of the original dataset
  for the analysis. For example,

      --filter="genotype: (chrom == '3') & (pos > 100) & (pos < 200)"

  states that only loci of chromosome 3 having a position inside the range
  (100, 200) will be considered. The --filter option can be used multiple
  times in the same call. In general, --filter accepts a string of the form

      <DATA-TYPE>: <BOOL-EXPR>

  where <DATA-TYPE> can be phenotype, genotype, or covariate. <BOOL-EXPR> is
  a boolean expression involving row or column names. Please, consult
  `pandas.DataFrame.query` function from Pandas package for further
  information.

Options:
  --covariates-file TEXT  Specify the file path to a file containing the
                          covariates.
  --kinship-file TEXT     Specify the file path to a file containing the
                          kinship matrix.
  --lik TEXT              Specify the type of likelihood that will described
                          the residual error distribution.
  --filter TEXT           Filtering expression to select which phenotype,
                          genotype loci, and covariates to use in the
                          analysis.
  --output-dir TEXT       Specify the output directory path.
  -h, --help              Show this message and exit.