Skip to content

Commit

Permalink
BclconvertReports: read fastqlist
Browse files Browse the repository at this point in the history
  • Loading branch information
pdiakumis committed Aug 14, 2024
1 parent 0f09e21 commit c9f4a28
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
26 changes: 21 additions & 5 deletions R/bclconvert.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
#'
#' @examples
#' \dontrun{
#' indir <- file.path(
#' "~/icav1/g/production/analysis_data/SBJ00596/tso_ctdna_tumor_only",
#' "2024050555972acf/L2400482/Results/PTC_ctTSO240429_L2400482/dracarys_gds_sync"
#' )
#' indir <- file.path()
#' sample_id <- "PTC_ctTSO240429"
#' library_id <- "L2400482"
#' d <- TsoCombinedVariantOutputFile$new(x)
Expand Down Expand Up @@ -160,16 +157,35 @@ BclconvertReports <- R6::R6Class(
d |>
dplyr::rename(dplyr::all_of(lookup))
}
.read_fastqlist <- function(x) {
nms <- tibble::tribble(
~new_nm, ~old_nm, ~class,
"rgid", "RGID", "c",
"rgsm", "RGSM", "c",
"rglb", "RGLB", "c",
"lane", "Lane", "c",
"1", "Read1File", "c",
"2", "Read2File", "c"
)
lookup <- tibble::deframe(nms[c("new_nm", "old_nm")])
d <- readr::read_csv(x, col_types = readr::cols(.default = "c"))
assertthat::assert_that(all(colnames(d) == nms[["old_nm"]]))
d |>
dplyr::rename(dplyr::all_of(lookup)) |>
tidyr::pivot_longer(c("1", "2"), names_to = "read", values_to = "path")
}

am <- .read_adaptermetrics(file.path(p, "Adapter_Metrics.csv"))
ds <- .read_demultiplexstats(file.path(p, "Demultiplex_Stats.csv"))
ih <- .read_indexhoppingcounts(file.path(p, "Index_Hopping_Counts.csv"))
ub <- .read_topunknownbarcodes(file.path(p, "Top_Unknown_Barcodes.csv"))
fq <- .read_fastqlist(file.path(p, "fastq_list.csv"))
list(
adapter_metrics = am,
demultiplex_stats = ds,
index_hopping_counts = ih,
top_unknown_barcodes = ub
top_unknown_barcodes = ub,
fastq_list = fq
)
},

Expand Down
2 changes: 1 addition & 1 deletion man/Wf_bcl_convert.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c9f4a28

Please sign in to comment.