Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inverse sample/metabolite in the input isocor file. #35

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ case class MassLynxOutput2IsocorInput(
(field: CompoundField) => {
(compoundType match {
case "M+H" => Some(List(
sample,
field.Name,
sample,
correspondenceMetabolitesDerivative.getOrElse(field.Name,defaultDerivative),
0,
field.Area,
resolution.toString
).mkString("\t"))
case v if v.startsWith("M+") => Some(List(
sample,
field.Name,
sample,
correspondenceMetabolitesDerivative.getOrElse(field.Name,defaultDerivative),
v.replace("M+", "").toInt,
field.Area,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ object MassLynxOutput2IsocorInputTest extends TestSuite {
header=OutputMassLynx.Header(),
results=MassLynxParser.parseResults(toParse.split("\n").toList)
)
assert( MassLynxOutput2IsocorInput(Map()).transform(entry) == List("M+H\tGlyN15_A_3\tACCQTAG\t0\t96688\t2000"))
assert( MassLynxOutput2IsocorInput(Map()).transform(entry) == List("GlyN15_A_3\tM+H\tACCQTAG\t0\t96688\t2000"))
}

test("basic run with a sample M+H, resolution=1000") {
Expand All @@ -90,7 +90,7 @@ object MassLynxOutput2IsocorInputTest extends TestSuite {
results=MassLynxParser.parseResults(toParse.split("\n").toList)
)
assert( MassLynxOutput2IsocorInput(Map(),resolution=1000).transform(entry) ==
List("M+H\tGlyN15_A_3\tACCQTAG\t0\t96688\t1000"))
List("GlyN15_A_3\tM+H\tACCQTAG\t0\t96688\t1000"))
}
test("basic run with a sample M+H, resolution=1000, defaultDerivative='TOTO'") {
val toParse =
Expand All @@ -106,7 +106,7 @@ object MassLynxOutput2IsocorInputTest extends TestSuite {
)

assert( MassLynxOutput2IsocorInput(Map(),resolution=1000, defaultDerivative="TOTO").transform(entry) ==
List("M+H\tGlyN15_A_3\tTOTO\t0\t96688\t1000"))
List("GlyN15_A_3\tM+H\tTOTO\t0\t96688\t1000"))
}

test("basic run with a sample M+H, resolution=1000, map( GlyN15_A_3 => 'TOTO')") {
Expand All @@ -123,7 +123,7 @@ object MassLynxOutput2IsocorInputTest extends TestSuite {
)

assert( MassLynxOutput2IsocorInput(Map("GlyN15_A_3" -> "TOTO"),resolution=1000).transform(entry) ==
List("M+H\tGlyN15_A_3\tTOTO\t0\t96688\t1000"))
List("GlyN15_A_3\tM+H\tTOTO\t0\t96688\t1000"))
}
}
}