https://github.com/csoneson/rna_velocity_quant

Evaluation of the effect of quantification choices on RNA velocity estimates

https://github.com/csoneson/rna_velocity_quant

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: pubmed.ncbi, ncbi.nlm.nih.gov
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.7%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Evaluation of the effect of quantification choices on RNA velocity estimates

Basic Info
  • Host: GitHub
  • Owner: csoneson
  • License: mit
  • Language: Makefile
  • Default Branch: master
  • Homepage:
  • Size: 2.39 MB
Statistics
  • Stars: 27
  • Watchers: 4
  • Forks: 3
  • Open Issues: 0
  • Releases: 0
Created almost 7 years ago · Last pushed over 4 years ago
Metadata Files
Readme License

README.md

Preprocessing choices affect RNA velocity results for droplet scRNA-seq data

This repository contains the scripts used to generate the results in

  • C Soneson, A Srivastava, R Patro, MB Stadler: Preprocessing choices affect RNA velocity results for droplet scRNA-seq data. bioRxiv (2020).

Repository structure

In this manuscript, five real scRNA-seq data sets generated by 10x Genomics technology were analyzed:

For each of these data sets, the corresponding subfolder of this repository contains the Makefile that was used to run the analysis. The R and Python scripts called in these Makefiles are provided in the scripts/ folder.

Data preprocessing

The downloaded data was preprocessed as follows before being used in the evaluation:

Dentate gyrus

import scvelo as scv adata = scv.datasets.dentategyrus() adata.obs.to_csv("cells_kept_in_scvelo_exampledata.csv")

Pancreas

  • FASTQ files for the E15.5 sample were downloaded from ENA (accession date November 24, 2019)
  • The FASTQ files were subsequently renamed, replacing _X with S1_L001_RX_001 (for X = 1,2)
  • The sample annotation file (cells_kept_in_scvelo_exampledata.csv) was obtained via the scVelo Python package (v0.1.24):

import scvelo as scv aadata = scv.datasets.pancreatic_endocrinogenesis() aadata.obs.to_csv("cells_kept_in_scvelo_exampledata.csv")

OldBrain

  • The BAM file with the reads was downloaded (accession date September 18, 2020) from SRA
  • FASTQ files were extracted from the BAM file using bamtofastq v1.1.2:

``` bamtofastq_1.1.2/bamtofastq --reads-per-fastq=500000000 OX1X.bam FASTQtmp

Concatenate FASTQ files from all flowcells and lanes

mkdir -p FASTQ cat FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L001I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L002I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L003I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L004I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L001I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L002I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L003I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L004I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L001I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L002I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L003I1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L004I1001.fastq.gz > \ FASTQ/OX1XS1L001I1001.fastq.gz

cat FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L001R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L002R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L003R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L004R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L001R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L002R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L003R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L004R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L001R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L002R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L003R1001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L004R1001.fastq.gz > \ FASTQ/OX1XS1L001R1001.fastq.gz

cat FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L001R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L002R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L003R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HNGW3BGX2/bamtofastqS1L004R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L001R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L002R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L003R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HVN2NBGX2/bamtofastqS1L004R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L001R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L002R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L003R2001.fastq.gz \ FASTQtmp/s9MissingLibrary1HW2M3BGX2/bamtofastqS1L004R2001.fastq.gz > \ FASTQ/OX1XS1L001R2001.fastq.gz ```

  • The sample annotation file (GSE129788_Supplementary_meta_data_Cell_Types_Etc.txt) was downloaded from the GEO record. It was processed to retain only cells from sample 37 using the following R code, generating the final cells_in_sample37.csv file.

``` suppressPackageStartupMessages({ library(dplyr) })

csv <- read.delim("GSE129788SupplementarymetadataCellTypesEtc.txt", header = FALSE, as.is = TRUE, skip = 2) colnames(csv) <- read.delim("GSE129788SupplementarymetadataCellTypesEtc.txt", header = FALSE, as.is = TRUE)[1, ]

Only Sample 37

csv <- csv %>% dplyr::filter(grepl("Agingmousebrainportaldata37", NAME)) %>% dplyr::mutate(index = gsub("Agingmousebrainportaldata37", "", NAME)) %>% dplyr::rename(clusters = cellclasses, clusterscoarse = cluster) %>% dplyr::select(index, clusterscoarse, clusters, everything())

write.table(csv, file = "cellsinsample37.csv", row.names = FALSE, col.names = TRUE, sep = ",", quote = FALSE)

```

