-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tagging release 4.1 as stable for promethion flowcell and releaseing …
…alfredstats
- Loading branch information
1 parent
7c97f83
commit c502421
Showing
7 changed files
with
208 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"left": { | ||
"splitterpos": 307, | ||
"splitterpos": 345, | ||
"topwindowstate": "HIDE", | ||
"panelheight": 741, | ||
"windowheight": 779 | ||
"panelheight": 835, | ||
"windowheight": 873 | ||
}, | ||
"right": { | ||
"splitterpos": 461, | ||
"splitterpos": 519, | ||
"topwindowstate": "NORMAL", | ||
"panelheight": 741, | ||
"windowheight": 779 | ||
"panelheight": 835, | ||
"windowheight": 873 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"TabSet1": 3, | ||
"TabSet2": 2, | ||
"TabSet2": 0, | ||
"TabZoom": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
build-last-errors="[]" | ||
build-last-errors-base-dir="~/NanoR/" | ||
build-last-outputs="[{\"type\":0,\"output\":\"==> devtools::document(roclets = c('rd', 'collate', 'namespace'))\\n\\n\"},{\"type\":2,\"output\":\"ℹ Updating NanoR documentation\\n\"},{\"type\":2,\"output\":\"ℹ Loading NanoR\\n\"},{\"type\":2,\"output\":\"Warning: package ‘plotly’ was built under R version 4.1.1\\nWarning: package ‘ggplot2’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘scales’ was built under R version 4.1.1\\nWarning: package ‘data.table’ was built under R version 4.1.1\\nWarning: package ‘dplyr’ was built under R version 4.1.1\\nWarning: package ‘tidyr’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: Skipping 'NAMESPACE'\\n✖ It already exists and was not generated by roxygen2.\\n\"},{\"type\":1,\"output\":\"Documentation completed\\n\\n\"},{\"type\":0,\"output\":\"==> R CMD INSTALL --preclean --no-multiarch --with-keep.source NanoR\\n\\n\"},{\"type\":1,\"output\":\"* installing to library ‘/Users/davide.bolognini/Library/R/arm64/4.1/library’\\n\"},{\"type\":1,\"output\":\"* installing *source* package ‘NanoR’ ...\\n\"},{\"type\":1,\"output\":\"** using staged installation\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** R\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** data\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"*** moving datasets to lazyload DB\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** inst\\n\"},{\"type\":1,\"output\":\"** byte-compile and prepare package for lazy loading\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"Warning messages:\\n\"},{\"type\":1,\"output\":\"1: package ‘plotly’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"2: package ‘ggplot2’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"3: package ‘scales’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"4: package ‘data.table’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"5: package ‘dplyr’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"6: package ‘tidyr’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** help\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"*** installing help indices\\n\"},{\"type\":1,\"output\":\"** building package indices\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** testing if installed package can be loaded from temporary location\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":2,\"output\":\"Warning: package ‘plotly’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘ggplot2’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘scales’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘data.table’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘dplyr’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘tidyr’ was built under R version 4.1.1\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** testing if installed package can be loaded from final location\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":2,\"output\":\"Warning: package ‘plotly’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘ggplot2’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘scales’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘data.table’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘dplyr’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘tidyr’ was built under R version 4.1.1\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** testing if installed package keeps a record of temporary installation path\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"* DONE (NanoR)\\n\"},{\"type\":1,\"output\":\"\"}]" | ||
build-last-outputs="[{\"type\":0,\"output\":\"==> devtools::document(roclets = c('rd', 'collate', 'namespace'))\\n\\n\"},{\"type\":2,\"output\":\"ℹ Updating NanoR documentation\\n\"},{\"type\":2,\"output\":\"ℹ Loading NanoR\\n\"},{\"type\":2,\"output\":\"Warning: package ‘plotly’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘ggplot2’ was built under R version 4.1.1\\nWarning: package ‘scales’ was built under R version 4.1.1\\nWarning: package ‘data.table’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘dplyr’ was built under R version 4.1.1\\nWarning: package ‘tidyr’ was built under R version 4.1.1\\n\"},{\"type\":1,\"output\":\"Writing '\\u001B]8;;ide:run:pkgload::dev_help('alfredstats')\\u0007alfredstats.Rd\\u001B]8;;\\u0007'\\n\"},{\"type\":2,\"output\":\"Warning: Skipping 'NAMESPACE'\\n✖ It already exists and was not generated by roxygen2.\\n\"},{\"type\":1,\"output\":\"Documentation completed\\n\\n\"},{\"type\":0,\"output\":\"==> R CMD INSTALL --preclean --no-multiarch --with-keep.source NanoR\\n\\n\"},{\"type\":1,\"output\":\"* installing to library ‘/Users/davide.bolognini/Library/R/arm64/4.1/library’\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"* installing *source* package ‘NanoR’ ...\\n\"},{\"type\":1,\"output\":\"** using staged installation\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** R\\n\"},{\"type\":1,\"output\":\"** data\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"*** moving datasets to lazyload DB\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** inst\\n\"},{\"type\":1,\"output\":\"** byte-compile and prepare package for lazy loading\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"Warning messages:\\n\"},{\"type\":1,\"output\":\"1: package ‘plotly’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"2: package ‘ggplot2’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"3: package ‘scales’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"4: package ‘data.table’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"5: package ‘dplyr’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"6: package ‘tidyr’ was built under R version 4.1.1 \\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** help\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"*** installing help indices\\n\"},{\"type\":1,\"output\":\"** building package indices\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** testing if installed package can be loaded from temporary location\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":2,\"output\":\"Warning: package ‘plotly’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘ggplot2’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘scales’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘data.table’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘dplyr’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘tidyr’ was built under R version 4.1.1\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** testing if installed package can be loaded from final location\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":2,\"output\":\"Warning: package ‘plotly’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘ggplot2’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘scales’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘data.table’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘dplyr’ was built under R version 4.1.1\\n\"},{\"type\":2,\"output\":\"Warning: package ‘tidyr’ was built under R version 4.1.1\\n\"},{\"type\":1,\"output\":\"\"},{\"type\":1,\"output\":\"** testing if installed package keeps a record of temporary installation path\\n\"},{\"type\":1,\"output\":\"* DONE (NanoR)\\n\"},{\"type\":1,\"output\":\"\"}]" | ||
compile_pdf_state="{\"tab_visible\":false,\"running\":false,\"target_file\":\"\",\"output\":\"\",\"errors\":[]}" | ||
files.monitored-path="" | ||
find-in-files-state="{\"handle\":\"\",\"input\":\"\",\"path\":\"\",\"regex\":false,\"ignoreCase\":false,\"results\":{\"file\":[],\"line\":[],\"lineValue\":[],\"matchOn\":[],\"matchOff\":[],\"replaceMatchOn\":[],\"replaceMatchOff\":[]},\"running\":false,\"replace\":false,\"preview\":false,\"gitFlag\":false,\"replacePattern\":\"\"}" | ||
imageDirtyState="1" | ||
saveActionState="-1" | ||
imageDirtyState="0" | ||
saveActionState="0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#' @title alfredstats | ||
#' @description generate an interactive HTML report with statistics from alfred qc (zgrep "^ME <qc.tsv.gz> | cut -f 2- | datamash transpose) | ||
#' @param qcdata path to alfred qc.tsv.gz | ||
#' @param out path to HTML report | ||
#' @return HTML file | ||
#' @examples | ||
#' #do not run | ||
#' qcdata<-file.path("/path/to/qc.tsv.gz") | ||
#' outhtml<-file.path("/path/to/qc.html") | ||
#' NanoR::alfredstats(qcdata=qcdata, out=outhtml) | ||
|
||
alfredstats<-function(qcdata,out) { | ||
|
||
qcdata<-normalizePath(file.path(qcdata)) | ||
out<-file.path(out) | ||
|
||
message("[",Sys.time(),"]"," reading qc data") | ||
|
||
#read, re-organize | ||
df<-fread(qcdata) | ||
|
||
#error-rate | ||
keep<-c("#MatchedBases", "MatchRate", | ||
"#MismatchedBases", "MismatchRate", | ||
"#DeletionsCigarD", "DeletionRate", | ||
"#InsertionsCigarI", "InsertionRate", | ||
"ErrorRate") | ||
|
||
error_df<- df[which(df$Sample %in% keep),] | ||
error_df[match(keep, error_df$Sample),] | ||
|
||
error_df<-transpose(error_df) | ||
names(error_df) <- as.character(unlist(error_df[1,])) | ||
error_df<-error_df[-1,] | ||
TotalErrors<-as.integer(error_df[["#MismatchedBases"]]) + as.integer(error_df[["#DeletionsCigarD"]]) + as.integer(error_df[["#InsertionsCigarI"]]) | ||
error_df<-cbind(error_df,TotalErrors) | ||
colnames(error_df)<-c(colnames(error_df)[c(1:length(colnames(error_df))-1)], c("#TotalErrors")) | ||
cols<-colnames(error_df) | ||
error_df<-transpose(error_df) | ||
error_df$V2<-error_df$V1 | ||
error_df$V1<-cols | ||
|
||
#counts | ||
error_counts_df<-error_df[grepl("#", error_df$V1),] | ||
error_counts_df$V1<-factor(error_counts_df$V1, levels=as.character(error_counts_df$V1)) | ||
#rates | ||
error_rates_df<-error_df[!grepl("#", error_df$V1),] | ||
error_rates_df$V1<-factor(error_rates_df$V1, levels=as.character(error_rates_df$V1)) | ||
|
||
|
||
#aligned reads | ||
|
||
keep<-c("#Unmapped", "UnmappedFraction", | ||
"#Mapped", "MappedFraction", | ||
"#MappedForward", "MappedForwardFraction", | ||
"#MappedReverse", "MappedReverseFraction", | ||
"#SecondaryAlignments", "SecondaryAlignmentFraction", | ||
"#SupplementaryAlignments", "SupplementaryAlignmentFraction", | ||
"#SplicedAlignments", "SplicedAlignmentFraction" | ||
) | ||
|
||
alignment_df<-df[which(df$Sample %in% keep),] | ||
colnames(alignment_df)<-c("V1", "V2") | ||
|
||
#counts | ||
alignment_counts_df<-alignment_df[grepl("#", alignment_df$V1),] | ||
alignment_counts_df$V1<-factor(alignment_counts_df$V1, levels=as.character(alignment_counts_df$V1)) | ||
#rates | ||
alignment_rates_df<-alignment_df[!grepl("#", alignment_df$V1),] | ||
alignment_rates_df$V1<-factor(alignment_rates_df$V1, levels=as.character(alignment_rates_df$V1)) | ||
|
||
f <- list( | ||
size = 10, | ||
color = "#7f7f7f" | ||
) | ||
|
||
|
||
chart_type <- list( | ||
type = "dropdown", | ||
xanchor = 'center', | ||
yanchor = "bottom", | ||
buttons = list( | ||
list(label = "counts", | ||
method = "restyle", | ||
args = list("visible", list(TRUE,FALSE))), | ||
list(label = "rates", | ||
method = "restyle", | ||
args = list("visible", list(FALSE,TRUE))) | ||
) | ||
) | ||
|
||
message("[",Sys.time(),"]"," plotting") | ||
|
||
p1<-plot_ly() %>% add_trace(x=error_counts_df$V1,y=as.numeric(error_counts_df$V2),type="bar", color = I("darkblue"), name = "#bp", visible=TRUE) %>% | ||
add_trace(x=error_rates_df$V1,y=as.numeric(error_rates_df$V2),type="bar", color = I("darkred"), name = ":bp", visible=FALSE) %>% | ||
layout(showlegend=FALSE,updatemenus = list(chart_type)) | ||
|
||
p2<-plot_ly() %>% add_trace(x=alignment_counts_df$V1,y=as.numeric(alignment_counts_df$V2),type="bar", color = I("darkblue"), name = "#reads", visible=TRUE) %>% | ||
add_trace(x=alignment_rates_df$V1,y=as.numeric(alignment_rates_df$V2),type="bar", color = I("darkred"), name = ":reads", visible=FALSE) %>% | ||
layout(showlegend=FALSE,updatemenus = list(chart_type), title="Alfred statistics") | ||
|
||
|
||
fig<- subplot(p1,p2,nrows = 2,titleX=TRUE, titleY=TRUE,margin=.05) | ||
|
||
message("[",Sys.time(),"]"," storing plot to file") | ||
|
||
htmlwidgets::saveWidget(fig, out) | ||
|
||
rm(list=ls()) | ||
invisible(gc()) | ||
|
||
message("[",Sys.time(),"]"," done") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Sample Sample | ||
Library DefaultLib | ||
#QCFail 0 | ||
QCFailFraction 0 | ||
#DuplicateMarked 0 | ||
DuplicateFraction 0 | ||
#Unmapped 1145 | ||
UnmappedFraction 0.00420869 | ||
#Mapped 270911 | ||
MappedFraction 0.995791 | ||
#MappedRead1 270911 | ||
#MappedRead2 0 | ||
RatioMapped2vsMapped1 0 | ||
#MappedForward 136796 | ||
MappedForwardFraction 0.504948 | ||
#MappedReverse 134115 | ||
MappedReverseFraction 0.495052 | ||
#SecondaryAlignments 26 | ||
SecondaryAlignmentFraction 9.59725e-05 | ||
#SupplementaryAlignments 27071 | ||
SupplementaryAlignmentFraction 0.0999258 | ||
#SplicedAlignments 0 | ||
SplicedAlignmentFraction 0 | ||
#Pairs 0 | ||
#MappedPairs 0 | ||
MappedPairsFraction 0 | ||
#MappedSameChr 0 | ||
MappedSameChrFraction 0 | ||
#MappedProperPair 0 | ||
MappedProperFraction 0 | ||
#ReferenceBp 48502 | ||
#ReferenceNs 0 | ||
#AlignedBases 3461850049 | ||
#MatchedBases 3386511047 | ||
MatchRate 0.978237 | ||
#MismatchedBases 36853506 | ||
MismatchRate 0.0106456 | ||
#DeletionsCigarD 23582373 | ||
DeletionRate 0.00681207 | ||
HomopolymerContextDel 0.27756 | ||
#InsertionsCigarI 14903123 | ||
InsertionRate 0.00430496 | ||
HomopolymerContextIns 0.348669 | ||
#SoftClipped 266961 | ||
SoftClipRate 0.98542 | ||
#HardClipped 0 | ||
HardClipRate 0 | ||
ErrorRate 0.0217626 | ||
MedianReadLength 8020 | ||
DefaultLibraryLayout 0 | ||
MedianInsertSize 0 | ||
MedianCoverage 65344 | ||
SDCoverage 7560.2 | ||
CoveredBp 48502 | ||
FractionCovered 1 | ||
BpCov1ToCovNRatio 0 | ||
BpCov1ToCov2Ratio -nan | ||
MedianMAPQ 60 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.