txs_ms_dge_summary: Species-specific transcripts

Description Usage Arguments Value Examples

View source: R/species_mixing.R

Description

Calculate number of species-specific transcripts per cell from DGE summary files of a species mixing experiment.

Usage

1
txs_ms_dge_summary(dge_summary, min_txs = 1000, min_frac = 0.9)

Arguments

dge_summary

data.frame containing the merged summary information from summary files created by DigitalExpression from Drop-seq tools. Needs to have at least columns named CELL_BARCODE, NUM_TRANSCRIPTS_SPECIES1, NUM_TRANSCRIPTS_SPECIES2 (case insensitive, SPECIES* sould be actual species name). Merging of summary files can be done by using read_ms_dge_summary. For instructions how to extract dge data from species-mixing experiments, see the Drop-seq alignment cookbook provided by the [McCarroll lab](http://mccarrolllab.com/dropseq/).

min_txs

Cells with less than min_txs detected transcripts are not assigned to a species (NA).

min_frac

Minimal fraction of transcripts per cell that need to come from one species so that the cell to be assigned to that species. E.g. min_frac = 0.9 means that if at least 90 mapped to the human genome the cell will be labelled as human. If a cell has less than min_frac transcripts mapping to one species, the cell will be labeled as mixed.

Value

A data.frame containing number and fraction of transcripts per species, and inferred species for each cell.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(dropseqr)
library(ggplot2)

# load example DigitalExpression summary information
data(ms_dge_summary)

# summarize number of species-specific transcripts cell and assign cells to
# species. at least a total of 6000 transcripts are required per cell to
# assign the cell to a species
txs <- txs_ms_dge_summary(ms_dge_summary, min_txs = 6000)

# visualize the results using ggplot2
ggplot(txs, aes(num_transcripts_human, num_transcripts_mouse)) +
  geom_point(aes(colour = species), alpha = 0.5) +
  xlab("Human transcripts") +
  ylab("Mouse transcripts") +
  scale_colour_manual(values = c("tomato", "blueviolet", "dodgerblue"),
                      na.value = "gray50",
                      breaks = c("human", "mouse", "mixed"))

argschwind/dropseqr documentation built on May 23, 2019, 4:24 p.m.