h5tocsv: sparse to dense

View source: R/h5tocsv.R

h5tocsvR Documentation

sparse to dense

Description

This function takes h5 or mtx file from cellranger output and convert it in a csv table.

Usage

h5tocsv(
  group = c("sudo", "docker"),
  file,
  type = c("h5", "10xgenomics"),
  version = "5"
)

Arguments

group

a character string. Two options: sudo or docker, depending to which group the user belongs

file

path of the sparse matrix file. For h5 file the full path MUST be included. For mtx matrix the folder MUST contain tsv and mtx files and the FULL path to mtx matrix MUST be provided

type

h5 refers to h5 files and 10xgenomics to the folder containing barcodes.tsv, genes.tsv and matrix.mtx

version

cellranger version: 2, 3 or 5.

Value

a dense matrix, with 0s, in csv and txt format

Author(s)

Raffaele Calogero, raffaele [dot] calogero [at] unito [dot] com, University of Torino

Examples

## Not run: 
home <- getwd()
library(rCASC)
#download from https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE106268 the GSE106268_RAW.tar file
system("tar xvf GSE106268_RAW.tar")
h5tocsv(group="docker", file=paste(getwd(),"GSM2833284_Naive_WT_Rep1.h5",sep="/"), type="h5"))
system("wget http://130.192.119.59/public/annotated_setPace_10000_noC5.txt.zip")
unzip("annotated_setPace_10000_noC5.txt.zip")
csvToSparse(group="docker", scratch="/data/scratch", file=paste(getwd(), 
            "annotated_setPace_10000_noC5.txt", sep="/"), separator="\t")
            
h5tocsv(group="docker", file=paste(getwd(),"matrix.mtx",sep="/"), type="10xgenomics")

## End(Not run)



kendomaniac/rCASC documentation built on July 3, 2024, 6:05 a.m.