PFC

  • The BAM file with the reads was downloaded (accession date December 19, 2019) from SRA
  • FASTQ files were extracted from the BAM file using bamtofastq v1.1.2:

``` bamtofastq1.1.2/bamtofastq --reads-per-fastq=500000000 PFCSample2.bam FASTQtmp

Concatenate FASTQ files from all flowcells and lanes

mkdir -p FASTQ cat FASTQtmp/PFCsample2MissingLibrary1HJW35BCXY/bamtofastqS1L001I1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HJW35BCXY/bamtofastqS1L002I1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNNFBCXY/bamtofastqS1L001I1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNNFBCXY/bamtofastqS1L002I1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNTLBCXY/bamtofastqS1L001I1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNTLBCXY/bamtofastqS1L002I1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HNGGMBCXY/bamtofastqS1L001I1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HNGGMBCXY/bamtofastqS1L002I1001.fastq.gz > \ FASTQ/PFCsample2S1L001I1001.fastq.gz

cat FASTQtmp/PFCsample2MissingLibrary1HJW35BCXY/bamtofastqS1L001R1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HJW35BCXY/bamtofastqS1L002R1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNNFBCXY/bamtofastqS1L001R1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNNFBCXY/bamtofastqS1L002R1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNTLBCXY/bamtofastqS1L001R1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNTLBCXY/bamtofastqS1L002R1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HNGGMBCXY/bamtofastqS1L001R1001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HNGGMBCXY/bamtofastqS1L002R1001.fastq.gz > \ FASTQ/PFCsample2S1L001R1001.fastq.gz

cat FASTQtmp/PFCsample2MissingLibrary1HJW35BCXY/bamtofastqS1L001R2001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HJW35BCXY/bamtofastqS1L002R2001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNNFBCXY/bamtofastqS1L001R2001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNNFBCXY/bamtofastqS1L002R2001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNTLBCXY/bamtofastqS1L001R2001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HMNTLBCXY/bamtofastqS1L002R2001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HNGGMBCXY/bamtofastqS1L001R2001.fastq.gz \ FASTQtmp/PFCsample2MissingLibrary1HNGGMBCXY/bamtofastqS1L002R2001.fastq.gz > \ FASTQ/PFCsample2S1L001R2001.fastq.gz ```

  • The sample annotation file (GSE124952_meta_data.csv) was downloaded from the GEO record. It was processed to retain only cells from PFCsample2 using the following R code, generating the final cells_in_pfcsample2.csv file:

``` suppressPackageStartupMessages({ library(dplyr) })

csv <- read.delim("GSE124952metadata.csv", header = TRUE, as.is = TRUE, sep = ",")

Only Sample2

csv <- csv %>% dplyr::filter(Sample == "PFCSample2") %>% dplyr::mutate(Sample = gsub("Sample", "sample", Sample)) %>% dplyr::mutate(index = gsub("PFCSample2", "", X)) %>% dplyr::rename(clusters = CellType, clusterscoarse = L2clusters) %>% dplyr::select(index, clusterscoarse, clusters, everything())

write.table(csv, file = "cellsinpfcsample2.csv", row.names = FALSE, col.names = TRUE, sep = ",", quote = FALSE) ```

Spermatogenesis

  • The BAM file from the AdultMouse_Rep3 sample was downloaded (accession date January 23, 2020) from SRA.
  • FASTQ files were extracted from the BAM file using bamtofastq v1.1.2:

bamtofastq_1.1.2/bamtofastq --reads-per-fastq=500000000 AdultMouse_Rep3_possorted_genome_bam.bam FASTQtmp mkdir -p FASTQ mv FASTQtmp/Ad-Ms-Total-Sorted_20k_count_MissingLibrary_1_HK2GNBBXX/bamtofastq_S1_L006_I1_001.fastq.gz FASTQ/AdultMouseRep3_S1_L001_I1_001.fastq.gz mv FASTQtmp/Ad-Ms-Total-Sorted_20k_count_MissingLibrary_1_HK2GNBBXX/bamtofastq_S1_L006_R1_001.fastq.gz FASTQ/AdultMouseRep3_S1_L001_R1_001.fastq.gz mv FASTQtmp/Ad-Ms-Total-Sorted_20k_count_MissingLibrary_1_HK2GNBBXX/bamtofastq_S1_L006_R2_001.fastq.gz FASTQ/AdultMouseRep3_S1_L001_R2_001.fastq.gz

  • The sample annotation file (spermatogenesis_loupe_celltypes_repl3.csv) was obtained by downloading the loupe file Mouse Unselected Spermatogenic cells.cloupe from here, loading it into the 10x Genomics Loupe browser and exporting the "Cell Type" labels. The resulting file was subset to only include replicate 3 and cell types with at least 5 cells, using the following R code:

