Skip to content

Instantly share code, notes, and snippets.

View juanmirocks's full-sized avatar
🎯
Focused

Dr. Juan Miguel Cejuela juanmirocks

🎯
Focused
View GitHub Profile
@juanmirocks
juanmirocks / hackerrank__no_prefix_set.py
Created August 17, 2023 14:26
HackerRank, problem: "No Prefix Set", Python3 solution
#!/bin/python3
import heapq
from typing import Iterable, Optional
#
# HackerRank, problem: "No Prefix Set"
# Url: https://www.hackerrank.com/challenges/one-week-preparation-kit-no-prefix-set/problem
# Level: Advanced (1 Week Preparation Kit)
#
@juanmirocks
juanmirocks / Pivot Points, by @juanmirocks.js
Last active February 25, 2023 03:48
Pine Script for a TradingView indicator: Pivot Points
// @version=3
//
// Pivot Points indicator, calculated in the "traditional" way, also called "floor-trader pivots".
//
// Additionally, and optional to the user, the halves between the key levels are also shown.
//
// The Default chosen Time Frame to calculate the pivot points is:
// Daily (D) if within intraday
// Weekly (W) if within daily chart
// Monthly (M) if within weekly chart
import numpy as np
from numpy import random as rng
samples = rng.random(500000)
prices = (np.array([10, 20, 30, 40]) * 1000).reshape(4, 1)
f = np.vectorize(lambda x: x * 10)
final = f(samples) * prices
means = final.mean(1)
print(means, np.argmax(means))

Extending the interoperability of tagtog and PubAnnotation

Authors: Juan Miguel Cejuela and Jorge Campos

tagtog is a web-based tool for the manual and automatic semantic annotation of written language. The domain of annotated texts is often the biomedical literature and moreover other sources are also treated (e.g. tweets, users' complaints, news reports, etc.). Users of the tool can collaborate together to create annotated text corpora. Furthermore, automatic named-entity recognizers and relationship extractors can be used to accelerate the annotation process. The tool can be accessed interactively via the web interface or programmatically via REST API. At the time of writing, the API is in beta status and public online documentation is provided.

The first submitting author participated in the first two editions of the BLAH hackathon and co-organized the BLAHmuc hacka

@juanmirocks
juanmirocks / BLAH2 - relna.md
Last active October 19, 2015 16:48
relna: corpus of Relations of Transcription Factors to Genes or Proteins

relna: corpus of Relations of Transcription Factors to Genes or Proteins

Authors: Ashish Baghudana and Juan Miguel Cejuela (juanmi@jmcejuela.com)

We present the relna corpus currently being prepared at Rostlab, Technical University of Munich. The corpus contains annotations of transcription factors (TFs) and genes or proteins (in general, GGPs or Gene or Gene Product) and their interactions (typically "TF transcribes gene"). The TF and GGP entities are annotated with offsets and both normalized to Entrez Gene and UniProtKB. Annotations are done semi-automatically. For manual annotations we are using the web editor tagtog. Considered documents are PubMed abstracts. At the time of writing, we have annotated 120 abstracts. We plan to annotate at least 200 total PubMed abstracts until December 2015. Our goal for the BLAH2 hackaton is to publicly release and store the corpus to

@juanmirocks
juanmirocks / BLAH2 - tagtog API.md
Last active October 19, 2015 14:32
Extending tagtog API to officially interoperate with PubAnnotation

Making tagtog interoperate with PubAnnotation

Authors: Juan Miguel Cejuela and Jorge Campos

tagtog is a web-based tool to fetch and edit manual and automatic annotations of biomedical literature. Multiple users can collaborate to create corpora of annotated text. Furthermore, automatic entity recognizers and automatic relationship extractors can be applied to accelerate the annotation process. The tool can be accessed interactively via the web interface or programmatically via a REST API. At the time of writing, the API is an alpha demo-like status. Current internal efforts at tagtog have the objective of documenting a formal API. We expect to finish this work before and is therefore beyond the scope of the BLAH2 hackaton. Rather, our objective for BLAH2 is be to provide an official interaction and sharing of annotations from tagtog to PubAnnotation. This includes 1) a conversion from tagtog's internal fo