@@ -16,30 +16,10 @@ log_threshold(INFO)
1616# Import file with plots style
1717source(snakemake @ params [[" design" ]])
1818
19- # SARS-CoV-2 anotation for genome scheme
20- SCov2_annotation <- list (
21- " five_prime_UTR" = c(1 : 265 ),
22- " orf1ab" = c(266 : 21555 ),
23- " Intergenic_1" = c(21556 : 21562 ),
24- " S" = c(21563 : 25384 ),
25- " Intergenic_2" = c(25385 : 25392 ),
26- " ORF3a" = c(25393 : 26220 ),
27- " Intergenic_3" = c(26221 : 26244 ),
28- " E" = c(26245 : 26472 ),
29- " Intergenic_4" = c(26473 : 26522 ),
30- " M" = c(26523 : 27191 ),
31- " Intergenic_5" = c(27192 : 27201 ),
32- " ORF6" = c(27202 : 27387 ),
33- " Intergenic_6" = c(27388 : 27393 ),
34- " ORF7" = c(27394 : 27759 ),
35- " Intergenic_7" = c(27760 : 27893 ),
36- " ORF8" = c(27894 : 28259 ),
37- " Intergenic_8" = c(28260 : 28273 ),
38- " N" = c(28274 : 29533 ),
39- " Intergenic_9" = c(29534 : 29557 ),
40- " ORF10" = c(29558 : 29674 ),
41- " three_prime_UTR" = c(29675 : 29903 )
42- )
19+ log_info(" Reading inputs" )
20+
21+ # Anotation for genome scheme
22+ coordinates <- read_json(snakemake @ input $ coordinates )
4323
4424vcf <- read_delim(snakemake @ input [[" vcf" ]])
4525vcf_snp <- vcf
@@ -78,20 +58,20 @@ vcf <- vcf %>%
7858 ALT
7959 )
8060
81- # Df with gene length for scheme
61+ # Create dataframe with gene length for scheme
8262notation_empty <- data.frame (
8363 gene = " " ,
8464 len = 0
8565) %> %
8666 filter(len != 0 )
8767
8868notation <- lapply(
89- names(SCov2_annotation ),
69+ names(coordinates ),
9070 function (x ) {
9171 add_row(
9272 notation_empty ,
9373 gene = x ,
94- len = length(SCov2_annotation [[x ]])
74+ len = length(coordinates [[x ]])
9575 )
9676 }
9777) %> %
@@ -184,7 +164,7 @@ variants <- vcf %>%
184164 aes(
185165 x = len ,
186166 y = 0.3 ,
187- fill = factor (gene , rev(names(SCov2_annotation )))
167+ fill = factor (gene , rev(names(coordinates )))
188168 ),
189169 inherit.aes = FALSE ,
190170 width = 0.3
0 commit comments