kassambara / fastqcr

fastqcr: Quality Control of Sequencing Data
http://www.sthda.com/english/rpkgs/fastqcr
67 stars 22 forks source link

extend `qc_read_collection` to take list of `qc_read` not only raw files #14

Open MahShaaban opened 5 years ago

MahShaaban commented 5 years ago

Hi @kassambara

I previously suggested qc_read_collection and qc_plot_collection to handle multiple files of the fastqc output. The read function is however limited to using the raw fastqc files. I want to suggest adding a data argument to qcr_read_collection to deal with a case where the raw files are not available but rather a list of qc_read objects distributed as an R object.

The behavior of qc_read_collection can be modified to something like this

# extract paths to the demo files
qc.dir <- system.file("fastqc_results", package = "fastqcr")
qc.files <- list.files(qc.dir, full.names = TRUE)

# read list of files
qc_list <- lappy(qc.files, qc_read)

# make a collection object
qc_collection <- qc_read_collection(data = qc_list, sample_names = paste('S', 1:5, sep = ''))