Skip to content

Instantly share code, notes, and snippets.

@samesense
Last active July 23, 2018 14:52
Show Gist options
  • Save samesense/3bf8c42cb6406c2bb27cf4705f8e1e72 to your computer and use it in GitHub Desktop.
Save samesense/3bf8c42cb6406c2bb27cf4705f8e1e72 to your computer and use it in GitHub Desktop.
pausing-index-max-by-gene.R
require(dplyr)
require(magrittr)
in_file = "WT_JC4.pausing.2018_05_31.csv"
df = read.delim(in_file, header=TRUE, sep="\t")
maxes <- group_by(df, .dots=c("exp", "gene")) %>% summarize(pausing_index=max(pausing_index))
m = merge(as.data.frame(maxes), df, by=c("exp", "gene", "pausing_index"))
write.table(m, "out.tmp", row.names=FALSE, sep="\t", quote=F)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment