TENxTSV: A class to represent 10x tab separated values files
Source:R/TENxTSV-class.R
TENxTSV-class.RdThis class is general purpose for reading in tabular data from
the 10x Genomics website with the .tsv file extension. The class also
supports compressed files, i.e., those with the .tsv.gz extension.
Usage
# S4 method for class 'TENxTSV,ANY,ANY'
import(con, format, text, ...)
TENxTSV(resource, compressed = FALSE, ...)
# S4 method for class 'TENxTSV'
metadata(x, ...)Arguments
- con
The connection from which data is loaded or to which data is saved. If this is a
charactervector, it is assumed to be a file name and a corresponding file connection is created and then closed after exporting the object. If it is a BiocFile derivative, the data is loaded from or saved to the underlying resource. If missing, the function will return the output as a character vector, rather than writing to a connection.- format
The format of the output. If missing and
conis a file name, the format is derived from the file extension. This argument is unnecessary whenconis a derivative of BiocFile.- text
If
conis missing, this can be a character vector directly providing the string data to import.- ...
Parameters to pass to the format-specific method.
- resource
character(1) The path to the file
- compressed
logical(1) Whether the resource file is compressed (default FALSE)
- x
A
TENxTSVobject
Details
Typical .tsv files obtained from the 10X website are compressed
and contain information relevant to 'barcodes' and 'features'. Currently,
the code only supports files such as features.tsv.* and barcodes.tsv.*.
Functions
import(con = TENxTSV, format = ANY, text = ANY): General import method fortsvfiles from 10x; usingreadr::read_tsvand returning atibblerepresentationmetadata(TENxTSV):metadatamethod forTENxTSVobjects