Skip to content

Commit 91ed257

Browse files
committed
Fix reading of JSON coordinates
1 parent 7a16b47 commit 91ed257

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

workflow/scripts/report/NV_description.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ source(snakemake@params[["design"]])
1919
log_info("Reading inputs")
2020

2121
# Anotation for genome scheme
22-
coordinates <- read_json(snakemake@input$coordinates)
22+
coordinates <- lapply(
23+
read_json(snakemake@input$coordinates, simplifyVector = TRUE),
24+
function(x) x[1]:x[2]
25+
)
2326

2427
vcf <- read_delim(snakemake@input[["vcf"]])
2528
vcf_snp <- vcf
@@ -468,7 +471,7 @@ model <- lm(n ~ CollectionDate, data = figur_SNP_table)
468471

469472
# Calculate correlation, if possible
470473
if (nrow(figur_SNP_table) > 2) {
471-
p.value <- summary(model)$coefficients[2,4]
474+
p.value <- summary(model)$coefficients[2, 4]
472475
} else {
473476
p.value <- NA
474477
}

0 commit comments

Comments
 (0)