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 PySide2.QtWidgets import * | |
from PySide2.QtCore import * | |
from PySide2.QtGui import * | |
import sys | |
class RangeSlider(QWidget): | |
def __init__(self, parent=None): | |
super().__init__(parent) |
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
for file in *.vcf*; do | |
for sample in `bcftools view -h $file | grep "^#CHROM" | cut -f10-`; do | |
bcftools view -c1 -Oz -s $sample -o ${file/.vcf*/.$sample.vcf.gz} $file | |
done | |
done |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <htslib/sam.h> | |
int main(int argc, char *argv[]){ | |
samFile *fp_in = hts_open(argv[1],"r"); //open bam file | |
bam_hdr_t *bamHdr = sam_hdr_read(fp_in); //read header | |
bam1_t *aln = bam_init1(); //initialize an alignment |
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
try: | |
import simplejson as json | |
except ImportError: | |
try: | |
import json | |
except ImportError: | |
raise ImportError | |
import datetime | |
from bson.objectid import ObjectId | |
from werkzeug import Response |
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
require 'rest_client' | |
require 'json' | |
a = `sox -d --norm -t .flac - silence -l 1 0 1% 1 6.0 1% rate 16k` | |
#a = `arecord -q -d 3 -c 1 -f S16_LE -r 22050 -t wav | flac - -f --totally-silent -o-` | |
r = RestClient.post 'https://www.google.com/speech-api/v1/recognize?lang=en-US', a, | |
:content_type => 'audio/x-flac; rate=16000' | |
if j = JSON.parse(r) | |
(p j; `espeak 'you said: #{j['hypotheses'].first['utterance']}'`) | |
end |