Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
N
ngs_tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
bioinfo
ngs_tools
Commits
fdb214a3
Commit
fdb214a3
authored
Jan 31, 2018
by
Holger Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cont cutadapt pe report (still incomplete)
parent
2418d783
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
dge_workflow/deprecated/cutadapt_summary_pe.R
dge_workflow/deprecated/cutadapt_summary_pe.R
+10
-10
No files found.
dge_workflow/deprecated/cutadapt_summary_pe.R
View file @
fdb214a3
...
...
@@ -78,24 +78,24 @@ readSummaryStats <- function(logFile){
# DEBUG logFile=logDataFiles[1]
data.frame
(
Run
=
sub
(
"^([^.]*).*"
,
"\\1"
,
basename
(
logFile
))
%>%
tidySamples
,
No_of_processed_Reads
=
(
paste
(
"grep -F 'Total read' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
strsplit
(
"[^0-9]+"
)
%>%
unlist
()
%>%
as.numeric
())[
2
],
No_of_processed_Bases
=
(
paste
(
"grep -F 'Total basepairs processed' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
strsplit
(
"[^0-9]+"
)
%>%
unlist
()
%>%
as.numeric
())[
2
],
Trimmed_Reads
=
(
paste
(
"grep -F 'Trimmed reads' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
strsplit
(
"[^0-9\\.]+"
)
%>%
unlist
()
%>%
as.numeric
())[
3
],
Quality_trimmed
=
(
paste
(
"grep -F 'Quality-trimmed' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
strsplit
(
"[^0-9\\.]+"
)
%>%
unlist
()
%>%
as.numeric
())[
4
],
Trimmed_Bases
=
(
paste
(
"grep -F 'Trimmed bases' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
strsplit
(
"[^0-9\\.]+"
)
%>%
unlist
()
%>%
as.numeric
())[
4
],
Too_short_Reads
=
(
paste
(
"grep -F 'Too short reads' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
strsplit
(
"[^0-9\\.]+"
)
%>%
unlist
()
%>%
as.numeric
())[
3
]
No_of_processed_Reads
=
paste
(
"grep -F 'Total read pairs processed' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
str_split
(
fixed
(
":"
))
%>%
unlist
()
%>%
{
.
[
2
]}
%>%
str_trim
%>%
str_replace
(
","
,
""
)
%>%
as.numeric
(),
No_of_processed_Bases
=
paste
(
"grep -F 'Total basepairs processed' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
str_replace_all
(
","
,
""
)
%>%
strsplit
(
"[^0-9]+"
)
%>%
unlist
()
%>%
as.numeric
()
%>%
{
.
[
2
]}
,
# Trimmed_Reads=(paste("grep -F 'Trimmed reads' ", logFile ) %>% pipe() %>% readLines() %>% strsplit( "[^0-9\\.]+") %>% unlist() %>% as.numeric())[3],
Quality_trimmed
=
paste
(
"grep -F 'Quality-trimmed' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
str_replace_all
(
","
,
""
)
%>%
strsplit
(
"[^0-9\\.]+"
)
%>%
unlist
()
%>%
as.numeric
()
%>%
{
.
[
3
]},
# Trimmed_Bases=(paste("grep -F 'Trimmed bases' ", logFile ) %>% pipe() %>% readLines() %>% strsplit( "[^0-9\\.]+") %>% unlist() %>% as.numeric())[4],
Too_short_Reads
=
paste
(
"grep -F 'too short' "
,
logFile
)
%>%
pipe
()
%>%
readLines
()
%>%
str_replace_all
(
","
,
""
)
%>%
strsplit
(
"[^0-9\\.]+"
)
%>%
unlist
()
%>%
as.numeric
()
%>%
{
.
[
3
]}
)
}
trimmingStats
<-
logDataFiles
%>%
map_df
(
readSummaryStats
)
#+ results = 'asis'
trimmingStats
%>%
head
()
%>%
kable
()
trimmingStats
%>%
table_browser
()
write_tsv
(
trimmingStats
,
file
=
"cutadapt_summary.trimmingStats.txt"
)
#' [Trimming Statistics](cutadapt_summary.trimmingStats.txt)
myfun
<-
function
(
x
)
x
/
100
trimmingStats
<-
mutate_each
(
trimmingStats
,
funs
(
myfun
),
Trimmed_Reads
,
Quality_trimmed
,
Trimmed_Bases
,
Too_short_Reads
)
#
myfun <- function(x) x/100
#
trimmingStats <- mutate_each(trimmingStats, funs(myfun), Trimmed_Reads, Quality_trimmed, Trimmed_Bases, Too_short_Reads)
#+ fig.height=nrow(trimmingStats)/3, fig.width=12
require
(
scales
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment