This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}, | |
"vconcat": [ | |
{ | |
"hconcat": [ | |
{ | |
"mark": {"type": "line", "point": true}, | |
"encoding": { | |
"color": { | |
"condition": {"value": "purple", "selection": "selector055"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}, | |
"vconcat": [ | |
{ | |
"hconcat": [ | |
{ | |
"mark": "point", | |
"encoding": { | |
"color": { | |
"condition": {"value": "purple", "selection": "selector079"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import datetime | |
def get_covid_data_jhu(dt_ini, dt_fim, us_columns = True, country = None): | |
date_range = pd.date_range(start = dt_ini, end = dt_fim).to_list() | |
string_range = [str(d.date().strftime("%m-%d-%Y")) for d in date_range] | |
full_data_list = [] | |
for dat in string_range: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_summary <- function(geneids){ | |
summary_list <- entrez_summary("gene", id = geneids, ) %>% | |
extract_from_esummary(elements = c("uid", "summary"), simplify = TRUE) %>% | |
as_tibble() %>% | |
unnest() | |
gene_names <- summary_list %>% | |
slice(1) %>% | |
as.character() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bokeh.io import show | |
from bokeh.models import Range1d, Plot, Circle, HoverTool, MultiLine | |
from bokeh.models.graphs import NodesAndLinkedEdges | |
from bokeh.plotting import from_networkx | |
import networkx as nx | |
def plot_network(network, tooltip, layout=nx.kamada_kawai_layout): | |
"""Makes a nice network plot with Bokeh | |
Mostly stuff I pieced together from the bokeh tutorials. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
import pandas as pd | |
import requests | |
def perform_query(query): | |
"""Performs a SPARQL query to the wikidata endpoint | |
Args: | |
query: A string containing a functional sparql query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
libreoffice --headless --convert-to pdf:writer_pdf_Export "$1" --outdir . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyshex.shex_evaluator import ShExEvaluator | |
from pyshex.user_agent import SlurpyGraphWithAgent | |
from pyshex.utils.sparql_query import SPARQLQuery | |
import pandas as pd | |
def test_query_against_shex(schema, sparql): | |
"""Checks the items resulting from a Wikidata query against a shex schema | |
Using PyShEx, we can check the validity of multiple items against a predefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl https://www.toptal.com/developers/gitignore/api/python,r,linux,visualstudiocode >> .gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read1 WP_005581541.1 98.2 40 1 0 129 299 1 57 7.7e-22 113.6 | |
read2 WP_005575885.1 100.0 60 0 0 181 2 1 60 2.2e-24 122.1 | |
read3 WP_005580014.1 100.0 50 0 0 2 151 385 434 3.6e-19 104.8 | |
read4 WP_005576929.1 100.0 98 0 0 296 3 308 405 6.7e-42 180.3 | |
read5 ELY74166.1 98.0 100 2 0 300 1 80 179 7.9e-43 183.3 | |
read5 WP_015233403.1 98.0 100 2 0 300 1 98 197 7.9e-43 183.3 | |
read6 WP_005578121.1 100.0 52 0 0 1 156 124 175 1.6e-22 115.9 | |
read7 WP_005576999.1 92.0 100 8 0 1 300 14 113 1.1e-47 199.5 | |
read8 WP_005579760.1 98.0 100 2 0 2 301 214 313 1.8e-42 182.2 | |
read8 AFZ74922.1 98.0 100 2 0 2 301 188 287 1.8e-42 182.2 |
OlderNewer