Skip to content

Instantly share code, notes, and snippets.

View suqingdong's full-sized avatar
🐍

Qingdong Su suqingdong

🐍
  • Novogene
  • Tianjin, China
View GitHub Profile
@suqingdong
suqingdong / my_logger.py
Last active September 4, 2019 09:30
自定义Logger
#!/usr/bin/env python
#-*- encoding: utf8 -*-
import sys
import logging
class MyLogger(logging.Logger):
def __init__(self,
name=None,
level=logging.DEBUG,
@suqingdong
suqingdong / down_part.sh
Created July 22, 2019 08:50
download big file in small part with curl
#!/bin/sh
part_bytes=$((1024 * 1024 * 1024))
USAGE() {
echo -e "usage: $0 [options] <url>
options:
-o <str> the prefix of output
-s run curl on silent mode
-b <int> the bytes of each part[default: $part_bytes]

问题

把snp注释结果文件按指定ROH区间输出

解决

  1. 把ROH区间构建为如下结构的字典
{
  chrom: {
      (start, end): set([gene1, gene2, ...]),
 ...
@suqingdong
suqingdong / sentieon_dna_pipeline.sh
Created July 15, 2019 02:18
Sentieon DNA Pipeline Demo
#!/bin/sh
set -eo pipefail
# *******************************************
# Script to perform DNA seq variant calling
# using a single sample with fastq files
# named 1.fastq.gz and 2.fastq.gz
# *******************************************
# Update with the fullpath location of your sample fastq
fastq_folder="/home/pipeline/samples"
#!/usr/bin/env python
#-*- encoding: utf8 -*-
'''\033[1;32m
参考基因组每条染色体总长度和N的数量统计
\033[0m'''
import os
import sys
import json
import textwrap
import logging
@suqingdong
suqingdong / norm_encoding.py
Last active June 18, 2019 07:53
normalizing file with multiple encodings to utf8
#!/usr/bin/env python2
# encoding: utf-8
'''\033[1;3;32m
normalizing file with multiple encodings to utf8
\033[0m'''
import sys
import signal
import textwrap
import chardet
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
PS1="\[\e[0;35m\][\u@\h\[\e[33m\] \t \[\e[36m\]\w]\n\[\e[36m\]$\[\e[m\]"
#!/usr/bin/env python
#-*- encoding: utf-8 -*-
import os
import argparse
import getpass
import socket
import glob
@suqingdong
suqingdong / index_annovar.pl
Last active January 6, 2025 18:32
create index for annovar database
#!/usr/bin/env perl
use warnings;
use strict;
use Pod::Usage;
use Getopt::Long;
our $VERSION = '$Revision: ba2461d35c1c0732560fce2c19319479f5232d60 $';
our $LAST_CHANGED_DATE = '$LastChangedDate: 2012-10-23 23:32:05 -0700 (Tue, 23 Oct 2012) $';
@suqingdong
suqingdong / test.py
Last active January 31, 2019 07:47
pysam test
'''
pileup 获取指定区间reads的比对情况
truncate=True,只输出指定位点
stepper='samtools' 同samtools depth一样的过滤
stepper='nofilter' 不进行任何过滤
fetch 抓取指定区间内的所有reads
'''
import pysam