kassambara / fastqcr

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

read mulitple files and overlaying plots #4

Closed MahShaaban closed 7 years ago

MahShaaban commented 7 years ago

Hi @kassambara, I have been working on a package similar to fastqcr, then I found about yours and I think it's well written. I would like to suggest some code to enable a visual comparison between multiple samples:

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

# read all modules in all files
qc <- qc_read_collection(qc.files,
                         sample_names = paste('S', 1:5, sep = ''),
                         modules = 'Per sequence GC content')
Output of `r head(qc)`
$per_sequence_gc_content
    sample GC Content     Count
1       S1          0      81.0
2       S1          1      44.0
3       S1          2      14.0
4       S1          3      39.5
5       S1          4      58.0
6       S1          5      78.5
7       S1          6     143.0
8       S1          7     264.5
9       S1          8     342.5
10      S1          9     427.5

rplot

If you find these suggestions interesting, I can write the extensions to plotting other modules and figure out a dispatch method on the original qc_readclass and qc_read_collection.

kassambara commented 7 years ago

Great job Man and thank you for your contribution. Being able to plot a collection of samples will be extremely useful to the community.

Please make sure to add your name in the documentation to give you the credit.

#'@author Mahmoud Shaaban, \email{mahmoud.s.fahmy@@students.kasralainy.edu.eg}

MahShaaban commented 7 years ago

I am glad you find the suggestions interesting, @kassambara. I will follow with another pull request with the plotting functions for the other modules.