Skip to content

Instantly share code, notes, and snippets.

View gamazeps's full-sized avatar

Félix Raimundo gamazeps

View GitHub Profile
def deepSv_predict(reads, reference, representation, model):
stats = generate_read_stats(reads) # we grab std and mean for insert and read size
candidates = paired_read_analysis(reads, stats) # generate candidate variants
calls = set()
for (variant, supporting_reads) in candidates:
proba = model.predict(representation.generate(variant, supporting_reads))
if proba > 0.5:
calls.add((variant, supporting_reads))
def deepSv_predict(reads, reference, representation, model):
stats = generate_read_stats(reads) # we grab std and mean for insert and read size
candidates = paired_read_analysis(reads, stats) # generate candidate variants
calls = set()
for (variant, supporting_reads) in candidates:
proba = model.predict(representation.generate(variant, supporting_reads))
if proba > 0.5:
calls.add((variant, supporting_reads))
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <climits>
using namespace std;
int main() {
@gamazeps
gamazeps / Huzza.rs
Created October 19, 2015 22:33
Les messages et la contravariances sont réglés \o/
use std::any::Any;
use std::collections::VecDeque;
enum Message {
Command(String),
Data(Box<Any>),
}
trait Actor {
fn receive(&mut self, Message);
#include “hal.h”
#include “ch.h”
int main(void) {
halInit(); // initializes hardware abstraction layer
chSysInit(); // initializes ChibiOS kernel
// configures GPIOC pin 1 as output pushpull
palSetPadMode(GPIOC, 1, PAL_MODE_OUTPUT_PUSHPULL);
while(1) {
palSetPad(GPIOC, 1); // sets GPIOC 1 high
/* Simple PWM example */
/*
* PWMD3 is a HAL defined variable of type PWMDriver - it is associated with
* TIM3.
*/
#include "ch.h"
#include "hal.h"
static PWMConfig pwmcfg = {
200000, /* 200Khz PWM clock frequency*/
1024, /* PWM period of 1024 ticks ~ 0.005 second */
NULL, /* No callback */
/* Only channel 1 enabled */
{
{PWM_OUTPUT_ACTIVE_HIGH, NULL},
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL}
#include "ch.h"
#include "hal.h"
int main(void) {
halInit(); // Initializes ChibiOS/RT's Hardware Abstraction Layer (HAL)
chSysInit(); // Initializes ChibiOS/RT kernel
// Configures GPIOD pin 15 as output (the blue LED on the board)
palSetPadMode(GPIOD, 15, PAL_MODE_OUTPUT_PUSHPULL);
#include "ch.h"
#include "hal.h"
#include "servo.h"
#define SERVO_PWM PWMD3
static PWMConfig pwm_servo = {
100000, /* 100Khz PWM clock frequency*/
2000, /* PWM period of 2000 ticks ~ 20ms */
NULL, /* No callback at the end of the timer count */