Skip to content

Instantly share code, notes, and snippets.

View johnkerl's full-sized avatar

John Kerl johnkerl

View GitHub Profile
SCHEMA
tiledb_array_schema(
domain=tiledb_domain(c(tiledb_dim(name="gene_id", domain=c(NULL,NULL), tile=NULL, type="ASCII"), tiledb_dim(name="sample", domain=c(NULL,NULL), tile=NULL, type="ASCII"))),
attrs=c(tiledb_attr(name="tpm", type="FLOAT64", ncells=1, nullable=FALSE, filter_list=tiledb_filter_list(c(tiledb_filter_set_option(tiledb_filter("ZSTD"),"COMPRESSION_LEVEL",1))))),
cell_order="ROW_MAJOR", tile_order="ROW_MAJOR", capacity=18000, sparse=TRUE, allows_dups=FALSE,
coords_filter_list=tiledb_filter_list(c(tiledb_filter_set_option(tiledb_filter("ZSTD"),"COMPRESSION_LEVEL",-1))),
offsets_filter_list=tiledb_filter_list(c(tiledb_filter_set_option(tiledb_filter("POSITIVE_DELTA"),"POSITIVE_DELTA_MAX_WINDOW",1024)), tiledb_filter_set_option(tiledb_filter("ZSTD"),"COMPRESSION_LEVEL",1))))
FILTER_LIST
$coords
SCHEMA
- Array type: sparse
- Cell order: ROW_MAJOR
- Tile order: ROW_MAJOR
- Capacity: 18000
- Allows duplicates: FALSE
- Coordinates filters: 1
> ZSTD: COMPRESSION_LEVEL=-1
- Offsets filters: 2
> POSITIVE_DELTA: POSITIVE_DELTA_MAX_WINDOW=1024
#!/usr/bin/env Rscript
library(tiledb)
uri <- "tiledb://TileDB-Inc/gtex-analysis-rnaseqc-gene-tpm"
arr <- tiledb_array(uri, query_type="READ", as.data.frame=TRUE)
sch <- schema(arr);
cat("SCHEMA\n")
show(sch)
SCHEMA
tiledb_array_schema(
domain=tiledb_domain(c(tiledb_dim(name="gene_id", domain=c(NULL,NULL), tile=NULL, type="ASCII"), tiledb_dim(name="sample", domain=c(NULL,NULL), tile=NULL, type="ASCII"))),
attrs=c(tiledb_attr(name="tpm", type="FLOAT64", ncells=1, nullable=FALSE, filter_list=tiledb_filter_list(c(tiledb_filter_set_option(tiledb_filter("ZSTD"),"COMPRESSION_LEVEL",1))))),
cell_order="ROW_MAJOR", tile_order="ROW_MAJOR", capacity=18000, sparse=TRUE, allows_dups=FALSE,
coords_filter_list=tiledb_filter_list(c(tiledb_filter_set_option(tiledb_filter("ZSTD"),"COMPRESSION_LEVEL",-1))),
offsets_filter_list=tiledb_filter_list(c(tiledb_filter_set_option(tiledb_filter("POSITIVE_DELTA"),"POSITIVE_DELTA_MAX_WINDOW",1024)), tiledb_filter_set_option(tiledb_filter("ZSTD"),"COMPRESSION_LEVEL",1))))
FILTER_LIST
$coords
johnkerl@ip-192-168-1-183[prod][r]$ test-show.r
SCHEMA
tiledb_array_schema(
domain=tiledb_domain(c(tiledb_dim(name="gene_id", domain=c(NULL,NULL), tile=NULL, type="ASCII"), tiledb_dim(name="sample", domain=c(NULL,NULL), tile=NULL, type="ASCII"))),
attrs=c(tiledb_attr(name="tpm", type="FLOAT64", ncells=1, nullable=FALSE, filter_list=tiledb_filter_list(c(tiledb_filter_set_option(tiledb_filter("ZSTD"),"COMPRESSION_LEVEL",1))))),
cell_order="ROW_MAJOR", tile_order="ROW_MAJOR", capacity=18000, sparse=TRUE, allows_dups=FALSE,
coords_filter_list=tiledb_filter_list(c(tiledb_filter_set_option(tiledb_filter("ZSTD"),"COMPRESSION_LEVEL",-1))),
offsets_filter_list=tiledb_filter_list(c(tiledb_filter_set_option(tiledb_filter("POSITIVE_DELTA"),"POSITIVE_DELTA_MAX_WINDOW",1024)), tiledb_filter_set_option(tiledb_filter("ZSTD"),"COMPRESSION_LEVEL",1))),
)
johnkerl@ip-192-168-1-183[prod][r]$ ./test-show.r
SCHEMA
- Array type: sparse
- Cell order: ROW_MAJOR
- Tile order: ROW_MAJOR
- Capacity: 18000
- Allows duplicates: FALSE
- Coordinates filters: 1
> ZSTD: COMPRESSION_LEVEL=-1
- Offsets filters: 2
#!/usr/bin/env Rscript
library(tiledb)
uri <- "tiledb://TileDB-Inc/gtex-analysis-rnaseqc-gene-tpm"
arr <- tiledb_array(uri, query_type="READ", as.data.frame=TRUE)
sch <- schema(arr);
cat("SCHEMA\n")
show(sch)
$ cat deslurm2.mlrsh
#!/usr/bin/env mlr -s
--csv
put '
func deslurm(str s): num {
# example "5-18:53:20"
fields = unformat("{}-{}:{}:{}", s);
days = fields[1];
hours = fields[2];
$ cat deslurm.mlrsh
#!/usr/bin/env mlr -s
--csv put -f deslurm2.mlr -e '$y = deslurm($x)' -e '$z=sec2dhms($y)'
$ deslurm.mlrsh test.csv
x,y,z
5-18:53:20,500000,5d18h53m20s
$ cat test.csv
x
5-18:53:20
$ cat deslurm.mlr
func deslurm(str s): num {
# example "5-18:53:20"
t = splita(s, "-");
u = splita(t[2], ":");
days = t[1];