git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/basecallQC@130196 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,165 +1,165 @@ |
1 |
-#' Generate an HTML table of per sample summary demultiplexing statistics |
|
2 |
-#' |
|
3 |
-#' @usage |
|
4 |
-#' \S4method{summaryDemuxTable}{baseCallQC}(object) |
|
5 |
-#' |
|
6 |
-#' @docType methods |
|
7 |
-#' @name summaryDemuxTable |
|
8 |
-#' @rdname summaryDemuxTable |
|
9 |
-#' @aliases summaryDemuxTable summaryDemuxTable,baseCallQC-method |
|
10 |
-#' @author Thomas Carroll |
|
11 |
-#' |
|
12 |
-#' @param object A basecallQC object or list from call to demultiplexMetrics() |
|
13 |
-#' @param output Whether the report contains frozen or sortable tables. Options are "static" and "html" |
|
14 |
-#' @return An HTML table for reporting demultiplexing results. |
|
15 |
-#' @import stringr XML RColorBrewer methods raster |
|
16 |
-#' @examples |
|
17 |
-#' |
|
18 |
-#' fileLocations <- system.file("extdata",package="basecallQC") |
|
19 |
-#' runXML <- dir(fileLocations,pattern="runParameters.xml",full.names=TRUE) |
|
20 |
-#' config <- dir(fileLocations,pattern="config.ini",full.names=TRUE) |
|
21 |
-#' sampleSheet <- dir(fileLocations,pattern="*\\.csv",full.names=TRUE) |
|
22 |
-#' outDir <- file.path(fileLocations,"Runs/161105_D00467_0205_AC9L0AANXX/C9L0AANXX/") |
|
23 |
-#' bcl2fastqparams <- BCL2FastQparams(runXML,config,runDir=getwd(),outDir,verbose=FALSE) |
|
24 |
-#' bclQC <- basecallQC(bcl2fastqparams,RunMetaData=NULL,sampleSheet) |
|
25 |
-#' summaryDemuxTable(bclQC,output="static") |
|
26 |
-#' @export |
|
27 |
-summaryDemuxTable.basecallQC <- function(object,output="static"){ |
|
28 |
- |
|
29 |
- toTable <- object@demultiplexMetrics$summarisedDemuxStats$Summary |
|
30 |
- if(output=="static"){ |
|
31 |
- return(kable(toTable)) |
|
32 |
- } |
|
33 |
- if(output=="html"){ |
|
34 |
- return(DT::datatable(toTable)) |
|
35 |
- } |
|
36 |
-} |
|
37 |
- |
|
38 |
- |
|
39 |
-setGeneric("summaryDemuxTable", function(object="basecallQC",output="character") standardGeneric("summaryDemuxTable")) |
|
40 |
- |
|
41 |
-#' @rdname summaryDemuxTable |
|
42 |
-#' @export |
|
43 |
-setMethod("summaryDemuxTable", signature(object="basecallQC"), summaryDemuxTable.basecallQC) |
|
44 |
- |
|
45 |
- |
|
46 |
-summaryDemuxTable.list <- function(object,output="static"){ |
|
47 |
- toTable <- object$summarisedDemuxStats$Summary |
|
48 |
- if(output=="static"){ |
|
49 |
- return(kable(toTable)) |
|
50 |
- } |
|
51 |
- if(output=="html"){ |
|
52 |
- return(DT::datatable(toTable)) |
|
53 |
- } |
|
54 |
-} |
|
55 |
- |
|
56 |
-#' @rdname summaryDemuxTable |
|
57 |
-#' @export |
|
58 |
-setMethod("summaryDemuxTable", signature(object="list"),summaryDemuxTable.list) |
|
59 |
- |
|
60 |
- |
|
61 |
- |
|
62 |
- |
|
63 |
- |
|
64 |
-#' Creates an HTML table of per sample summary statistics from basecalling results |
|
65 |
-#' |
|
66 |
-#' @usage |
|
67 |
-#' \S4method{summaryConvStatsTable}{baseCallQC}(object) |
|
68 |
-#' |
|
69 |
-#' @docType methods |
|
70 |
-#' @name summaryConvStatsTable |
|
71 |
-#' @rdname summaryConvStatsTable |
|
72 |
-#' @aliases summaryConvStatsTable summaryConvStatsTable,baseCallQC-method |
|
73 |
-#' @author Thomas Carroll |
|
74 |
-#' |
|
75 |
-#' @param object A basecallQC object or list from call to baseCallMetrics() |
|
76 |
-#' @param output Whether the report contains frozen or sortable tables. Options are "static" and "html" |
|
77 |
-#' @return An HTML table for reporting basecalling results. |
|
78 |
-#' @import stringr XML RColorBrewer methods raster |
|
79 |
-#' @examples |
|
80 |
-#' |
|
81 |
-#' fileLocations <- system.file("extdata",package="basecallQC") |
|
82 |
-#' runXML <- dir(fileLocations,pattern="runParameters.xml",full.names=TRUE) |
|
83 |
-#' config <- dir(fileLocations,pattern="config.ini",full.names=TRUE) |
|
84 |
-#' sampleSheet <- dir(fileLocations,pattern="*\\.csv",full.names=TRUE) |
|
85 |
-#' outDir <- file.path(fileLocations,"Runs/161105_D00467_0205_AC9L0AANXX/C9L0AANXX/") |
|
86 |
-#' bcl2fastqparams <- BCL2FastQparams(runXML,config,runDir=getwd(),outDir,verbose=FALSE) |
|
87 |
-#' bclQC <- basecallQC(bcl2fastqparams,RunMetaData=NULL,sampleSheet) |
|
88 |
-#' summaryDemuxTable(bclQC,output="static") |
|
89 |
-#' @export |
|
90 |
-summaryConvStatsTable.basecallQC <- function(object,output="static"){ |
|
91 |
- |
|
92 |
- toTable <- object@baseCallMetrics$summarisedConvStats$Sample_Stats |
|
93 |
- if(output=="static"){ |
|
94 |
- return(kable(toTable)) |
|
95 |
- } |
|
96 |
- if(output=="html"){ |
|
97 |
- return(DT::datatable(toTable)) |
|
98 |
- } |
|
99 |
-} |
|
100 |
- |
|
101 |
-setGeneric("summaryConvStatsTable", function(object="basecallQC",output="character") standardGeneric("summaryConvStatsTable")) |
|
102 |
- |
|
103 |
-#' @rdname summaryConvStatsTable |
|
104 |
-#' @export |
|
105 |
-setMethod("summaryConvStatsTable", signature(object="basecallQC"), summaryConvStatsTable.basecallQC) |
|
106 |
- |
|
107 |
- |
|
108 |
-summaryConvStatsTable.list <- function(object,output="static"){ |
|
109 |
- |
|
110 |
- toTable <- object$summarisedConvStats$Sample_Stats |
|
111 |
- if(output=="static"){ |
|
112 |
- return(kable(toTable)) |
|
113 |
- } |
|
114 |
- if(output=="html"){ |
|
115 |
- return(DT::datatable(toTable)) |
|
116 |
- } |
|
117 |
-} |
|
118 |
- |
|
119 |
-#' @rdname summaryConvStatsTable |
|
120 |
-#' @export |
|
121 |
-setMethod("summaryConvStatsTable", signature(object="list"),summaryConvStatsTable.list) |
|
122 |
- |
|
123 |
- |
|
124 |
-#' Generate an HTML table linking to per sample summary fastq QC statistics from ShortRead |
|
125 |
-#' |
|
126 |
-#' Creates an HTML table linking to per sample summary fastq QC statistics from ShortRead |
|
127 |
-#' |
|
128 |
-#' |
|
129 |
-#' @docType methods |
|
130 |
-#' @name makeFQTable |
|
131 |
-#' @rdname makeFQTable |
|
132 |
-#' |
|
133 |
-#' @author Thomas Carroll |
|
134 |
-#' |
|
135 |
-#' @param object A basecall QC object as returned from basecallQC function |
|
136 |
-#' @param output Whether the report contains frozen or sortable tables. Options are "static" and "html" |
|
137 |
-#' @return A HTML table for reporting fastq QC results from ShortRead. |
|
138 |
-#' Table contains read counts and links to ShortRead QA reports per sample. |
|
139 |
-#' @import stringr XML RColorBrewer methods raster |
|
140 |
-#' @examples |
|
141 |
-#' |
|
142 |
-#' fileLocations <- system.file("extdata",package="basecallQC") |
|
143 |
-#' runXML <- dir(fileLocations,pattern="runParameters.xml",full.names=TRUE) |
|
144 |
-#' config <- dir(fileLocations,pattern="config.ini",full.names=TRUE) |
|
145 |
-#' sampleSheet <- dir(fileLocations,pattern="*\\.csv",full.names=TRUE) |
|
146 |
-#' outDir <- file.path(fileLocations,"Runs/161105_D00467_0205_AC9L0AANXX/C9L0AANXX/") |
|
147 |
-#' bcl2fastqparams <- BCL2FastQparams(runXML,config,runDir=getwd(),outDir,verbose=FALSE) |
|
148 |
-#' bclQC <- basecallQC(bcl2fastqparams,RunMetaData=NULL,sampleSheet) |
|
149 |
-#' #makeFQTable(bclQC,output="static") |
|
150 |
-#' @export |
|
151 |
- |
|
152 |
-makeFQTable <- function(object,output="static"){ |
|
153 |
- fqQCTable <- object@fqQCmetrics$FQQC_Table |
|
154 |
- if(!is.null(fqQCTable)){ |
|
155 |
- if(output=="static"){ |
|
156 |
- table <- kable(fqQCTable,escape = FALSE) |
|
157 |
- } |
|
158 |
- if(output=="html"){ |
|
159 |
- table <- DT::datatable(fqQCTable,escape=FALSE) |
|
160 |
- } |
|
161 |
- return(table) |
|
162 |
- }else{ |
|
163 |
- return(NULL) |
|
164 |
- } |
|
165 |
-} |
|
1 |
+#' Generate an HTML table of per sample summary demultiplexing statistics |
|
2 |
+#' |
|
3 |
+#' @usage |
|
4 |
+#' \S4method{summaryDemuxTable}{baseCallQC}(object) |
|
5 |
+#' |
|
6 |
+#' @docType methods |
|
7 |
+#' @name summaryDemuxTable |
|
8 |
+#' @rdname summaryDemuxTable |
|
9 |
+#' @aliases summaryDemuxTable summaryDemuxTable,baseCallQC-method |
|
10 |
+#' @author Thomas Carroll |
|
11 |
+#' |
|
12 |
+#' @param object A basecallQC object or list from call to demultiplexMetrics() |
|
13 |
+#' @param output Whether the report contains frozen or sortable tables. Options are "static" and "html" |
|
14 |
+#' @return An HTML table for reporting demultiplexing results. |
|
15 |
+#' @import stringr XML RColorBrewer methods raster |
|
16 |
+#' @examples |
|
17 |
+#' |
|
18 |
+#' fileLocations <- system.file("extdata",package="basecallQC") |
|
19 |
+#' runXML <- dir(fileLocations,pattern="runParameters.xml",full.names=TRUE) |
|
20 |
+#' config <- dir(fileLocations,pattern="config.ini",full.names=TRUE) |
|
21 |
+#' sampleSheet <- dir(fileLocations,pattern="*\\.csv",full.names=TRUE) |
|
22 |
+#' outDir <- file.path(fileLocations,"Runs/161105_D00467_0205_AC9L0AANXX/C9L0AANXX/") |
|
23 |
+#' bcl2fastqparams <- BCL2FastQparams(runXML,config,runDir=getwd(),outDir,verbose=FALSE) |
|
24 |
+#' bclQC <- basecallQC(bcl2fastqparams,RunMetaData=NULL,sampleSheet) |
|
25 |
+#' summaryDemuxTable(bclQC,output="static") |
|
26 |
+#' @export |
|
27 |
+summaryDemuxTable.basecallQC <- function(object,output="static"){ |
|
28 |
+ |
|
29 |
+ toTable <- object@demultiplexMetrics$summarisedDemuxStats$Summary |
|
30 |
+ if(output=="static"){ |
|
31 |
+ return(kable(toTable)) |
|
32 |
+ } |
|
33 |
+ if(output=="html"){ |
|
34 |
+ return(DT::datatable(toTable)) |
|
35 |
+ } |
|
36 |
+} |
|
37 |
+ |
|
38 |
+ |
|
39 |
+setGeneric("summaryDemuxTable", function(object="basecallQC",output="character") standardGeneric("summaryDemuxTable")) |
|
40 |
+ |
|
41 |
+#' @rdname summaryDemuxTable |
|
42 |
+#' @export |
|
43 |
+setMethod("summaryDemuxTable", signature(object="basecallQC"), summaryDemuxTable.basecallQC) |
|
44 |
+ |
|
45 |
+ |
|
46 |
+summaryDemuxTable.list <- function(object,output="static"){ |
|
47 |
+ toTable <- object$summarisedDemuxStats$Summary |
|
48 |
+ if(output=="static"){ |
|
49 |
+ return(kable(toTable)) |
|
50 |
+ } |
|
51 |
+ if(output=="html"){ |
|
52 |
+ return(DT::datatable(toTable)) |
|
53 |
+ } |
|
54 |
+} |
|
55 |
+ |
|
56 |
+#' @rdname summaryDemuxTable |
|
57 |
+#' @export |
|
58 |
+setMethod("summaryDemuxTable", signature(object="list"),summaryDemuxTable.list) |
|
59 |
+ |
|
60 |
+ |
|
61 |
+ |
|
62 |
+ |
|
63 |
+ |
|
64 |
+#' Creates an HTML table of per sample summary statistics from basecalling results |
|
65 |
+#' |
|
66 |
+#' @usage |
|
67 |
+#' \S4method{summaryConvStatsTable}{baseCallQC}(object) |
|
68 |
+#' |
|
69 |
+#' @docType methods |
|
70 |
+#' @name summaryConvStatsTable |
|
71 |
+#' @rdname summaryConvStatsTable |
|
72 |
+#' @aliases summaryConvStatsTable summaryConvStatsTable,baseCallQC-method |
|
73 |
+#' @author Thomas Carroll |
|
74 |
+#' |
|
75 |
+#' @param object A basecallQC object or list from call to baseCallMetrics() |
|
76 |
+#' @param output Whether the report contains frozen or sortable tables. Options are "static" and "html" |
|
77 |
+#' @return An HTML table for reporting basecalling results. |
|
78 |
+#' @import stringr XML RColorBrewer methods raster |
|
79 |
+#' @examples |
|
80 |
+#' |
|
81 |
+#' fileLocations <- system.file("extdata",package="basecallQC") |
|
82 |
+#' runXML <- dir(fileLocations,pattern="runParameters.xml",full.names=TRUE) |
|
83 |
+#' config <- dir(fileLocations,pattern="config.ini",full.names=TRUE) |
|
84 |
+#' sampleSheet <- dir(fileLocations,pattern="*\\.csv",full.names=TRUE) |
|
85 |
+#' outDir <- file.path(fileLocations,"Runs/161105_D00467_0205_AC9L0AANXX/C9L0AANXX/") |
|
86 |
+#' bcl2fastqparams <- BCL2FastQparams(runXML,config,runDir=getwd(),outDir,verbose=FALSE) |
|
87 |
+#' bclQC <- basecallQC(bcl2fastqparams,RunMetaData=NULL,sampleSheet) |
|
88 |
+#' summaryDemuxTable(bclQC,output="static") |
|
89 |
+#' @export |
|
90 |
+summaryConvStatsTable.basecallQC <- function(object,output="static"){ |
|
91 |
+ |
|
92 |
+ toTable <- object@baseCallMetrics$summarisedConvStats$Sample_Stats |
|
93 |
+ if(output=="static"){ |
|
94 |
+ return(kable(toTable)) |
|
95 |
+ } |
|
96 |
+ if(output=="html"){ |
|
97 |
+ return(DT::datatable(toTable)) |
|
98 |
+ } |
|
99 |
+} |
|
100 |
+ |
|
101 |
+setGeneric("summaryConvStatsTable", function(object="basecallQC",output="character") standardGeneric("summaryConvStatsTable")) |
|
102 |
+ |
|
103 |
+#' @rdname summaryConvStatsTable |
|
104 |
+#' @export |
|
105 |
+setMethod("summaryConvStatsTable", signature(object="basecallQC"), summaryConvStatsTable.basecallQC) |
|
106 |
+ |
|
107 |
+ |
|
108 |
+summaryConvStatsTable.list <- function(object,output="static"){ |
|
109 |
+ |
|
110 |
+ toTable <- object$summarisedConvStats$Sample_Stats |
|
111 |
+ if(output=="static"){ |
|
112 |
+ return(kable(toTable)) |
|
113 |
+ } |
|
114 |
+ if(output=="html"){ |
|
115 |
+ return(DT::datatable(toTable)) |
|
116 |
+ } |
|
117 |
+} |
|
118 |
+ |
|
119 |
+#' @rdname summaryConvStatsTable |
|
120 |
+#' @export |
|
121 |
+setMethod("summaryConvStatsTable", signature(object="list"),summaryConvStatsTable.list) |
|
122 |
+ |
|
123 |
+ |
|
124 |
+#' Generate an HTML table linking to per sample summary fastq QC statistics from ShortRead |
|
125 |
+#' |
|
126 |
+#' Creates an HTML table linking to per sample summary fastq QC statistics from ShortRead |
|
127 |
+#' |
|
128 |
+#' |
|
129 |
+#' @docType methods |
|
130 |
+#' @name makeFQTable |
|
131 |
+#' @rdname makeFQTable |
|
132 |
+#' |
|
133 |
+#' @author Thomas Carroll |
|
134 |
+#' |
|
135 |
+#' @param object A basecall QC object as returned from basecallQC function |
|
136 |
+#' @param output Whether the report contains frozen or sortable tables. Options are "static" and "html" |
|
137 |
+#' @return A HTML table for reporting fastq QC results from ShortRead. |
|
138 |
+#' Table contains read counts and links to ShortRead QA reports per sample. |
|
139 |
+#' @import stringr XML RColorBrewer methods raster |
|
140 |
+#' @examples |
|
141 |
+#' |
|
142 |
+#' fileLocations <- system.file("extdata",package="basecallQC") |
|
143 |
+#' runXML <- dir(fileLocations,pattern="runParameters.xml",full.names=TRUE) |
|
144 |
+#' config <- dir(fileLocations,pattern="config.ini",full.names=TRUE) |
|
145 |
+#' sampleSheet <- dir(fileLocations,pattern="*\\.csv",full.names=TRUE) |
|
146 |
+#' outDir <- file.path(fileLocations,"Runs/161105_D00467_0205_AC9L0AANXX/C9L0AANXX/") |
|
147 |
+#' bcl2fastqparams <- BCL2FastQparams(runXML,config,runDir=getwd(),outDir,verbose=FALSE) |
|
148 |
+#' bclQC <- basecallQC(bcl2fastqparams,RunMetaData=NULL,sampleSheet) |
|
149 |
+#' #makeFQTable(bclQC,output="static") |
|
150 |
+#' @export |
|
151 |
+ |
|
152 |
+makeFQTable <- function(object,output="static"){ |
|
153 |
+ fqQCTable <- object@fqQCmetrics$FQQC_Table |
|
154 |
+ if(!is.null(fqQCTable)){ |
|
155 |
+ if(output=="static"){ |
|
156 |
+ table <- kable(fqQCTable,escape = FALSE) |
|
157 |
+ } |
|
158 |
+ if(output=="html"){ |
|
159 |
+ table <- DT::datatable(fqQCTable,escape=FALSE) |
|
160 |
+ } |
|
161 |
+ return(table) |
|
162 |
+ }else{ |
|
163 |
+ return(NULL) |
|
164 |
+ } |
|
165 |
+} |
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/basecallQC@128350 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,165 @@ |
1 |
+#' Generate an HTML table of per sample summary demultiplexing statistics |
|
2 |
+#' |
|
3 |
+#' @usage |
|
4 |
+#' \S4method{summaryDemuxTable}{baseCallQC}(object) |
|
5 |
+#' |
|
6 |
+#' @docType methods |
|
7 |
+#' @name summaryDemuxTable |
|
8 |
+#' @rdname summaryDemuxTable |
|
9 |
+#' @aliases summaryDemuxTable summaryDemuxTable,baseCallQC-method |
|
10 |
+#' @author Thomas Carroll |
|
11 |
+#' |
|
12 |
+#' @param object A basecallQC object or list from call to demultiplexMetrics() |
|
13 |
+#' @param output Whether the report contains frozen or sortable tables. Options are "static" and "html" |
|
14 |
+#' @return An HTML table for reporting demultiplexing results. |
|
15 |
+#' @import stringr XML RColorBrewer methods raster |
|
16 |
+#' @examples |
|
17 |
+#' |
|
18 |
+#' fileLocations <- system.file("extdata",package="basecallQC") |
|
19 |
+#' runXML <- dir(fileLocations,pattern="runParameters.xml",full.names=TRUE) |
|
20 |
+#' config <- dir(fileLocations,pattern="config.ini",full.names=TRUE) |
|
21 |
+#' sampleSheet <- dir(fileLocations,pattern="*\\.csv",full.names=TRUE) |
|
22 |
+#' outDir <- file.path(fileLocations,"Runs/161105_D00467_0205_AC9L0AANXX/C9L0AANXX/") |
|
23 |
+#' bcl2fastqparams <- BCL2FastQparams(runXML,config,runDir=getwd(),outDir,verbose=FALSE) |
|
24 |
+#' bclQC <- basecallQC(bcl2fastqparams,RunMetaData=NULL,sampleSheet) |
|
25 |
+#' summaryDemuxTable(bclQC,output="static") |
|
26 |
+#' @export |
|
27 |
+summaryDemuxTable.basecallQC <- function(object,output="static"){ |
|
28 |
+ |
|
29 |
+ toTable <- object@demultiplexMetrics$summarisedDemuxStats$Summary |
|
30 |
+ if(output=="static"){ |
|
31 |
+ return(kable(toTable)) |
|
32 |
+ } |
|
33 |
+ if(output=="html"){ |
|
34 |
+ return(DT::datatable(toTable)) |
|
35 |
+ } |
|
36 |
+} |
|
37 |
+ |
|
38 |
+ |
|
39 |
+setGeneric("summaryDemuxTable", function(object="basecallQC",output="character") standardGeneric("summaryDemuxTable")) |
|
40 |
+ |
|
41 |
+#' @rdname summaryDemuxTable |
|
42 |
+#' @export |
|
43 |
+setMethod("summaryDemuxTable", signature(object="basecallQC"), summaryDemuxTable.basecallQC) |
|
44 |
+ |
|
45 |
+ |
|
46 |
+summaryDemuxTable.list <- function(object,output="static"){ |
|
47 |
+ toTable <- object$summarisedDemuxStats$Summary |
|
48 |
+ if(output=="static"){ |
|
49 |
+ return(kable(toTable)) |
|
50 |
+ } |
|
51 |
+ if(output=="html"){ |
|
52 |
+ return(DT::datatable(toTable)) |
|
53 |
+ } |
|
54 |
+} |
|
55 |
+ |
|
56 |
+#' @rdname summaryDemuxTable |
|
57 |
+#' @export |
|
58 |
+setMethod("summaryDemuxTable", signature(object="list"),summaryDemuxTable.list) |
|
59 |
+ |
|
60 |
+ |
|
61 |
+ |
|
62 |
+ |
|
63 |
+ |
|
64 |
+#' Creates an HTML table of per sample summary statistics from basecalling results |
|
65 |
+#' |
|
66 |
+#' @usage |
|
67 |
+#' \S4method{summaryConvStatsTable}{baseCallQC}(object) |
|
68 |
+#' |
|
69 |
+#' @docType methods |
|
70 |
+#' @name summaryConvStatsTable |
|
71 |
+#' @rdname summaryConvStatsTable |
|
72 |
+#' @aliases summaryConvStatsTable summaryConvStatsTable,baseCallQC-method |
|
73 |
+#' @author Thomas Carroll |
|
74 |
+#' |
|
75 |
+#' @param object A basecallQC object or list from call to baseCallMetrics() |
|
76 |
+#' @param output Whether the report contains frozen or sortable tables. Options are "static" and "html" |
|
77 |
+#' @return An HTML table for reporting basecalling results. |
|
78 |
+#' @import stringr XML RColorBrewer methods raster |
|
79 |
+#' @examples |
|
80 |
+#' |
|
81 |
+#' fileLocations <- system.file("extdata",package="basecallQC") |
|
82 |
+#' runXML <- dir(fileLocations,pattern="runParameters.xml",full.names=TRUE) |
|
83 |
+#' config <- dir(fileLocations,pattern="config.ini",full.names=TRUE) |
|
84 |
+#' sampleSheet <- dir(fileLocations,pattern="*\\.csv",full.names=TRUE) |
|
85 |
+#' outDir <- file.path(fileLocations,"Runs/161105_D00467_0205_AC9L0AANXX/C9L0AANXX/") |
|
86 |
+#' bcl2fastqparams <- BCL2FastQparams(runXML,config,runDir=getwd(),outDir,verbose=FALSE) |
|
87 |
+#' bclQC <- basecallQC(bcl2fastqparams,RunMetaData=NULL,sampleSheet) |
|
88 |
+#' summaryDemuxTable(bclQC,output="static") |
|
89 |
+#' @export |
|
90 |
+summaryConvStatsTable.basecallQC <- function(object,output="static"){ |
|
91 |
+ |
|
92 |
+ toTable <- object@baseCallMetrics$summarisedConvStats$Sample_Stats |
|
93 |
+ if(output=="static"){ |
|
94 |
+ return(kable(toTable)) |
|
95 |
+ } |
|
96 |
+ if(output=="html"){ |
|
97 |
+ return(DT::datatable(toTable)) |
|
98 |
+ } |
|
99 |
+} |
|
100 |
+ |
|
101 |
+setGeneric("summaryConvStatsTable", function(object="basecallQC",output="character") standardGeneric("summaryConvStatsTable")) |
|
102 |
+ |
|
103 |
+#' @rdname summaryConvStatsTable |
|
104 |
+#' @export |
|
105 |
+setMethod("summaryConvStatsTable", signature(object="basecallQC"), summaryConvStatsTable.basecallQC) |
|
106 |
+ |
|
107 |
+ |
|
108 |
+summaryConvStatsTable.list <- function(object,output="static"){ |
|
109 |
+ |
|
110 |
+ toTable <- object$summarisedConvStats$Sample_Stats |
|
111 |
+ if(output=="static"){ |
|
112 |
+ return(kable(toTable)) |
|
113 |
+ } |
|
114 |
+ if(output=="html"){ |
|
115 |
+ return(DT::datatable(toTable)) |
|
116 |
+ } |
|
117 |
+} |
|
118 |
+ |
|
119 |
+#' @rdname summaryConvStatsTable |
|
120 |
+#' @export |
|
121 |
+setMethod("summaryConvStatsTable", signature(object="list"),summaryConvStatsTable.list) |
|
122 |
+ |
|
123 |
+ |
|
124 |
+#' Generate an HTML table linking to per sample summary fastq QC statistics from ShortRead |
|
125 |
+#' |
|
126 |
+#' Creates an HTML table linking to per sample summary fastq QC statistics from ShortRead |
|
127 |
+#' |
|
128 |
+#' |
|
129 |
+#' @docType methods |
|
130 |
+#' @name makeFQTable |
|
131 |
+#' @rdname makeFQTable |
|
132 |
+#' |
|
133 |
+#' @author Thomas Carroll |
|
134 |
+#' |
|
135 |
+#' @param object A basecall QC object as returned from basecallQC function |
|
136 |
+#' @param output Whether the report contains frozen or sortable tables. Options are "static" and "html" |
|
137 |
+#' @return A HTML table for reporting fastq QC results from ShortRead. |
|
138 |
+#' Table contains read counts and links to ShortRead QA reports per sample. |
|
139 |
+#' @import stringr XML RColorBrewer methods raster |
|
140 |
+#' @examples |
|
141 |
+#' |
|
142 |
+#' fileLocations <- system.file("extdata",package="basecallQC") |
|
143 |
+#' runXML <- dir(fileLocations,pattern="runParameters.xml",full.names=TRUE) |
|
144 |
+#' config <- dir(fileLocations,pattern="config.ini",full.names=TRUE) |
|
145 |
+#' sampleSheet <- dir(fileLocations,pattern="*\\.csv",full.names=TRUE) |
|
146 |
+#' outDir <- file.path(fileLocations,"Runs/161105_D00467_0205_AC9L0AANXX/C9L0AANXX/") |
|
147 |
+#' bcl2fastqparams <- BCL2FastQparams(runXML,config,runDir=getwd(),outDir,verbose=FALSE) |
|
148 |
+#' bclQC <- basecallQC(bcl2fastqparams,RunMetaData=NULL,sampleSheet) |
|
149 |
+#' #makeFQTable(bclQC,output="static") |
|
150 |
+#' @export |
|
151 |
+ |
|
152 |
+makeFQTable <- function(object,output="static"){ |
|
153 |
+ fqQCTable <- object@fqQCmetrics$FQQC_Table |
|
154 |
+ if(!is.null(fqQCTable)){ |
|
155 |
+ if(output=="static"){ |
|
156 |
+ table <- kable(fqQCTable,escape = FALSE) |
|
157 |
+ } |
|
158 |
+ if(output=="html"){ |
|
159 |
+ table <- DT::datatable(fqQCTable,escape=FALSE) |
|
160 |
+ } |
|
161 |
+ return(table) |
|
162 |
+ }else{ |
|
163 |
+ return(NULL) |
|
164 |
+ } |
|
165 |
+} |