Skip to content

Instantly share code, notes, and snippets.

View brianjmpark's full-sized avatar

Brian Jungmin Park brianjmpark

View GitHub Profile
#requires tab delimited output file after running genescf
#re-generates default scatterplot output from genescf with improved readability
#requires two arguments from r console: imported raw genescf output table and name of sample group
graph_genescf <- function(table, name){
require(ggplot2)
require(plyr)
table <- table[,c(2,3,4,5,6)]
table <- arrange(table, P.value)
table <- table[1:20,]
##takes output from bedtools intersect output tab delimted file containing all instances at which two annotations intersect
##bedtools intersect input of alignment.bed file and gff/gtf3 annotation
##script output count table of unique gene ID and number of intersect counts (collapsed under one gene id)
function count_intersect() {
echo "using file name $1.tsv"
cut -f15 $1_intersect_final.tsv |
tail -n +2 |
awk -F '[;]' '{print $2}' |
awk -F '["]' '{print $2}' |