Skip to content

Instantly share code, notes, and snippets.

View dridk's full-sized avatar

sacha schutz dridk

View GitHub Profile
View VCF2duck.rs
use vcf::{VCFReader,VCFRecord};
use std::fs::File;
use std::fs::remove_file;
use std::io::BufReader;
use std::str::from_utf8;
use duckdb::{params, Connection};
View gist:d2c2358b9929c27cbf7a129c20eaf85e
vim.opt.number = true
vim.opt.mouse = 'a'
vim.opt.ignorecase = true
vim.opt.hlsearch = false
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.termguicolors = true
@dridk
dridk / base.yml
Created May 4, 2022 21:33
Use espanso to translate text with deepl
View base.yml
- regex: ":tr\"(?P<text>.*)\""
replace: "{{translate}}"
vars:
- name: translate
type: shell
params:
cmd: "python ~/translate.py \"{{text}}\""
@dridk
dridk / RangeSlider.py
Last active April 5, 2022 09:11
The following code creates a range slider as a Qt widget with a native looks and feel
View RangeSlider.py
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
import sys
class RangeSlider(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
@dridk
dridk / graph_pyside6.py
Created March 26, 2022 22:58
graph pyside6
View graph_pyside6.py
from PySide6.QtWidgets import *
from PySide6.QtCore import *
from PySide6.QtGui import *
import math
import networkx as nx
import igraph as ig
class Node(QGraphicsItem):
@dridk
dridk / owl2thesaurus.py
Created January 11, 2022 22:54
OWL to oracle thesaurus
View owl2thesaurus.py
from nxontology.imports import from_file
import networkx as nx
g = from_file("hp.owl")
space = 0
previous_first =""
previous_second =""
tab = " "
@dridk
dridk / vcf_classifieur.py
Created October 13, 2021 19:46
qt example
View vcf_classifieur.py
from PySide2.QtWidgets import *
import sys
class MonWidget(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
hlayout = QHBoxLayout()
self.left_button = QPushButton("<")
@dridk
dridk / test.wig
Created September 23, 2021 15:16
test.wig
View test.wig
track type=wiggle_0 graphType=points name="truc" description="une description" visibility=full color=50,150,255 yLineMark=11.76 yLineOnOff=on
variableStep chrom=chr1
[span=windowSize]
2488157 0.4818
2488159 0.4818
2491207 0.537
2494787 0.5251
6257857 0.488
7434547 0.4077
@dridk
dridk / image_coord_motif_detection.py
Created August 10, 2021 17:40
image_coord_motif_detection
View image_coord_motif_detection.py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from skimage.io import imread
from skimage.color import rgb2gray
from skimage.filters import threshold_otsu
from skimage.measure import label
@dridk
dridk / qml_model_python.py
Created December 29, 2020 22:51
qml and python model integration with PySide2
View qml_model_python.py
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtQuick import QQuickView
import sys
import random
class PlayerModel(QAbstractListModel):
"""