Skip to content

Commit

Permalink
Version UPD, fix bug with broken domains/piis
Browse files Browse the repository at this point in the history
  • Loading branch information
mikessh committed Feb 8, 2016
1 parent d9c5841 commit db66e44
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>es.unav</groupId>
<artifactId>oncofuse</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<packaging>jar</packaging>

<name>oncofuse</name>
Expand Down
41 changes: 31 additions & 10 deletions src/main/groovy/es/unav/oncofuse/legacy/Oncofuse.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,18 @@ def fpg2DomainFeaturesMap = Collections.synchronizedMap(new HashMap<FpgPart, Dom
println "[${new Date()}] =Stage #1: raw data"

println "[${new Date()}] ==Domain & PII related"

def getRegionState = { FpgPart fpgPart, region ->
if (fpgPart.fivePrimeFpg ?
(region.aaTo <= fpgPart.aaPos) : (region.aaFrom >= fpgPart.aaPos))
return 1
else if (fpgPart.fivePrimeFpg ?
(region.aaFrom >= fpgPart.aaPos) : (region.aaTo <= fpgPart.aaPos))
return -1
else
return 0
}

GParsPool.withPool THREADS, {
fpgSet.eachParallel { FpgPart fpgPart ->
def domainFeatures = new DomainFeatures()
Expand All @@ -631,19 +643,28 @@ GParsPool.withPool THREADS, {
domainFeatures.domainProfileBroken = new double[nThemes]
def domains = domainData[fpgPart.geneName]
domains.each {
if ((it.aaTo <= fpgPart.aaPos) == fpgPart.fivePrimeFpg)
domainFeatures.domainsRetained.add(it.featureId)
else if ((it.aaFrom >= fpgPart.aaPos) == fpgPart.fivePrimeFpg)
domainFeatures.domainsLost.add(it.featureId)
else
domainFeatures.domainsBroken.add(it.featureId)
switch(getRegionState(fpgPart, it)) {
case 1:
domainFeatures.domainsRetained.add(it.featureId)
break
case -1:
domainFeatures.domainsLost.add(it.featureId)
break
default:
domainFeatures.domainsBroken.add(it.featureId)
break
}
}
def piis = piiData[fpgPart.geneName]
piis.each {
if ((it.aaTo <= fpgPart.aaPos) == fpgPart.fivePrimeFpg)
domainFeatures.piisRetained.add(it.featureId)
else if ((it.aaFrom >= fpgPart.aaPos) == fpgPart.fivePrimeFpg)
domainFeatures.piisLost.add(it.featureId)
switch(getRegionState(fpgPart, it)) {
case 1:
domainFeatures.piisRetained.add(it.featureId)
break
case -1:
domainFeatures.piisLost.add(it.featureId)
break
}
}
fpg2DomainFeaturesMap.put(fpgPart, domainFeatures)
}
Expand Down

0 comments on commit db66e44

Please sign in to comment.