Skip to content

Instantly share code, notes, and snippets.

View gatoravi's full-sized avatar

Avinash R gatoravi

View GitHub Profile
@gatoravi
gatoravi / tomasetti-vogelstein-table-s1.tsv
Created April 29, 2016 21:27 — forked from lmmx/tomasetti-vogelstein-table-s1.tsv
Tomasetti & Vogelstein (2015) Science 'bad luck of cancer' paper supplementary table S1. Finalised via Yaniv Erlich & Aaron Quinlan's draft clean-ups of the PDF supplement
Cancer_type Lifetime_cancer_incidence Total_cells_tissue Total_Stem_Cells Stem_cell_divisions_per_year Stem_cell_divisions_per_lifetime LSCD
ALL 0.0041 3000000000000 135000000 12 960 129900000000
BCC 0.3 180000000000 5820000000 7.6 608 3550000000000
CLL 0.0052 3000000000000 135000000 12 960 129900000000
Colorectal 0.048 30000000000 200000000 73 5840 1168000000000
Colorectal_FAP 1 30000000000 200000000 73 5840 1168000000000
Colorectal_Lynch 0.5 30000000000 200000000 73 5840 1168000000000
Duodenum_adenocarcinoma 0.0003 680000000 4000000 24 1947 7796000000
Duodenum_adenocarcinoma_with_FAP 0.035 680000000 4000000 24 1947 7796000000
Esophageal_squamous_cell_carcinoma 0.001938 3240000000 846000 17.4 1390 1203000000
@gatoravi
gatoravi / lsf_job_groups.md
Last active May 26, 2016 20:05
LSF job groups notes.

List lsf job groups bjgroup -s /username

Make a new one: bgadd -L <job_limit> <name>

Alter the limit later: bgmod

@gatoravi
gatoravi / check_inodes.txt
Created June 10, 2016 02:43
To check inodes - lsf disk usage
df $path and df -i $path to check space and inodes
@gatoravi
gatoravi / cis_ase_generate_testdata.sh
Created June 30, 2016 20:20
cis_ase_generate_testdata
rm -f simulated_hets.bam && python simulate_bam_reads.py ~/dat/ref/hs37d5/all_sequences.fa 0.5 1:100000 1:100200 1:10040 0 1:100600 1:100800 | samtools view -bh > simulated_hets.bam && samtools index simulated_hets.bam
rm -f simulated_hets.bam && python simulate_bam_reads.py ~/dat/ref/hs37d5/all_sequences.fa 1.0 1:100000 1:100200 1:10040 0 1:100600 1:100800 | samtools view -bh > simulated_homs.bam && samtools index simulated_homs.bam
rm -f cis_ase_tumor_rna.bam && python simulate_bam_reads.py ~/src/regtools/tests/integration-test/data/fa/test_chr22.fa 0 22:1050 22:1550 22:1950 22:2050 22:2550 22:2950 22:3050 22:3550 22:3950 | samtools view -bh > cis_ase_tumor_rna.bam && samtools index cis_ase_tumor_rna.bam
rm -f cis_ase_tumor_dna.bam && python simulate_bam_reads.py ~/src/regtools/tests/integration-test/data/fa/test_chr22.fa 0.5 22:1050 22:1550 22:1950 22:2050 22:2550 22:2950 22:3050 22:3550 22:3950 | samtools view -bh > cis_ase_tumor_dna.bam && samtools index cis_ase_tumor_dn
@gatoravi
gatoravi / to_read_from_ramharish.md
Last active May 11, 2017 04:45
Books to read from @ramare
  • Intelligent investor, genuinely serious book on investing and how to read markets...but like a textbook
  • Short history of nearly everything by Bill Bryson, must read - damn cool book
  • Good to Great...amazing book if u want to learn how to study companies...seemingly easy to read but can make it tough for yourself if u want to get into nitty gritty...
  • Buffett by Roger Lowenstein
  • Barbarians at the Gate, for fiction feel of a non fiction story...good time pass...
  • Rise and Fall of Nations by Ruchir sharma
  • Fooled by randomness, book about stats and how markets are
@gatoravi
gatoravi / movies.md
Last active November 11, 2020 21:29
Movies to watch
  • Aaranya kaandam
  • Madras
  • Thani oruvan
  • Joker (2016)
  • Pariyerum Perumal BA.BL
  • Andhadhun
  • Ittefaq
  • Evaru (same as Badla)
@gatoravi
gatoravi / slurm_commands.md
Created May 16, 2017 19:23
Slurm information
sacct -u aru
      JobID    JobName  Partition    Account  AllocCPUS      State ExitCode
------------ ---------- ---------- ---------- ---------- ---------- --------
5718685      interacti+ interacti+      dcl          1  COMPLETED      0:0
5718686      interacti+ interacti+      dcl          1  COMPLETED      0:0
sacct -j 5719109 --format=JobID,JobName,MaxRSS,Elapsed
JobID JobName MaxRSS Elapsed
@gatoravi
gatoravi / git-file-limit.md
Created July 16, 2017 20:22
Set file limits in git

The default soft (warning) and hard (error) size limits are set to 500,000 and 10,000,000 bytes but can be overriden through the hooks.filesizesoftlimit and hooks.filesizehardlimit settings respectively:

$ git config hooks.filesizesoftlimit 100000
$ git config hooks.filesizehardlimit 4000000
@gatoravi
gatoravi / estimate_negative_binomial.R
Last active May 29, 2018 20:05
Estimate parameters of a negative binomial distribution using method of moments
> counts <- rnbinom(1000, size = 10, p = 0.1)
> mu <- mean(counts)
> p <- mu/var(counts)
> r <- mu ^ 2/(var(counts) - mu)
> hist(counts, freq = F)
> curve(dnbinom(x, size = r, prob = p), from = 0, to = max(counts), n = max(counts) + 1)
first_time <- function() {
t1 <- read.table("../ALL.chrY.phase3_integrated_v1b.20130502.genotypes.vcf.gz")
print(nrow(t1))
nucs <- c('A', 'C', 'G', 'T')
t1 <- t1[t1$V4 %in% nucs & t1$V5 %in% nucs, ]
print(nrow(t1))
t2 <- t1[, 10:ncol(t1)]
t2 <- sapply(t2, as.character)
save(t2, file = "t2")
}