Code Monkey home page Code Monkey logo

ref-txome's Introduction

RNA-seq quantification with Salmon in the Data Refinery Context

The ideas herein were formulated during a trip Kurt Wheeler (@kurtwheeler) and I took to the COMBINE Lab (and the discussion that followed), with input from/discussion with Rob Patro (@rob-p) and Hirak Sarkar (@hiraksarkar), specifically.


The Arabidopsis thaliana example is a rough sketch of what we might expect the RNA-seq component of transcriptomic data processing to look like in its most basic form. (Note that this has not undergone any code review process at present.)

Obtaining sequencing data

Several A. thaliana RNA-seq samples are downloaded from the European Nucleotide Archive by running 0-athaliana_data_dl.sh in the top directory.

The examples include:

  • A paired-end sample with a read length of 100bp -- DRR016125
  • A single-end example with a read length of 36bp -- SRR074262
  • An single-end experiment, read length 50bp -- PRJNA408323

Creating a custom reference txome

An A. thaliana custom reference can be obtained by running 1-athaliana_custom_ref.shin the top directory.

This runs scripts/get_custom_transcripts_fasta.sh, which is the main script for preparing the custom reference. The GTF file is first filtered to remove any pseudogenes, as we expect these will negatively affect on our ability to quantify protein-coding transcripts (see also #1), and then passes this filtered GTF and the top level DNA FASTA file to rsem-prepare-reference for building the custom reference. scripts/check_for_pseudogene_removal.R is currently also run to determine if the GTF was correctly filtered and the custom reference contains all the expected transcripts.

The A. thaliana genome information is pulled from Ensembl Plants. There are two other examples: R. norvegicus (from Ensembl) & H. sapiens (from GENCODE), rnorvegicus_custom_ref.sh and hsapiens_custom_ref.sh, respectively.

Building a txome index

Two txome indices for use with Salmon (specifically quasi-mapping-based mode) are built by running 2-athaliana_build_index.sh in the top directory:

  • A "short" index
    • For use with reads 50bp or less
    • -k 23
  • A "normal" index
    • For use with all longer reads (the majority of what is publicly available)
    • -k 31

See the Salmon documentation for more information about building an index for a transcriptome.

Quantification with Salmon

Quantification with Salmon for our three examples is performed with 3-athaliana_quant.sh

Note: The distribution of read lengths in a fastq file determines which txome index is appropriate for use with quant.

Summarize to gene

4-athaliana_tximport.R summarizes the output of salmon quant to the gene-level. Specifically, we are interested in length-scaled transcripts per million (TPM). (See #6.)


Checking read length from fastq file

An A. thaliana example adapted from Xiajun Dong and Laurent Modolo. (Note that this is not particularly fast.)

zcat athaliana/data/SRR6080007/SRR6080007.fastq.gz \
  | awk 'NR%4 == 2 {lengths[length($0)]++} END {for (l in lengths) \
    {print l, lengths[l]}}'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.