Skip to content

Instantly share code, notes, and snippets.

@hussius
hussius / sleuth_commands.R
Created September 14, 2015 07:52
Sleuth commands
# Installation (only needs to be done once)
source("http://bioconductor.org/biocLite.R")
biocLite("rhdf5")
install.packages("devtools")
devtools::install_github("pachterlab/sleuth")
# Now load the package
library("sleuth")
# A function (borrowed from the Sleuth documentation) for connecting Ensembl transcript names to common gene names
@hussius
hussius / kallisto_setup.sh
Last active December 11, 2020 15:45
Kallisto setup
# Download Kallisto and sratools (the latter to be able to download from SRA)
wget https://github.com/pachterlab/kallisto/releases/download/v0.42.3/kallisto_mac-v0.42.3.tar.gz
tar zvxf kallisto_mac-v0.42.3.tar.gz
wget http://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/2.5.2/sratoolkit.2.5.2-mac64.tar.gz
tar zxvf sratoolkit.2.5.2-mac64.tar.gz
# Download and merge human cDNA and ncDNA files from Ensembl for the index.
wget ftp://ftp.ensembl.org/pub/current_fasta/homo_sapiens/cdna/Homo_sapiens.GRCh38.cdna.all.fa.gz
wget ftp://ftp.ensembl.org/pub/current_fasta/homo_sapiens/ncrna/Homo_sapiens.GRCh38.ncrna.fa.gz
cat Homo_sapiens.GRCh38.cdna.all.fa.gz Homo_sapiens.GRCh38.ncrna.fa.gz > Homo_sapiens.GRCh38.rna.fa.gz
# Plot histogram
(def d (read-dataset "/Users/mikaelhuss/Desktop/SAGE-liver-CVD/deliver_clinical_traits.txt" :header true :delim \tab))
(view (histogram (filter number? (sel d :cols 5))))
# Or the same with with-data
(with-data
(read-dataset "/Users/mikaelhuss/Desktop/SAGE-liver-CVD/deliver_clinical_traits.txt" :header true :delim \tab)
(view (histogram (filter number? ($ 5 )))))