-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathuserScript.R
More file actions
66 lines (45 loc) · 1.78 KB
/
userScript.R
File metadata and controls
66 lines (45 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
library(KOIOS)
setwd("C:/Users/ldyer/Documents/KOIOS2.0/KOIOS/")
##### Input #####
#Load the OMOP Genomic Concept library
concepts <- loadConcepts()
#Load the VCF file
vcf <- loadVCF(userVCF = "SomeVCF.vcf ")
#Set the reference genome to "auto"
ref <- "hg19"
##### Run - Single VCF #####
if(ref == "auto"){
ref <- findReference(vcf)
}
ref.df <- loadReference(ref)
vcf.df <- processVCF(vcf)
vcf.df <- generateHGVSG(vcf = vcf.df, ref = ref.df)
vcf.df <- processClinGen(vcf.df, ref = ref, progressBar = F)
vcf.df <- addConcepts(vcf.df, concepts, returnAll = T)
##### Run - Multiple VCFs #####
#Load the VCF directory
vcf <- loadVCF(userVCF = "SomeDirectory/")
#Set ref to hg19
ref <- "hg19"
concepts.df <- multiVCFPipeline(vcf, ref, concepts)
##### Alternative Data Formats #####
#cBioPortal - Variants
concepts <- loadConcepts()
mutations <- read.csv("data_mutations.txt", sep = "\t")
mut_vcf <- processcBioPortal(mutations)
mut_vcf <- processClinGen(mut_vcf, ref = "hg19")
mut_vcf <- addConcepts(mut_vcf,concepts)
#cBioPortal - Fusions
concepts_fusion <- loadConcepts_fusions()
fusions_data <- read.csv("data_sv.txt", sep = "\t")
fusions_data <- generateFusions_cBioPortal(fusions_data,concepts_fusion)
#cBioPortal - Transcripts
concepts_ext <- loadConcepts_extended()
mutations <- read.csv("data_mutations.txt", sep = "\t")
mut_transcripts <- mutations[,c(5,6,7,11,13,14,38)]
mut_transcripts$Input_ID <- c(1:length(mut_transcripts$HGVSc))
#Version information may be removed to increase the range of possible matches
#This may introduce some false positive matched concepts
#mut_transcripts$match_hgvs <- gsub(".[0-9]*:",":",mut_transcripts$HGVSc)
#concepts_ext$match_hgvs <- gsub(".[0-9]*:",":",concepts_ext$concept_synonym_name)
mut_merge <- merge(mut_transcripts,concepts_ext,by="match_hgvs")