General:
Tools | Description |
---|---|
flank | Create new intervals from the flanks of existing intervals. |
slop | Adjust the size of intervals. |
shift | Adjust the position of intervals. |
subtract | Remove intervals based on overlaps b/w two files. |
library(vcfR) | |
# Import VCF | |
my.vcf <- read.vcfR('my.vcf.gz') | |
# Combine CHROM thru FILTER cols + INFO cols | |
my.vcf.df <- cbind(as.data.frame(getFIX(my.vcf)), INFO2df(my.vcf)) |
git clean -xfd | |
git submodule foreach --recursive git clean -xfd | |
git reset --hard | |
git submodule foreach --recursive git reset --hard | |
git submodule update --init --recursive |
import sys | |
import gzip | |
from collections import defaultdict | |
if __name__ == "__main__": | |
d_telo= defaultdict(list) | |
d_centro = {} | |
with gzip.open(sys.argv[1], "rt") as ifi: | |
for line in ifi: |
grep -v "^@" $1 | awk '{print $1"\t"$2"\t"$3"\t"$5}' > $(dirname $1)/$(basename $1 .interval_list).bed && \ | |
bgzip $(dirname $1)/$(basename $1 .interval_list).bed && \ | |
tabix $(dirname $1)/$(basename $1 .interval_list).bed.gz |
first_reads=$1 | |
second_reads=$2 | |
ddir=$(dirname $first_reads) | |
obase_first=$(basename $first_reads .fastq.gz) | |
obase_second=$(basename $second_reads .fastq.gz) | |
splitsz=4000000 | |
if [ ! -z ${first_reads} ] && [ -e ${first_reads} ] |
## Tasks are upper camel-cased | |
task CheckSex{ | |
File sampleBAM | |
File sampleIndex | |
## Optional parameters receive a '?' after the type | |
Int? diskGB | |
## select_first can be used to set default values | |
diskGB = select_first([diskGB, 100]) |
chmod a+x vcfsort.sh | |
vcfsort.sh trio.trim.vep.vcf.gz |
Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
#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 |