Platform
Resources
Pricing
Sign in
Get started
Cora Davis's Workspace
Workspace
Fork
Public
By
Cora Davis
Edited
Mar 14, 2024
4
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
db
SELECT size AS ClusterSize, COUNT(subcluster) AS NumberOfSubclusters
FROM clusters
INNER JOIN phages
ON phages.cluster = clusters.name
WHERE subcluster NOT NULL
GROUP BY size
LIMIT ${range};
Insert cell
dotplot
Insert cell
viewof
range
=
Inputs
.
range
(
[
0
,
100
]
,
{
label
:
"Amount"
,
step
:
1
,
value
:
25
}
)
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
dot
(
dotplot
,
{
x
:
"ClusterSize"
,
y
:
"NumberOfSubclusters"
}
)
]
}
)
Insert cell
db
SELECT phageID, COUNT(phageID) AS GeneCount
FROM genes
GROUP BY phageID
ORDER BY GeneCount desc
LIMIT ${range1};
Insert cell
barchart
Insert cell
viewof
range1
=
Inputs
.
range
(
[
0
,
100
]
,
{
label
:
"Amount"
,
step
:
1
,
value
:
50
}
)
Insert cell
Plot
.
plot
(
{
marginLeft
:
100
,
width
:
1000
,
marks
:
[
Plot
.
barX
(
barchart
,
{
x
:
"GeneCount"
,
y
:
"phageID"
,
sort
:
{
y
:
"x"
,
reverse
:
true
}
}
)
,
Plot
.
ruleX
(
[
0
]
)
]
}
)
Insert cell
db
SELECT COUNT(genefunction) AS GeneFunctionCOUNT , genefunction, phamName
FROM genes
WHERE phamName = ${select1}
GROUP BY genefunction, phamName
HAVING genefunctionCOUNT NOT NULL AND genefunctionCOUNT > 1;
Insert cell
import
{
PieChart
}
from
"@d3/pie-chart-component"
Insert cell
db
Select phamname, COUNT(genefunction) AS GeneFunctionCOUNT
FROM genes
WHERE genefunction NOT NULL
GROUP BY phamname
HAVING genefunctionCOUNT > 1
LIMIT 50;
Insert cell
phamNames
=
phamName
.
map
(
d
=>
d
.
phamName
)
Insert cell
viewof
select1
=
Inputs
.
select
(
phamNames
,
{
label
:
"Phamilies"
}
)
Insert cell
chart
=
PieChart
(
piechart
,
{
name
:
d
=>
d
.
genefunction
,
value
:
d
=>
d
.
GeneFunctionCOUNT
,
width
,
height
:
500
,
}
)
Insert cell
db
SELECT size AS PhamilySize
FROM phamilies
GROUP BY size
LIMIT ${counter};
Insert cell
viewof
counter
=
Inputs
.
button
(
[
[
"Increment"
,
value
=>
value
+
100
]
,
[
"Decrement"
,
value
=>
value
-
100
]
,
[
"Reset"
,
value
=>
400
]
]
,
{
value
:
400
,
label
:
"Counter"
}
)
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
rectY
(
histogram
,
Plot
.
binX
(
{
y
:
"count"
}
,
{
x
:
"PhamilySize"
}
)
)
,
Plot
.
ruleY
(
[
0
]
)
]
}
)
Insert cell
db
SELECT AVG(ABS(gap)) AS AvgGapSize, cluster
FROM genes
INNER JOIN phages
ON phagename = phageID
WHERE cluster NOT NULL
GROUP BY gap, cluster
HAVING AvgGapSize > 0
LIMIT ${radios};
Insert cell
tickchart
Insert cell
viewof
radios
=
Inputs
.
radio
(
[
1000
,
2500
,
5000
,
7500
,
10000
,
25000
,
50000
,
75000
,
100000
]
,
{
label
:
"Number Of Ticks"
}
)
Insert cell
Plot
.
plot
(
{
marks
:
[
Plot
.
tickX
(
tickchart
,
{
x
:
"AvgGapSize"
,
y
:
"cluster"
}
)
]
}
)
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
db
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
dotplot
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
phamilies.parquet
Parquet
phages-2.parquet
Parquet
genes.parquet
Parquet
clusters.parquet
Parquet
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
range
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
barchart
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
phamilies.parquet
Parquet
phages-2.parquet
Parquet
genes.parquet
Parquet
clusters.parquet
Parquet
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
range1
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
piechart
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
phamilies.parquet
Parquet
phages-2.parquet
Parquet
genes.parquet
Parquet
clusters.parquet
Parquet
Databases
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
phamName
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
phamilies.parquet
Parquet
phages-2.parquet
Parquet
genes.parquet
Parquet
clusters.parquet
Parquet
Databases
phamNames
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
select1
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
chart
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
histogram
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
phamilies.parquet
Parquet
phages-2.parquet
Parquet
genes.parquet
Parquet
clusters.parquet
Parquet
Databases
counter
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
tickchart
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
phamilies.parquet
Parquet
phages-2.parquet
Parquet
genes.parquet
Parquet
clusters.parquet
Parquet
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
radios
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML