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
from cyvcf2 import VCF, Writer | |
from pyfaidx import Fasta | |
from argparse import ArgumentParser | |
def main(): | |
args = get_args() | |
genome = Fasta(args.genome) | |
vcf = VCF(args.vcf) | |
output = Writer(args.output, vcf) |
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
from argparse import ArgumentParser | |
from Bio import SeqIO | |
import gzip | |
from dateutil.parser import parse as dparse | |
def main(): | |
args = get_args() | |
time_from = dparse(args.time_from) | |
time_to = dparse(args.time_to) |
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
from cyvcf2 import VCF | |
from argparse import ArgumentParser | |
import matplotlib.pyplot as plt | |
import sys | |
def main(): | |
args = get_args() | |
sample_dict = get_sample_dict(args.samples) | |
vcf = VCF(args.vcf) |
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
from apiclient.discovery import build | |
from httplib2 import Http | |
from oauth2client import file, client, tools | |
from time import time | |
from datetime import datetime | |
class Document(object): | |
def __init__(self, title, id): | |
"""Title is free, id is google docs identifier""" |
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
from apiclient.discovery import build | |
from httplib2 import Http | |
from oauth2client import file, client, tools | |
from time import time | |
from datetime import datetime | |
def main(): | |
service = setup_api() | |
file_ids = get_files_in_folder(service, folder_id="folder_id") |
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
from cyvcf2 import VCF | |
import sys | |
import matplotlib.pyplot as plt | |
from matplotlib_venn import venn2 | |
def is_variant(call): | |
if call == 1 or call == 3: | |
return True | |
else: |
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
chromosome begin end name outer_begin outer_end strand primer1 primer2 numamplicons amplicons primer1_hits primer1_snpsmaxfreq primer1_snps primer2_hits primer2_snpsmaxfreq primer2_snps amplicon_fts remarks | |
17 41226318 41226487 test 41226293 41226510 + AGGATTCAGAGTAAAATCAAAGTGT GATGATAGGTGGTACATGCACAG 1 17:41226318-41226487 26 7.000000000000001e-5rs869312522(snp@chr17:41226294-41226295;freq=0;valid=by-cluster;submitterCount=2) rs762883588(snp@chr17:41226315-41226316;freq=7.000000000000001e-5;valid=by-frequency;submitterCount=1) rs273900738(snp@chr17:41226316-41226317;freq=0;valid=unknown;submitterCount=1) 15 0.99997 rs1800744(snp@chr17:41226487-41226488;freq=0.99791;valid=by-cluster,by-frequency,by-1000genomes;submitterCount=16) rs397509183(del@chr17:41226487-41226489;freq=0;valid=unknown;submitterCount=1) rs80357137(snp@chr17:41226488-41226489;freq=0;valid=unknown;submitterCount=1) rs80357534(del@chr17:41226488-41226490;freq=0;valid=unknown;submitterCount=1) rs397509182(del@chr17:41226494-41226495;freq=0;val |
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
name primer1 primer2 | |
test AGGATTCAGAGTAAAATCAAAGTGT GATGATAGGTGGTACATGCACAG |
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
import pysam | |
import sys | |
import matplotlib.pyplot as plt | |
import numpy as np | |
def main(bam): | |
samfile = pysam.AlignmentFile(bam) | |
ratios = np.array([indelratio(read.cigartuples) for read in samfile.fetch()]) | |
n, bins, patches = plt.hist(ratios, bins=[i/10 for i in range(1,50, 1)]) | |
plt.xlabel('indel ratio') |
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
import fdb | |
con = fdb.connect(dsn='molgenvz.cde.ua.ac.be:/home/firebird/gentli.fdb', | |
user='wdc', | |
password="mypassword", | |
role='NBD_SC') | |
cur = con.cursor() | |
cur.execute('select "id", "sample_individual", "sample_sample", "experiment_id", \ | |
"experiment_description", "wes_project" from "NBD_SC:full_wes" \ | |
where \ |