``` suppressPackageStartupMessages({ library(dplyr) })

csv <- read.delim("SpermatogenesisLoupeCellTypes.csv", header = TRUE, as.is = TRUE, sep = ",")

Only Replicate 3

csv <- csv %>% dplyr::filter(grepl("-3", Barcode)) %>% dplyr::mutate(index = gsub("-3", "", Barcode)) %>% dplyr::mutate(clusters = Cell.Types, clusterscoarse = Cell.Types) %>% dplyr::select(index, clusterscoarse, clusters)

Remove rare cell types (<5 cells)

tbl <- table(csv$clusters) kp <- names(tbl)[tbl >= 5] csv <- csv %>% dplyr::filter(clusters %in% kp)

write.table(csv, file = "spermatogenesisloupecelltypes_repl3.csv", row.names = FALSE, col.names = TRUE, sep = ",", quote = FALSE) ```

Reference generation

All reference files were obtained from GENCODE, mouse release M21. In addition to the reference files and indices generated in the respective Makefiles, the following indices were prepared:

CellRanger index

The CellRanger index was generated as follows (with CellRanger v3.0.2):

cellranger mkref --nthreads 64 \ --genome=cellranger3_0_2_GRCm38.primary_assembly_gencodeM21_spliced \ --fasta=GRCm38.primary_assembly.genome.fa \ --genes=gencode.vM21.annotation.gtf \ --ref-version=GRCm38.primary_assembly_gencodeM21_spliced

STAR index

The STAR index used for quantification was generated using STAR v 2.7.3a:

mkdir star2_7_3a_GRCm38.primary_assembly_gencodeM21_spliced_sjdb150 STAR \ --runThreadN 48 \ --runMode genomeGenerate \ --genomeDir ./star2_7_3a_GRCm38.primary_assembly_gencodeM21_spliced_sjdb150 \ --genomeFastaFiles GRCm38.primary_assembly.genome.fa \ --genomeSAindexNbases 14 \ --genomeChrBinNbits 18 \ --sjdbGTFfile gencode.vM21.annotation.gtf \ --sjdbOverhang 150

Transcript-to-gene mapping

Finally, the transcript-to-gene mapping files (in .rds and .txt format) were generated with R v3.6/Bioconductor release 3.9 as follows:

``` suppressPackageStartupMessages({ library(rtracklayer) library(dplyr) })

entrez <- read.delim("gencode.vM21.metadata.EntrezGene", header = FALSE, as.is = TRUE) %>% setNames(c("transcriptid","entrezid")) gtf <- rtracklayer::import("gencode.vM21.annotation.gtf") gtftx <- subset(gtf, type == "transcript") gtfex <- subset(gtf, type == "exon")

df <- data.frame(gtftx, stringsAsFactors = FALSE) %>% dplyr::select(transcriptid, seqnames, start, end, strand, source, geneid, genetype, genename, level, havanagene, transcripttype, transcriptname, transcriptsupportlevel, tag, havanatranscript) %>% dplyr::leftjoin(data.frame(gtfex, stringsAsFactors = FALSE) %>% dplyr::groupby(transcriptid) %>% dplyr::summarize(transcriptlength = sum(width)), by = "transcriptid") %>% dplyr::leftjoin(entrez, by = "transcript_id")

dfsub <- df %>% dplyr::select(transcriptid, geneid)

write.table(dfsub, file = "gencode.vM21.annotation.tx2gene.txt", sep = "\t", quote = FALSE, row.names = FALSE, col.names = FALSE) saveRDS(dfsub, file = "gencode.vM21.annotation.tx2gene.rds") saveRDS(df, file = "gencode.vM21.annotation.tx2gene_full.rds") ```

Owner

  • Name: Charlotte Soneson
  • Login: csoneson
  • Kind: user

GitHub Events

Total
Last Year

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 68
  • Total Committers: 2
  • Avg Commits per committer: 34.0
  • Development Distribution Score (DDS): 0.029
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Charlotte Soneson c****n@g****m 66
Soneson s****r@x****h 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels