Skip to content

Instantly share code, notes, and snippets.

View guineverelee's full-sized avatar

Guinevere Q. Lee guineverelee

View GitHub Profile
@guineverelee
guineverelee / VSuppVReb401_Gist.R
Created June 22, 2015 22:38
Survival Analysis: Sample R script to retrieve (1) date of virologic suppression (2) date of post-suppression virologic rebound from a longitudinal database file
#Goal: To find out time-to-: VSupp401 VReb401 etc (days and event0/censor1)
#Keyboard shortcuts
#Run-all F5
#Run-line Ctrl+R
#CSV date MUST be in yyyy-mm-dd or yyyy/mm/dd (otherwise error)
#format: A character string. If not specified, it will try '"%Y-%m-%d"' then '"%Y/%m/%d"' on the first non-'NA' element, and give an error if neither works.
#csv must be sorted already by PATID and coldate
#Step1: Settings: Input filename
@guineverelee
guineverelee / R_Hypermut_ver01.R
Created May 3, 2018 21:05
Hypermut Plus: Statistical and graphic tool for the impact of APOBEC-3G/F on HIV genomes. 2018
#To calculate Fisher's p and look at the genome distribution of hypermutated sites in your amplicon, please input an aligned fasta with reference sequence at the top
#Step 00. Setup R
rm(list=ls())
closeAllConnections()
graphics.off()
cat("\014") #send CTRL+L to R, clean console
StartSysTime <- Sys.time()
MyWD <- getwd()
setwd(MyWD)