Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
eScience
ICoVeR
Commits
e75ae2b4
Commit
e75ae2b4
authored
Nov 03, 2015
by
Bertjan Broeksema
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a simple script to simplify working with CheckM results in RStudio.
parent
ae51b157
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
R.postprocessing/ParseCheckMResults.R
R.postprocessing/ParseCheckMResults.R
+20
-0
No files found.
R.postprocessing/ParseCheckMResults.R
0 → 100644
View file @
e75ae2b4
checkm.file
<-
"bin_stats_ext.tsv"
checkm.raw
<-
read.csv
(
checkm.file
,
sep
=
"\t"
,
header
=
F
)
checkm.raw
[,
2
]
<-
gsub
(
"'"
,
"\""
,
checkm.raw
[,
2
])
checkm.parsed
<-
as.data.frame
(
t
(
rbind
(
sapply
(
checkm.raw
[,
2
],
jsonlite
::
fromJSON
))))
rownames
(
checkm.parsed
)
<-
checkm.raw
$
V1
# IF checkm.file == bin_stats_ext THEN
ignore
<-
c
(
"GCN0"
,
"GCN1"
,
"GCN2"
,
"GCN3"
,
"GCN4"
,
"GCN5+"
)
checkm.parsed
<-
checkm.parsed
[
,
-
which
(
names
(
checkm.parsed
)
%in%
ignore
)]
checkm.parsed
[
,
c
(
1
:
4
,
6
:
27
)]
<-
apply
(
checkm.parsed
[
,
c
(
1
:
4
,
6
:
27
)],
2
,
function
(
x
)
as.numeric
(
x
))
# ELSE IF checkm.file == bin_stats.analyze.tsv THEN
checkm.parsed
[
,
c
(
1
:
15
)]
<-
apply
(
checkm.parsed
[
,
c
(
1
:
15
)],
2
,
function
(
x
)
as.numeric
(
x
))
# Write the results as csv
write.csv
(
checkm.parsed
,
file
=
gsub
(
".tsv"
,
".csv"
,
checkm.file
))
# Or view the table within R directly
View
(
checkm.parsed
)
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