maxplanck-ie / snakepipes

Customizable workflows based on snakemake and python for the analysis of NGS data
http://snakepipes.readthedocs.io
389 stars 88 forks source link

fix nearest Gene annotation on CSAW_DBR #996

Closed katsikora closed 7 months ago

katsikora commented 8 months ago

Reported by Ronald.

ibed_tab<-data.table::fread(input_bed,header=FALSE)
t2g_tab<-data.table::fread(t2g,header=FALSE)
gs_tab<-data.table::fread(gene_symbol,header=FALSE)

ibed_tab$GeneID<-t2g_tab$V2[match(ibed_tab$V22,t2g_tab$V1)]
ibed_tab$GeneSymbol<-gs_tab$V2[match(ibed_tab$GeneID,gs_tab$V1)]
obed_tab<-unique(subset(ibed_tab,select=c(paste0("V",c(1:18,23,24)),"GeneID","GeneSymbol")))
colnames(obed_tab)<-c("Chromosome","Start","End","Width","Strand","Score","nWindows","logFC.up","logFC.down","PValue","FDR","direction","rep.test","rep.logFC","best.logFC","best.test","best.start","Name","GeneStrand","Distance","GeneID","GeneSymbol")