Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
60d0fb74
Commit
60d0fb74
authored
Feb 05, 2016
by
Peter van 't Hof
Browse files
Added testing for qiime biom to krona method
parent
6b8b3a37
Changes
3
Hide whitespace changes
Inline
Side-by-side
public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsQiimeClosed.scala
View file @
60d0fb74
...
...
@@ -79,8 +79,6 @@ object GearsQiimeClosed {
val
counts
:
mutable.Map
[
String
,
Long
]
=
mutable
.
Map
()
def
totalCount
(
sample
:
String
)
:
Long
=
counts
.
getOrElse
(
sample
,
0L
)
+
childs
.
map
(
_
.
totalCount
(
sample
)).
sum
override
def
toString
()
=
s
"$level:$name:$counts"
def
node
:
Elem
=
{
val
sizes
=
sortedSamples
.
map
{
sample
=>
<
val
>{
totalCount
(
sample
)
}</
val
>
}
val
size
=
<
size
>{
sizes
}</
size
>
...
...
public/gears/src/test/resources/otu_table.biom
0 → 100644
View file @
60d0fb74
This source diff could not be displayed because it is too large. You can
view the blob
instead.
public/gears/src/test/scala/nl/lumc/sasc/biopet/pipelines/gears/GearsQiimeClosedTest.scala
0 → 100644
View file @
60d0fb74
package
nl.lumc.sasc.biopet.pipelines.gears
import
java.io.File
import
java.nio.file.Paths
import
org.scalatest.Matchers
import
org.scalatest.testng.TestNGSuite
import
org.testng.annotations.Test
/**
* Created by pjvan_thof on 2/5/16.
*/
class
GearsQiimeClosedTest
extends
TestNGSuite
with
Matchers
{
private
def
resourcePath
(
p
:
String
)
:
String
=
{
Paths
.
get
(
getClass
.
getResource
(
p
).
toURI
).
toString
}
@Test
def
testQiimeBiomToKrona
:
Unit
=
{
val
qiimeBiomFile
=
new
File
(
resourcePath
(
"/otu_table.biom"
))
val
outputFile
=
File
.
createTempFile
(
"krona."
,
".xml"
)
outputFile
.
deleteOnExit
()
GearsQiimeClosed
.
qiimeBiomToKrona
(
qiimeBiomFile
,
outputFile
)
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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