02-readLGF: Extracting LGF karyotype data from JSON files

Description Usage Arguments Details Value Author(s) References See Also Examples


A function to read binary karyotype data, stored in LGF format in JSON files produced by the CytoGPS web site, into R for further analysis.


readLGF(files = NULL, folder = NULL, verbose = TRUE)



The name of the JSON file (or a character vector of such file names) from which you want to extract and format data. If NULL, then it will extract all JSON files within the folder path provided.


The specified directory/folder from which the user wants to extract JSON files. If NULL, then the function will look in the current working directory.


A logical value; should the function keep you informed about what it is doing?


CytoGPS is an algorithm that converts conventional karyotypes from the standard text-based notation (the International Standard for Human Cytogenetic/Cytogenomic Nomenclature; ISCN) into binary vectors with three bits (loss, gain, or fusion) per cytoband, which we call the LGF model. The web site http://cytogps.org provides an implementation that allows users to upload text files containing one karyotype per line. It produces its output as a file in JavaScript Object Notation (JSON).

The readLGF function reads and parses these JSON files and converts them into an R data structure. The raw component of this structure contains binary matrices that can serve as input to the Mercator package (see Mercator-class) for unsupervised analyses. The frequency component summarizes the fraction of input karyotype-clones with each abnormality, and can be visualized with other tools in the RCytoGPS package.


A list containing five elements:


Kevin R. Coombes krc@silicovore.com, Dwayne G. Tally dtally110@hotmail.com


Abrams ZB, Zhang L, Abruzzo LV, Heerema NA, Li S, Dillon T, Rodriguez R, Coombes KR, Payne PRO. CytoGPS: a web-enabled karyotype analysis tool for cytogenetics. Bioinformatics. 2019 Dec 15;35(24):5365-5366.

Abrams ZB, Tally DG, Zhang L, Coombes CE, Payne PRO, Abruzzo LV, Coombes KR. Pattern recognition in lymphoid malignancies using CytoGPS and Mercator. Under review.

Abrams ZB, Tally DG, Coombes KR. RCytoGPS: An R Package for Analyzing and Visualizing Cytogenetic Data. In preparation.

See Also



jsonDir <- system.file("Examples/JSONfiles", package = "RCytoGPS")
x <- readLGF(folder = jsonDir)

jsonFile <- dir(jsonDir, pattern = "*.json")[1]
y <- readLGF(jsonFile, jsonDir)

RCytoGPS documentation built on Feb. 11, 2021, 3:01 a.m.