Skip to content

Instantly share code, notes, and snippets.

View gatoravi's full-sized avatar

Avinash R gatoravi

View GitHub Profile
@gatoravi
gatoravi / extractCalls.sh
Created March 20, 2012 16:00
The cutoff file contains the number of DeNovoGear calls for a particular posterior probability cutoff. Extract the same number of SamTools calls. If there is a tie in the last Likelihood Ratio value then pick all calls with that CLR value
#Avinash Ramu, WUSTL
#! /bin/bash
#The cutoff file contains the number of DeNovoGear calls for a particular posterior probability cutoff. Extract the same number of SamTools calls. If there is a tie in the last Likelihood Ratio value then pick all calls with that CLR value
cutoff_f=1e-8Cutoffs
STop=STop_nonX_sorted
for cutoff in `cat $cutoff_f`
do
ggplot(t_m) + geom_bar(stat = "identity", aes(x=V3.x, y=V4)) + geom_bar(stat = "identity", aes(x=V5, y=V6), fill = "red") + facet_wrap(~ V17) + labs(title = paste("BetaBinomial_pp = ", t_m$V2.y, " DNG_ST_pp = ", t_m$V3.y), x = t_m$V18, y = "Read Count")
@gatoravi
gatoravi / tumorVsNormal.R
Created February 21, 2014 20:58
tumorVsNormal.R
usage <- function()
{
writeLines("Usage:\n\tRscript tumorVsNormal.R tumor.bam normal.bam chromosome")
}
args <- commandArgs(trailingOnly = TRUE)
if(length(args) != 3) {
usage()
quit()
@gatoravi
gatoravi / python_example.py
Last active August 29, 2015 13:56
Python example to use the DGIdb API
#!/usr/bin/env python
#This example uses the 'requests' library
#To install requests:
# sudo pip install requests
#If you don't have pip:
# see http://www.pip-installer.org/en/latest/installing.html
# or
# wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
# sudo python get-pip.py
@gatoravi
gatoravi / tumorVsNormals.captureRegions.R
Last active August 29, 2015 13:56
tumorVsNormals.captureRegions.R
usage <- function()
{
writeLines("Usage:\n\tRscript tumorVsNormal.R tumor.bam normal.bam capture.bed")
}
args <- commandArgs(trailingOnly = TRUE)
if(length(args) != 3) {
usage()
quit()
@gatoravi
gatoravi / index.html
Created April 8, 2014 20:06
Scatterplot
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://ramnathv.github.io/rCharts/libraries/widgets/polycharts/js/polychart2.standalone.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
# load up area shape file:
library(maptools)
area <- readShapePoly("ne_10m_parks_and_protected_lands_area.shp")
# # or file.choose:
# area <- readShapePoly(file.choose())
library(RColorBrewer)
colors <- brewer.pal(9, "BuGn")
@gatoravi
gatoravi / Cnmops.R
Created August 14, 2014 21:45
Somatic (tumor vs normal) copy number calling with CnMops
#!/usr/bin/env Rscript
library(cn.mops)
usage <- function()
{
writeLines("Usage:\n\tRscript Cnmops.pm.R tumor.bam normal.bam capture.bed outdir --test[or --notest]")
}
convert_start_end_character <-function(t) {
t$start <- sprintf("%d", t$start)
@gatoravi
gatoravi / kMerAnalysis.chr22.null.v6.sh
Last active May 13, 2017 05:02
A script to generate kmer counts in a region for trios.
#Avinash Ramu, Conrad Lab, WUSTL
#Estimate the kmer statistic in a specified window
#use overlapping windows to capture the kmers at the edges. Make sure the start of the read lies within the window.
#Arguments - a region in the form "chr\tstart\tstop" i.e $1=chr $2=start $3=end
#Updates
#modified - 6/13 made it $6 - ($7 + $8 ) in other words I removed /2
#modified - 6/14 cleanup the code.
#modified - 6/19 add a column for the reference kmer counts
@gatoravi
gatoravi / workflow_example.pm
Last active August 29, 2015 14:15
An example workflow on TGI's GMS.
sub _run_workflow {
my $self = shift;
my $lsf_queue = $ENV{GENOME_LSF_QUEUE_BUILD_WORKER_ALT};
my $lsf_project = 'varscan_filter';
my $w = Workflow::Operation->create(
name => "Filter Varscan SNVs",
operation_type => Workflow::OperationType::Command->get(
'Genome::Model::Tools::Capture::FormatSnvs')
);