Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bf4bcaf
evaluation code and scripts
koksal Sep 17, 2016
3ff64f3
parse funchisq wrapper output
koksal Jan 10, 2017
2ca0d6b
map FunChisq nodes and collapse by taking min-p-value edge
koksal Jan 10, 2017
4df8a3a
fix
koksal Jan 10, 2017
1775613
print FunChisq networks as SIF and main harness
koksal Jan 10, 2017
afb4eb5
script to run funchisq conversion
koksal Jan 10, 2017
4634074
add peptide to protein mapping
koksal Jan 10, 2017
f81abcf
fix to funchisq graph representation
koksal Jan 11, 2017
6fe9b77
fix
koksal Jan 11, 2017
ec59872
generete prev scores using fold change threshold
koksal Jan 12, 2017
f006f92
add remaining score generation
koksal Jan 12, 2017
6110774
use absolute log 2 fold changes
koksal Jan 15, 2017
1bd5fde
save both score and PCSF prize files
koksal Jan 15, 2017
29abc1d
renaming
koksal Jan 15, 2017
fd04a49
comparison of undirected networks
koksal Jan 24, 2017
891f362
print edge and node names in difference
koksal Jan 24, 2017
182bd07
aggregate network analysis
koksal Jan 25, 2017
da45b01
add ratio statistics
koksal Jan 25, 2017
f4be82e
one-to-many directed network comparison
koksal Jan 26, 2017
314cc20
add prior knowledge to one-to-many analysis
koksal Jan 27, 2017
9969a85
permutation stub
koksal Jan 28, 2017
5bbc454
time series and scores permutation
koksal Feb 9, 2017
c06f3ce
test permutations
koksal Feb 9, 2017
eeb174a
z3 unit test shouldn't check version number
koksal Feb 9, 2017
81ca697
script to generate time series permutations
koksal Feb 9, 2017
0fca99d
fix what's printed
koksal Feb 9, 2017
03f0732
refactor analysis code and add signed comparison
koksal Feb 13, 2017
06b5199
fix scalaz3 jar
koksal Feb 13, 2017
ee85009
replace inf and nan fold change values with max fold change
koksal Feb 15, 2017
ca6a2c1
reference parsing checks and overlap analysis info logging
koksal Feb 22, 2017
bd45ec3
minor
koksal Feb 26, 2017
ddb2268
better error message in reference parsing
koksal Feb 26, 2017
ec5f2be
per-time-point reference data overlap analysis with ratios
koksal Sep 2, 2017
1607f30
bump up scala version and introduce percentile evaluation
koksal Feb 24, 2018
627b543
update included scalaz3 jar to scala 2.12
koksal Feb 24, 2018
76915a5
count the number of runs with more edges than the original run
koksal Feb 24, 2018
574bb9b
extended the percentile range for network overlap analysis
koksal Mar 2, 2018
4e96f89
minor naming fix
koksal Mar 2, 2018
18fc55c
properly print one-to-many network comparison tables
koksal Apr 8, 2018
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
6 changes: 3 additions & 3 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object ApplicationBuild extends Build {
baseDirectory in run := file("."),
baseDirectory in Test := file("."),

scalaVersion := "2.11.7",
scalaVersion := "2.12.4",
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature"),

showSuccess := false,
Expand All @@ -24,8 +24,8 @@ object ApplicationBuild extends Build {
unmanagedBase <<= baseDirectory { base => base / "lib" },

libraryDependencies ++= Seq(
"org.scalatest" % "scalatest_2.11" % "2.2.4" % "test",
"com.github.scopt" %% "scopt" % "3.3.0"
"org.scalatest" % "scalatest_2.12" % "3.0.1" % "test",
"com.github.scopt" %% "scopt" % "3.7.0"
),

mainClass in (Compile, run) := Some("tps.Main"),
Expand Down
8 changes: 8 additions & 0 deletions scripts/compare-undirected-networks
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

NETWORK_1=$1
NETWORK_2=$2

sbt \
"project tps-core" \
"run-main tps.evaluation.UndirectedNetworkComparison $NETWORK_1 $NETWORK_2"
9 changes: 9 additions & 0 deletions scripts/generate-scores-and-prizes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

TIME_SERIES_FILE=$1
MAPPING_FILE=$2
FOLD_CHANGE_THRESHOLD=$3

sbt \
"project tps-core" \
"run-main tps.evaluation.SignificanceScoreAndPrizeProducer $TIME_SERIES_FILE $MAPPING_FILE $FOLD_CHANGE_THRESHOLD"
13 changes: 13 additions & 0 deletions scripts/permute-time-series-and-scores
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

TIMESERIES=data/timeseries/median-time-series.tsv
FIRSTSCORES=data/timeseries/p-values-first.tsv
PREVSCORES=data/timeseries/p-values-prev.tsv

for i in `seq 1 100`;
do
OUTFOLDER="permutation-$i"
sbt \
"project tps-core" \
"run-main tps.evaluation.TimeSeriesPermutation $TIMESERIES $FIRSTSCORES $PREVSCORES $i $OUTFOLDER"
done
10 changes: 10 additions & 0 deletions scripts/run-funchisq-to-sif
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

NETWORK_FILE=$1
MAPPING_FILE=$2
P_VAL_THRESHOLD=$3
MAX_NB_EDGES=$4

sbt \
"project tps-core" \
"run-main tps.evaluation.funchisq.FunChisq2SIFConverter $NETWORK_FILE $MAPPING_FILE $P_VAL_THRESHOLD $MAX_NB_EDGES"
9 changes: 9 additions & 0 deletions scripts/run-network-analysis
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

for reference in data/resources/reference/*.tsv
do
echo "Evaluating against $reference"
sbt \
"project tps-core" \
"run-main tps.evaluation.NetworkReferenceComparison $reference $*"
done
5 changes: 5 additions & 0 deletions scripts/run-one-to-many-network-comparison
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

sbt \
"project tps-core" \
"run-main tps.evaluation.DirectedNetworkComparison $*"
13 changes: 13 additions & 0 deletions scripts/run-overlap-analysis
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

timeseries=data/timeseries/median-time-series.tsv
firstscores=data/timeseries/p-values-first.tsv
prevscores=data/timeseries/p-values-prev.tsv
mapping=data/timeseries/peptide-mapping.tsv

for reference in data/resources/reference/*.tsv
do
sbt \
"project tps-core" \
"run-main tps.evaluation.OverlapAnalysis $reference $timeseries $mapping $firstscores $prevscores"
done
15 changes: 15 additions & 0 deletions scripts/run-permuted-time-series
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

for i in `seq 1 100`;
do
./scripts/run \
--network data/networks/input-network.tsv \
--timeseries data/timeseries/permuted-time-series/permutation-$i/permuted-time-series.tsv \
--firstscores data/timeseries/permuted-time-series/permutation-$i/permuted-first-scores.tsv \
--prevscores data/timeseries/permuted-time-series/permutation-$i/permuted-prev-scores.tsv \
--partialmodel data/resources/kinase-substrate-interactions.sif \
--peptidemap data/timeseries/peptide-mapping.tsv \
--source EGF_HUMAN \
--threshold 0.01 \
--outfolder permuted-time-series-run-$i
done
68 changes: 68 additions & 0 deletions scripts/run-txn
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

NETWORKFOLDER=data/networks/evaluation
KINSUB=data/resources/kinase-substrate-interactions.sif

TXN_ALL_UNDIRECTED=$NETWORKFOLDER/TXN-ALL-undirected.tsv
TXN_ALL_DIRECTED=$NETWORKFOLDER/TXN-ALL-directed.sif
TXN_1F_UNDIRECTED=$NETWORKFOLDER/TXN-1F-undirected.tsv
TXN_1F_DIRECTED=$NETWORKFOLDER/TXN-1F-directed.sif

function run_with_base_args() {
./scripts/run \
--timeseries data/timeseries/median-time-series.tsv \
--firstscores data/timeseries/p-values-first.tsv \
--prevscores data/timeseries/p-values-prev.tsv \
--peptidemap data/timeseries/peptide-mapping.tsv \
--source EGFR_HUMAN \
--threshold 0.01 \
"$@"
}

run_with_base_args \
--outlabel TXN-ALL-directed-topo-kinsub \
--network $TXN_ALL_UNDIRECTED \
--partialmodel $KINSUB \
--partialmodel $TXN_ALL_DIRECTED \
--no-temporality

run_with_base_args \
--outlabel TXN-ALL-directed-topo-kinsub-temp \
--network $TXN_ALL_UNDIRECTED \
--partialmodel $KINSUB \
--partialmodel $TXN_ALL_DIRECTED

run_with_base_args \
--outlabel TXN-1F-directed-topo-kinsub \
--network $TXN_1F_UNDIRECTED \
--partialmodel $KINSUB \
--partialmodel $TXN_ALL_DIRECTED \
--no-temporality

run_with_base_args \
--outlabel TXN-1F-directed-topo-kinsub-temp \
--network $TXN_1F_UNDIRECTED \
--partialmodel $KINSUB \
--partialmodel $TXN_ALL_DIRECTED

run_with_base_args \
--outlabel TXN-ALL-undirected-topo-kinsub \
--network $TXN_ALL_UNDIRECTED \
--partialmodel $KINSUB \
--no-temporality

run_with_base_args \
--outlabel TXN-ALL-undirected-topo-kinsub-temp \
--network $TXN_ALL_UNDIRECTED \
--partialmodel $KINSUB

run_with_base_args \
--outlabel TXN-1F-undirected-topo-kinsub \
--network $TXN_1F_UNDIRECTED \
--partialmodel $KINSUB \
--no-temporality

run_with_base_args \
--outlabel TXN-1F-undirected-topo-kinsub-temp \
--network $TXN_1F_UNDIRECTED \
--partialmodel $KINSUB
6 changes: 6 additions & 0 deletions scripts/run-txn-graph-creation
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

TXNFILE="data/networks/comparison/TXN-ALL.edges"
sbt \
"project tps-core" \
"run-main tps.evaluation.txn.GraphCreation $TXNFILE 1.0"
Binary file modified tps-core/lib/scalaz3.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions tps-core/src/main/scala/tps/Graphs.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package tps

import tps.util.LogUtils._

object Graphs {

case class Vertex(id: String) extends Serializable {
Expand Down
2 changes: 0 additions & 2 deletions tps-core/src/main/scala/tps/PeptideProteinMappingParser.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package tps

import tps.util.FileUtils._

object PeptideProteinMappingParser {
def run(f: java.io.File): Map[String, Set[String]] = {
val data = new TSVSource(f).data
Expand Down
6 changes: 4 additions & 2 deletions tps-core/src/main/scala/tps/ReferenceParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ object ReferenceParser {
def run(f: java.io.File): (SignedDirectedGraph, Map[Edge, String]) = {
val data = new TSVSource(f, noHeaders = false).data


var evidencePerEdge: Map[Edge, String] = Map.empty

val tuples = data.tuples.collect{ case tuple if tuple.size >= 7 =>
val tuples = data.tuples.map{ tuple =>
assert(tuple.size >= 6)

val Seq(src, tgt, lra, lri, rla, rli, rest @ _*) = tuple
val edge = lexicographicEdge(src, tgt)

Expand All @@ -21,6 +22,7 @@ object ReferenceParser {
def labelValue(l: String): Boolean = l match {
case "true" => true
case "false" => false
case _ => sys.error(s"error parsing $l in $tuple")
}

if (labelValue(lra)) originalLabels += ActiveEdge(Forward, Activating)
Expand Down
54 changes: 54 additions & 0 deletions tps-core/src/main/scala/tps/SignedDirectedGraphOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,64 @@ object SignedDirectedGraphOps {
relevant.size
}

def activeDirections(
labels: Set[SignedDirectedEdgeLabel]
): Set[EdgeDirection] = {
labels collect {
case ActiveEdge(dir, sign) => dir
}
}

def activeEdges(labels: Set[SignedDirectedEdgeLabel]): Set[ActiveEdge] = {
labels collect {
case ae: ActiveEdge => ae
}
}

def sameUniqueDirection(
ls1: Set[SignedDirectedEdgeLabel], ls2: Set[SignedDirectedEdgeLabel]
): Boolean = {
val activeDir1 = activeDirections(ls1)
val activeDir2 = activeDirections(ls2)

activeDir1.size == 1 && activeDir2.size == 1 && activeDir1 == activeDir2
}

def sameUniqueActiveEdge(
ls1: Set[SignedDirectedEdgeLabel], ls2: Set[SignedDirectedEdgeLabel]
): Boolean = {
val activeE1 = activeEdges(ls1)
val activeE2 = activeEdges(ls2)

activeE1.size == 1 && activeE2.size == 1 && activeE1 == activeE2
}

def confictingUniqueActiveEdge(
ls1: Set[SignedDirectedEdgeLabel], ls2: Set[SignedDirectedEdgeLabel]
): Boolean = {
val activeE1 = activeEdges(ls1)
val activeE2 = activeEdges(ls2)

activeE1.size == 1 && activeE2.size == 1 && activeE1 != activeE2
}

def conflictingUniqueActiveDirection(
ls1: Set[SignedDirectedEdgeLabel], ls2: Set[SignedDirectedEdgeLabel]
): Boolean = {
val activeDir1 = activeDirections(ls1)
val activeDir2 = activeDirections(ls2)

activeDir1.size == 1 && activeDir2.size == 1 && activeDir1 != activeDir2
}

def oneActiveDirection(es: Set[SignedDirectedEdgeLabel]): Boolean = {
onlyForward(es) || onlyBackward(es)
}

def oneActiveEdge(es: Set[SignedDirectedEdgeLabel]): Boolean = {
activeEdges(es).size == 1
}

def onlyBackward(es: Set[SignedDirectedEdgeLabel]): Boolean = {
canBeBackward(es) && !canBeForward(es)
}
Expand Down
4 changes: 0 additions & 4 deletions tps-core/src/main/scala/tps/TimeSeries.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package tps

import Graphs._

import tps.util.StringUtils

case class Profile(id: String, values: Seq[Option[Double]])

case class TimeSeries(
Expand Down
Loading