cgdata.core

Library for reading cgdata and related file formats.

category-field

(category-field parse {:keys [name i]} rows)

columns-from-header

(columns-from-header header patterns)

detect-cgdata

(detect-cgdata file)
Detect cgdata files by presence of json metadata. If no type
is given, assume genomicMatrix

detect-tsv

(detect-tsv file)
Return ::tsv if the file is tsv, or nil

field-spec

multimethod

find-position-field

(find-position-field columns)

find-position-fields

(find-position-fields columns start-index)
Rewrite a list of column objects having a :header attribute,
collating chrom position columns into position fields, having
:chrom :chromStart :chromEnd and optional :strand. :chrom and
:strand are reused if necessary.

fix-json

(fix-json root)
Utility for rewriting references in cgdata metadata, so
they refer to file paths, not abstract identifiers.

gene-pred-file

(gene-pred-file file & {docroot :docroot, :or {docroot fs/unix-root}})
Return a map describing a genePred(Ext) file. This will read
any assoicated json.

matrix-file

(matrix-file file & {docroot :docroot, :or {docroot fs/unix-root}})
Return a map describing a cgData matrix file. This will read
any assoicated json or clinicalFeature file.

mutation-columns

mutation-file

(mutation-file file & {docroot :docroot, :or {docroot fs/unix-root}})
Return a map describing a cgData mutation file. This will read
any assoicated json.

pick-header

(pick-header lines)
Pick first non-blank line if it starts with #. Don't scan more
than 20 lines.

probemap-file

(probemap-file file & {docroot :docroot, :or {docroot fs/unix-root}})
Return a map describing a cgData probemap file. This will read
any assoicated json.

references

(references docroot referrer md)
Return map of any references in md to their paths relative to the document root.