Skip to content

Instantly share code, notes, and snippets.

View lozybean's full-sized avatar

Lyon0804 lozybean

View GitHub Profile
@lozybean
lozybean / functions.conf
Last active September 19, 2017 13:40
JBrowse config
colorfun=function(feature) {
if(feature.get('cosmic_attrs')) return 'red';
else if(feature.get('clinvar_attrs')) return 'cyan';
else if(feature.get('dbsnp_attrs')) return 'green';
else if(feature.get('snpeff_attrs')) return 'goldenrod';
else if(feature.get('snpeff_0_attrs')) return 'orange';
else if(feature.get('wellderly_attrs')) return 'purple';
else return 'lightgreen';
}
@lozybean
lozybean / variant_record.py
Created August 29, 2017 05:10
variant record normalization
class VariantRecord(object):
def __init__(self, chrom, pos, ref, alt,
ref_genome=ref_genome):
self.chrom = chrom
self.pos = int(pos)
self.ref = ref
self.alt = alt
if isinstance(ref_genome, RefGenome):
self.ref_genome = ref_genome
else:
@lozybean
lozybean / lft_download
Created May 11, 2017 04:48
a shell script use lftp recursive download a directory on remote server;
#!/bin/bash
REMOTE_DIR=
USER=
PASSWD=
HOST=ftp://
lftp -u ${USER},${PASSWD} ${HOST} << EOF
mirror --use-pget-n=10 ${REMOTE_DIR}
bye
#!/usr/bin/env python
# -*- coding: utf-8 -*- \#
"""
@author = 'liangzb'
@date = '2016/10/28 0028'
This script is used for FILTER marker in .vcf files
1. if filterName or genotypeFilterName is startswith 'SNP'
or 'INDEL', only corresponding record will be check.
2. filterExpression and genotypeFilterExpression is a simple
@lozybean
lozybean / execly.py
Last active October 8, 2016 05:29
py3meta from David pycon2013.
# execly.py
#
# Example of generating code and executing it with exec()
# in the context of descriptors/metaclasses
from inspect import Parameter, Signature
import re
import time
from collections import OrderedDict
#!/usr/bin/env python
# -*- coding: utf-8 -*- \#
"""
@author = 'liangzb'
@date = '2016/7/13 0013'
This script is for official clinvar.vcf file's
normalization and satisficing ANNOVAR format.
samtools is needed for reference read.
@lozybean
lozybean / CIViC_database.py
Last active July 5, 2016 09:30
CIViC local based
#!/usr/bin/env python
# -*- coding: utf-8 -*- \#
"""
@author = 'liangzb'
@date = '2016/7/5 0005'
"""
import abc