Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gnv
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ariane Mora
gnv
Commits
4351ecca
Commit
4351ecca
authored
Dec 21, 2017
by
Ariane Mora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to have the flower type vis
parent
af41dc59
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
414 additions
and
565 deletions
+414
-565
ajaxCalls.js
gnvweb/eneg/src/main/resources/public/js/vis/ajaxCalls.js
+8
-4
dataProcessing.js
...b/eneg/src/main/resources/public/js/vis/dataProcessing.js
+136
-0
network.js
gnvweb/eneg/src/main/resources/public/js/vis/network.js
+266
-559
form.html
gnvweb/eneg/src/main/resources/templates/fragments/form.html
+3
-1
results.html
.../eneg/src/main/resources/templates/fragments/results.html
+1
-1
No files found.
gnvweb/eneg/src/main/resources/public/js/vis/ajaxCalls.js
View file @
4351ecca
...
...
@@ -14,7 +14,7 @@ function getNetworksFromBedFile() {
data
:
{
request
:
"status"
},
success
:
function
(
data
)
{
run_networks_in_bed
(
JSON
.
parse
(
data
));
data
[
'threeD_attr'
]
=
set_up_3D_attr
();
//
data['threeD_attr'] = set_up_3D_attr();
},
error
:
function
(
e
)
{
console
.
log
(
"ERROR: "
,
e
);
...
...
@@ -42,11 +42,15 @@ function getNetworkByChromAndPosition(chrom, start, end) {
data
:
data
,
success
:
function
(
data
)
{
// Run the two D version
dna_attr
.
data
=
JSON
.
parse
(
data
)[
0
];
run_dna_visualisation
();
dna_attr
.
data
=
JSON
.
parse
(
data
);
// Set up the facts for the data so we can easily filter
// in dataProcessing we create a crossfilter instance.
process_networks
();
// Always run the vis with the default network
run_dna_visualisation
(
0
);
// Run the 3D version
// Clear the inner HTML first
threeD_attr
=
set_up_3D_attr
();
//
threeD_attr = set_up_3D_attr();
},
error
:
function
(
e
)
{
...
...
gnvweb/eneg/src/main/resources/public/js/vis/dataProcessing.js
View file @
4351ecca
...
...
@@ -198,3 +198,139 @@ var filter_on_gene = function(gene) {
/**
* ====================================================================================================================
* Create a new crossfilter instance for each network range
* ====================================================================================================================
*/
var
set_up_network_data
=
function
(
data
)
{
// Set up the crossfilter facts. --> use a JSON object i.e. data
// that contains elements (array) these get translated to facts.
// Data contains the following:
// 1.start 2.end 3. Array of networks that have that start and end.
var
network_facts
=
crossfilter
(
data
);
// Store globally
processed_data
[
"network_facts"
]
=
network_facts
;
}
// Need to remove the facts when we get a new network
var
remove_network_data
=
function
()
{
if
(
processed_data
.
network_facts
!=
[])
{
processed_data
.
network_facts
.
remove
();
}
}
/**
* ============================================================================
* Create interaction dimensions
* ============================================================================
*/
/**
* Make a dimension on the network ID to make it quick to filter on that ID.
*/
var
create_network_dimension
=
function
()
{
// Create a dimesnsion on the chromosone of the gene or network
var
network_dimension
=
processed_data
.
network_facts
.
dimension
(
function
(
d
)
{
return
d
.
network_id
;
});
// Store Globally
processed_data
[
"network_dimension"
]
=
network_dimension
;
};
/**
* Make a dimension tpo easily filter between edges and interactions
*/
var
create_network_type_dimension
=
function
()
{
// Create a dimesnsion on the chromosone of the gene or network
var
network_type_dimension
=
processed_data
.
network_facts
.
dimension
(
function
(
d
)
{
return
d
.
type
;
});
// Store Globally
processed_data
[
"network_type_dimension"
]
=
network_type_dimension
;
};
/**
* Make a dimension on the start to make it easy to filter.
*/
var
create_interaction_start_dimension
=
function
()
{
// Create a dimesnsion on the chromosone of the gene or network
var
interaction_start_dimension
=
processed_data
.
network_facts
.
dimension
(
function
(
d
)
{
return
d
.
start
;
});
// Store Globally
processed_data
[
"interaction_start_dimension"
]
=
interaction_start_dimension
;
};
/**
* Make a dimension on the start to make it easy to filter.
*/
var
create_interaction_end_dimension
=
function
()
{
// Create a dimesnsion on the chromosone of the gene or network
var
interaction_end_dimension
=
processed_data
.
network_facts
.
dimension
(
function
(
d
)
{
return
d
.
end
;
});
// Store Globally
processed_data
[
"interaction_end_dimension"
]
=
interaction_end_dimension
;
}
/**
* ===================================================================================================================
* Want filters: 1. Networks (need to check if in array)
* ===================================================================================================================
*/
var
remove_network_filters
=
function
()
{
processed_data
.
network_dimension
.
filterAll
();
processed_data
.
network_type_dimension
.
filterAll
();
processed_data
.
interaction_start_dimension
.
filterAll
();
processed_data
.
interaction_end_dimension
.
filterAll
();
}
var
filter_on_network
=
function
(
network_id
)
{
processed_data
.
network_dimension
.
filterAll
();
// want the interactions with that network
processed_data
.
network_dimension
.
filterExact
(
network_id
);
return
processed_data
.
network_type_dimension
.
top
(
Infinity
);
}
// Either returns all interactions or all egdes
var
filter_on_network_type
=
function
(
type
)
{
processed_data
.
network_type_dimension
.
filterAll
();
// Only want interactions not edges
type_filter
=
processed_data
.
network_type_dimension
.
filterExact
(
type
);
return
processed_data
.
network_dimension
.
top
(
Infinity
);
}
var
filter_interactions_on_position
=
function
(
start
,
end
)
{
// Clear the associated filters.
processed_data
.
interaction_start_dimension
.
filterAll
();
processed_data
.
interaction_end_dimension
.
filterAll
();
// Filters the data based on the start and end positions
// filterRange([>=min, <max]); Can also do on strings
processed_data
.
interaction_start_dimension
.
filterRange
([
start
,
end
]);
processed_data
.
interaction_end_dimension
.
filterRange
([
start
,
end
]);
// Now the underlying data has changed (will need to redraw)
return
get_filter
(
processed_data
.
network_facts
);
}
\ No newline at end of file
gnvweb/eneg/src/main/resources/public/js/vis/network.js
View file @
4351ecca
This diff is collapsed.
Click to expand it.
gnvweb/eneg/src/main/resources/templates/fragments/form.html
View file @
4351ecca
...
...
@@ -34,7 +34,9 @@
</div>
</div>
<div
class=
"form-group row col-sm-offset-1 col-sm-8 pad-top-bottom"
style=
"padding-top:30px;"
><button
type=
"submit"
name=
"submitGnv"
class=
"btn btn-default col-xs-12"
style=
"background-color: #C8D3BB;"
id=
"submit-btn"
onclick=
"javascript:displayLoad();"
>
Perform reconstruction
</button></div>
</form>
<div
class=
"form-group row col-sm-offset-1 col-sm-8 pad-top-bottom"
style=
"padding-top:30px;"
>
</div>
</form>
</div>
</div>
</div>
...
...
gnvweb/eneg/src/main/resources/templates/fragments/results.html
View file @
4351ecca
...
...
@@ -41,7 +41,7 @@
<div
id=
"genomevis-div"
>
<button
id=
"diff-dna-view"
onclick=
"diff_dna_view();"
>
change stand view
</button>
<!-- Contains the D3 strand vis. -->
<svg
id=
"strandvis"
width=
"1200"
height=
"
4
00"
></svg>
<svg
id=
"strandvis"
width=
"1200"
height=
"
8
00"
></svg>
</div>
<div
id=
"interactionvis-div"
>
<svg
id=
"interactionvis"
width=
"200"
height=
"300"
></svg>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment