This file contains hidden or 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
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)) | |
This file contains hidden or 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
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)) | |
This file contains hidden or 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
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <climits> | |
using namespace std; | |
int main() { |
This file contains hidden or 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
use std::any::Any; | |
use std::collections::VecDeque; | |
enum Message { | |
Command(String), | |
Data(Box<Any>), | |
} | |
trait Actor { | |
fn receive(&mut self, Message); |
This file contains hidden or 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
#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 |
This file contains hidden or 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
/* Simple PWM example */ | |
/* | |
* PWMD3 is a HAL defined variable of type PWMDriver - it is associated with | |
* TIM3. | |
*/ | |
#include "ch.h" | |
#include "hal.h" |
This file contains hidden or 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
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} |
This file contains hidden or 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
#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); |
This file contains hidden or 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
#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 */ |