I am using Seurat to cluster data that previously has been filtered, aligned and turned into DGE by the Drop-Seq alignment pipline from Drop-seq tools. This has created a file sample_DGE.txt.gz. I then want to cluster my data and do a QC analysis through calculating the percent mithocondrial genes. I am following the Seurat Clustering tutorial found here: https://satijalab.org/seurat/pbmc3k_tutorial.html In this tutorial they use the files barcodes.tsv, genes.tsv and matrix.mtx generated by 10x genomics as raw data, and read it with the command Read10X(). I have generated these three files from our DGE data inspired by this biostars page:  https://www.biostars.org/p/312933/#312954 It works fine, except that the row name title "GENE" is stored as a column name, saved into barcodes.tsv, which later in Seurat is a problem because seurat uses "GENE" as one of the cell barcodes when calculating the percent mitochondrial DNA per cell. Example below:

![enter image description here][1]


This of course, makes it impossible to use VlnPlot, generating the error: 
>>VlnPlot(object = pbmc, features.plot = c("nGene", "nUMI", "percent.mito"), nCol = 3)
 >>Error in if(all(data[,feature] == data[,feature][2])) { : missing value where TRUE/FALSE needed

Simple removing "GENE" manually from the barcodes.tsv file creates a error in dimensions at the Read10X step. 

>>pbmc.data <- Read10X(data.dir = "dir/to/barcode_matrix_and_gene_files")
>> Error in dimnamesGets(x, value) : invalid dimnames given for "dgTMatrix" object
stop(gettextf("invalid dimnames given for %s object" dQuote(class(x))),  domail + NA)
dimnamesGets(x, value)

SO my question is: do anyone know a workaround to this problem? Or is there an equivalent to Read10X(), say ReadDGE() or ReadDropseq() that can be used directly on my DGE file?


  [1]: https://i.imgur.com/CRBwP3K.png
  [2]: http://%3Ca%20href=%22http://www.freeimagehosting.net/commercial-photography/%22%3E%3Cimg%20src=%22https://i.imgur.com/CRBwP3K.png%22%20alt=%22Commercial%20Photography%22%3E%3C/a%3E
Because I like closure I will answer my own question. You need to read in the DGE data before Creating the seurat object. You also need to define column and row names manually and set the data type of data for both the row names (character) and the rest of the data columns (numeric)

    #Read DGE file
    pbmc.data <- read.table(file = "DGE.txt", header = TRUE, row.names = 1, colClasses =c("character", rep("numeric", 10000)))

I can hardcode 10000 since I chose to include 10000 cells already in the DGE step.

    # Initialize the Seurat object with the raw (non-normalized data).
    # Keep all genes expressed in >= 3 cells (~0.1% of the data). Keep all cells with at least 200 detected genes
    pbmc <- CreateSeuratObject(raw.data = pbmc.data, min.cells = 3, min.genes = 200, project = "10X_PBMC")

Thanks again @igor for giving me the clue to figure this out! :)