Skip to content

Commit

Permalink
Better antismash file
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuBarba committed Apr 29, 2024
1 parent a8c8a23 commit 623f2ff
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions js/ranking.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,31 @@ function to_antismash(data) {
"version": synteruptor_version,
"description": "Synteny breaks explorer",
};
records = [];
records = {};
for (var br of data) {
subregions = {
"label": "break_" + br["breakid"],
reg_name = br["gpart1"];
subregion = {
"label": "break_" + br["break_sum"].substring(0, 6),
"start": br["loc_start1"],
"end": br["loc_end1"],
};
if (!records[reg_name]) {
records[reg_name] = []
}
records[reg_name].push(subregion);
}

data_records = []
for (reg_name in records) {
record = {
"name": br["gpart1"],
"subregions": subregions,
}
records.push(record);
"name": reg_name,
"subregions": records[reg_name],
};
data_records.push(record);
}
json_data = {
"tool": tool,
"records": records,
"records": data_records,
}
return JSON.stringify(json_data, null, 4);
}
Expand Down

0 comments on commit 623f2ff

Please sign in to comment.