Skip to content

Commit

Permalink
allow loose match to match gene
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandunn committed Feb 9, 2021
1 parent e8a4f76 commit 18fe719
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions grails-app/services/org/bbop/apollo/TrackService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -582,23 +582,21 @@ class TrackService {

List<String> typeList = new ArrayList<>()
types.each { typeList.add(it) }
boolean isGene = false
// loosely match gene
if(typeList.size()==1 && typeList.get(0)==FeatureStringEnum.GENE.value.toLowerCase()) {
isGene = true
}
JSONArray rootArray = new JSONArray()
// here we just clone it
for (def obj in jsonArray) {
if (obj instanceof JSONObject) {
if (typeList.contains(obj.type)) {
if (typeList.contains(obj.type) || (isGene && obj.type.indexOf("_gene")>0)) {
for (JSONObject child in getGeneChildren(obj, typeList)) {
rootArray.add(child)
}
// rootArray.add(obj)
}
}
// else if (obj instanceof JSONArray) {
// rootArray.addAll(flattenArray(obj,types))
//// for (JSONObject child in obj) {
//// rootArray.add(child)
//// }
// }
}

return rootArray
Expand Down

0 comments on commit 18fe719

Please sign in to comment.