Command line interface¶
Introduction¶
Limix now provides a couple of its functionalities via command line.
$ limix --help
Usage: limix [OPTIONS] COMMAND [ARGS]...
Options:
--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.
qtl Perform genome-wide association scan.
remove Remove a file.
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.
$ limix download http://rest.s3for.me/limix/small_example.grm.raw.bz2
Downloading http://rest.s3for.me/limix/small_example.grm.raw.bz2... done (0.37 seconds).
$ limix extract small_example.grm.raw.bz2
Extracting small_example.grm.raw.bz2... done (0.02 seconds).
$ limix see small_example.grm.raw
Reading small_example.grm.raw... done (0.16 seconds).
Plotting...
(Source code, png)
Plink BED format¶
A preview of Plink files in BED format can be done via
$ limix download http://rest.s3for.me/limix/plink_example.tar.gz
Downloading http://rest.s3for.me/limix/plink_example.tar.gz... done (0.26 seconds).
$ limix extract plink_example.tar.gz
Extracting plink_example.tar.gz... done (0.03 seconds).
$ limix see plink_example
Reading `plink_example`...
Mapping files: 0%| | 0/3 [00:00<?, ?it/s]
Mapping files: 100%|██████████| 3/3 [00:00<00:00, 339.80it/s][1A[K[1Adone (0.03 seconds).
---------------------------------- Samples ----------------------------------
chrom snp cm pos a0 a1 i
candidate
snp_22_18958209 22 snp_22_18958209 0.0 18958209 A G 0
snp_22_19597806 22 snp_22_19597806 0.0 19597806 T C 1
snp_22_20171368 22 snp_22_20171368 0.0 20171368 T C 2
snp_22_20179046 22 snp_22_20179046 0.0 20179046 T C 3
snp_22_20828867 22 snp_22_20828867 0.0 20828867 T C 4
... ... ... ... ... .. ... ..
indel:4D_22_49340059 22 indel:4D_22_49340059 0.0 49340059 G GAGAC 95
snp_22_49362308 22 snp_22_49362308 0.0 49362308 C T 96
snp_22_49473688 22 snp_22_49473688 0.0 49473688 T C 97
snp_22_49568955 22 snp_22_49568955 0.0 49568955 G A 98
snp_22_50837415 22 snp_22_50837415 0.0 50837415 A G 99
[100 rows x 7 columns]
--------------------- Genotype ---------------------
fid iid father mother gender trait i
sample
HG00105 0 HG00105 0 0 0 -9 0
HG00107 0 HG00107 0 0 0 -9 1
HG00115 0 HG00115 0 0 0 -9 2
HG00132 0 HG00132 0 0 0 -9 3
HG00145 0 HG00145 0 0 0 -9 4
... .. ... ... ... ... ... ...
NA20815 0 NA20815 0 0 0 -9 460
NA20816 0 NA20816 0 0 0 -9 461
NA20819 0 NA20819 0 0 0 -9 462
NA20826 0 NA20826 0 0 0 -9 463
NA20828 0 NA20828 0 0 0 -9 464
[465 rows x 7 columns]
BIMBAM file formats¶
Phenotype:
$ limix download http://rest.s3for.me/limix/ex0/phenotype.gemma
Downloading http://rest.s3for.me/limix/ex0/phenotype.gemma... done (0.29 seconds).
$ limix see phenotype.gemma:bimbam-pheno
Reading `phenotype.gemma`... done (0.02 seconds).
---- Phenotypes -----
trait 0 1 2
sample
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
HDF5¶
The following command shows the hierarchy of a HDF5 file:
$ limix download http://rest.s3for.me/limix/small_example.hdf5
Downloading http://rest.s3for.me/limix/small_example.hdf5... done (0.39 seconds).
$ 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 download http://rest.s3for.me/limix/small_example.csv.bz2
Downloading http://rest.s3for.me/limix/small_example.csv.bz2... done (0.32 seconds).
$ limix extract small_example.csv.bz2
Extracting small_example.csv.bz2... done (0.02 seconds).
$ limix see small_example.csv
Reading small_example.csv... done (0.06 seconds).
0 1 2 3 4 5 6 7 ... 458 459 460 461 462 463 464 465
0 snp_22_16050408 A A A A A A A ... B B B B B B B B
1 snp_22_16050612 A A A A A A A ... B B B B B B B B
2 snp_22_16050678 A A A A A A A ... B B B B B B B B
3 snp_22_16051107 A A A A A A A ... B B B B B B B B
4 snp_22_16051249 A A A A A A A ... B B B B C C B B
[5 rows x 466 columns]
Image¶
An image can be seen via
$ limix download http://rest.s3for.me/limix/dali.jpg.bz2
Downloading http://rest.s3for.me/limix/dali.jpg.bz2... done (0.68 seconds).
$ limix extract dali.jpg.bz2
Extracting dali.jpg.bz2... done (0.04 seconds).
$ limix see dali.jpg
(Source code, png)
GWAS¶
$ limix qtl --help
Usage: limix qtl [OPTIONS] COMMAND [ARGS]...
Perform genome-wide association scan.
Options:
-h, --help Show this message and exit.
Commands:
scan Single-variant association testing via mixed models.