Skip to content

Commit

Permalink
Update getVariantSeq.R
Browse files Browse the repository at this point in the history
  • Loading branch information
Akmazad committed Jul 29, 2020
1 parent 599c134 commit b94ebb2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Data Processing/Variant data processing/getVariantSeq.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
getVariabntSeq <- function(dat, flankingLength){
getVariantSeq <- function(dat, flankingLength){
require(data.table)
require(BSgenome.Hsapiens.UCSC.hg19)
require(dplyr)
Expand Down Expand Up @@ -62,18 +62,18 @@ ncSNPs = fread(paste0(dir,ncSNPFileName,".BED")) %>% as.data.frame() %>% dplyr::
colnames(ncSNPs) = c("Chr", "Pos", "Ref", "Alt", "Strand")
ncSNPs$Label = "1"
# invoke function for sequence retreival and save
fwrite(getVariabntSeq(ncSNPs, flankingLength), file = paste0(dir, filename, "_fastaseq_Positives.csv"), sep = ",")
fwrite(getVariantSeq(ncSNPs, flankingLength), file = paste0(dir, filename, "_", ncSNPFileName, "_fastaseq_Positives.csv"), sep = ",")


# True Negative (i.e. non-Functional SNPs - from deepSea supple table 5)
filename="deepsea_supple_tabale5"
# anything other than "eQTL" is negative
dat = as.data.frame(fread(paste0(filename, ".csv"),header = T)) %>% dplyr::filter(label != "eQTL")
dat = fread(paste0(dir, filename, ".csv")) %>% dplyr::filter(label != "eQTL") %>% as.data.frame()
# dat[,8] = ifelse(dat[,8] == "eQTL",1,0)
dat = dat[,c(2,3,4,5)]
colnames(dat) <- c("Chr","Pos","Ref","Alt")
dat$Label = "0"
dat$Strand = "+"

# invoke function for sequence retreival and save
fwrite(getVariabntSeq(dat, flankingLength), file = paste0(dir, filename, "_fastaseq_Negatives.csv"), sep = ",")
fwrite(getVariantSeq(dat, flankingLength), file = paste0(dir, filename, "_fastaseq_Negatives.csv"), sep = ",")

0 comments on commit b94ebb2

Please sign in to comment.