Skip to content

Instantly share code, notes, and snippets.

View dpaudel's full-sized avatar

Dev Paudel dpaudel

View GitHub Profile
@elowy01
elowy01 / BCFtools cheat sheet
Last active April 22, 2024 18:28
BCFtools cheat sheet
*bcftools filter
*Filter variants per region (in this example, print out only variants mapped to chr1 and chr2)
qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz
*printing out info for only 2 samples:
bcftools view -s NA20818,NA20819 filename.vcf.gz
*printing stats only for variants passing the filter:
bcftools view -f PASS filename.vcf.gz
# ---
# title: Export QIIME2 OTU table to compatible file for phyloseq
# description: |
# Three main steps to get to compatible file to import to phyloseq
#
# Outline:
# 1. Export OTU table
# 2. Export taxonomy table
# 3. Export phylogenetic tree
# ---
@kate-crosby
kate-crosby / convert_hmp_plink_ped.py
Created December 3, 2014 01:22
hmp.txt or hmp.txt.gz to plink ped format - use R gist to get map format
@tomhopper
tomhopper / plot_aligned_series.R
Last active June 25, 2023 17:36
Align multiple ggplot2 graphs with a common x axis and different y axes, each with different y-axis labels.
#' When plotting multiple data series that share a common x axis but different y axes,
#' we can just plot each graph separately. This suffers from the drawback that the shared axis will typically
#' not align across graphs due to different plot margins.
#' One easy solution is to reshape2::melt() the data and use ggplot2's facet_grid() mapping. However, there is
#' no way to label individual y axes.
#' facet_grid() and facet_wrap() were designed to plot small multiples, where both x- and y-axis ranges are
#' shared acros all plots in the facetting. While the facet_ calls allow us to use different scales with
#' the \code{scales = "free"} argument, they should not be used this way.
#' A more robust approach is to the grid package grid.draw(), rbind() and ggplotGrob() to create a grid of
#' individual plots where the plot axes are properly aligned within the grid.
@davfre
davfre / bamfilter_oneliners.md
Last active February 24, 2024 01:23
SAM and BAM filtering oneliners
@hadley
hadley / curriculum.md
Created September 27, 2013 20:24
My first stab at a basic R programming curriculum. I think teaching just these topics without overall motivating examples would be extremely boring, but if you're a self-taught R user, this might be useful to help spot your gaps.

Notes:

  • I've tried to break up in to separate pieces, but it's not always possible: e.g. knowledge of data structures and subsetting are tidy intertwined.

  • Level of Bloom's taxonomy listed in square brackets, e.g. http://bit.ly/15gqPEx. Few categories currently assess components higher in the taxonomy.

Programming R curriculum

Data structures

@DannyArends
DannyArends / RqtlTutorial.md
Created February 21, 2012 15:13
Small demo tutorial for R/qtl

R and R/qtl tutorial

Loading example data

R/qtl provides many example data sets in several species and crosses. After loading the package by using either a library() or require() call, these can be loaded into the work space by using the data() function. To load the hyper data set containing measurements on hypertension in mice give the following commands in the R interpreter:

 library(qtl) #Load the R/qtl library