Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
e9f114ca
Commit
e9f114ca
authored
13 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
LMS-2784 Sort the list of plasmids
SVN: 24382
parent
accb0a35
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plasmid/source/html/yeastlabbrowser/plasmid-browser.html
+48
-4
48 additions, 4 deletions
plasmid/source/html/yeastlabbrowser/plasmid-browser.html
with
48 additions
and
4 deletions
plasmid/source/html/yeastlabbrowser/plasmid-browser.html
+
48
−
4
View file @
e9f114ca
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>
YeastLab
Browser
</title>
<title>
Plasmid
Browser
</title>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"body-style.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"button.css"
/>
<script
type=
"text/javascript"
src=
"d3.js"
></script>
...
...
@@ -10,12 +10,20 @@
<script
type=
"text/javascript"
src=
"jquery.js"
></script>
<script
type=
"text/javascript"
src=
"openbis.js"
></script>
<!-- To speed development, cache the requests -->
<!--
<script type="text/javascript" src="openbis-request-cache.js"></script>
-->
<script
type=
"text/javascript"
src=
"openbis-request-cache.js"
></script>
<script>
/// The openbisServer we use for our data
openbisServer
=
new
openbis
(
'
https://openbis-csb.ethz.ch/openbis/openbis
'
,
'
https://openbis-csb.ethz.ch:443/datastore_server
'
);
// Some global variables we refer to
/// All plasmids
var
plasmids
=
null
;
/// The plasmids that are currently being inspected
var
inspectedPlasmids
=
[];
function
getAppHeight
(){
return
Math
.
max
(
$
(
window
).
height
()
-
50
,
getVisibleLeafsCountForNode
(
root
)
*
30
);
}
...
...
@@ -84,6 +92,37 @@ function props_to_pairs(d)
return
pairs
;
}
/** Initialize the plasmids variable */
function
initializePlasmids
(
result
)
{
// Split the plasmids into two groups, the ones that start with FRP in their sample name and the other ones.
var
frpPlasmids
=
[],
otherPlasmids
=
[];
var
frpRegex
=
/^FRP
[
0-9
]
+/
;
frpRegex
.
compile
(
frpRegex
);
result
.
forEach
(
function
(
sample
)
{
if
(
frpRegex
.
test
(
sample
.
code
))
{
frpPlasmids
.
push
(
sample
);
}
else
{
otherPlasmids
.
push
(
sample
);
}
});
// Sort each of the groups
otherPlasmids
.
sort
(
function
(
a
,
b
)
{
return
(
a
.
code
<
b
.
code
)
?
-
1
:
1
;
});
frpPlasmids
.
sort
(
function
(
a
,
b
)
{
// Sort based on the FRP number
var
frpNumberA
=
parseInt
(
a
.
code
.
substring
(
3
));
var
frpNumberB
=
parseInt
(
b
.
code
.
substring
(
3
));
return
(
frpNumberA
<
frpNumberB
)
?
-
1
:
1
;
});
// Combine the two groups back together to produce the full collection of plasmids
plasmids
=
frpPlasmids
.
concat
(
otherPlasmids
);
}
function
inspectPlasmid
(
data
)
{
console
.
log
(
data
);
...
...
@@ -100,12 +139,17 @@ function displayReturnedSamples(data)
return
;
}
initializePlasmids
(
data
.
result
);
// This will show the object in the log -- helpful for debugging
// console.log(data.result);
var
samplesToShow
=
data
.
result
if
(
plasmids
.
length
<
1
)
{
vis
.
append
(
"
p
"
).
text
(
"
No data found.
"
);
return
;
}
// Pick the table element of the visualization
d3
.
select
(
"
#vis
"
).
select
(
"
#plasmid-table
"
).
selectAll
(
"
tr.plasmid-table-data
"
).
data
(
samplesToShow
)
d3
.
select
(
"
#vis
"
).
select
(
"
#plasmid-table
"
).
selectAll
(
"
tr.plasmid-table-data
"
).
data
(
plasmids
)
// Code under enter is run if there is no HTML element for a data element
.
enter
()
.
append
(
"
tr
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment