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
| #!/bin/bash | |
| # Unzip files | |
| for file in *.zip; do | |
| unzip "$file" | |
| done | |
| # Extract fastqs | |
| for file in *.ab1; do | |
| seqret -sformat abi -osformat fastq -auto -stdout -sequence "$file" > "$(basename "$file" .ab1).fastq" |
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
| #!/bin/bash | |
| # usage: $0 <MiSeq output dir> <output dir> | |
| dir=$1/Thumbnail_Images/L001 | |
| output=$2 | |
| number_of_tiles=$(grep FlowcellLayout ${1}/RunInfo.xml | cut -d = -f 5 | sed -e 's/[^0-9]*//g') | |
| if [[ ! -d ${output} ]]; then | |
| mkdir ${output} | |
| fi |
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
| #!/usr/share/gemini/anaconda/bin/python -E | |
| # -*- coding: utf-8 -*- | |
| # usage: gemini_summarize.py <query> <gemini.db> | |
| import sys | |
| import locale | |
| from gemini import GeminiQuery | |
| DP_THRESHOLD = 8 | |
| GQ_THRESHOLD = 20 |
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
| #!/usr/bin/python | |
| import pandas as pd | |
| import sys | |
| df = pd.read_csv(sys.argv[1], sep='\t', index_col=0) | |
| for col in df.columns: | |
| if col[3] == 'B': | |
| df = df.drop(col, 1) |
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
| #!/bin/bash | |
| bcftools norm -Ou -m -any $1 | # Split multi-allelic alleles | |
| bcftools norm -Ou -f /resources/hg19/ucsc.hg19.fasta | # Normalize | |
| bcftools annotate -Ob -x ID -I +'%CHROM:%POS:%REF:%ALT' | # Replace IDs with unique ID | |
| plink --bcf /dev/stdin --keep-allele-order --double-id --allow-extra-chr 0 --make-bed --out variants | |
| king -b variants.bed --kinship --prefix kinship | |
| king -b variants.bed --individual |
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
| #!/bin/bash | |
| max_jobs=4 | |
| for i in $(seq 10); do | |
| while [[ $(jobs | wc --lines) -ge ${max_jobs} ]]; do | |
| sleep 1 | |
| done | |
| # Do the job |
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
| #!/bin/bash | |
| if [[ -z $* ]]; then | |
| echo "Usage: $0 <bam file> <bed file>" | |
| exit 1 | |
| fi | |
| # Header start | |
| echo '@HD VN:1.0 SO:coordinate' | tr " " "\t" |
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
| #!/bin/bash | |
| DATA='/data/project' | |
| for sample in $(cd ${DATA}; ls -1 *.r1.fastq.gz | cut -d . -f 1); do | |
| bowtie2 -x /resources/phix/bowtie2/phix -1 ${DATA}/${sample}.r1.fastq.gz -2 ${DATA}/${sample}.r2.fastq.gz -S /dev/null --al-conc-gz phix-${sample}.r%.fastq.gz -p 4 2>&1 | tee -a phix.log | |
| done |
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
| bedtools sort -i foo.bed | bedtools merge -i - -nms | sed -e 's/\r//g' | awk -F '\t' '{ split($4, name, "."); print $1 FS $2 FS $3 FS name[1] }' |
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
| #!/bin/bash | |
| echo -e "#CHR\tBP1\tBP2\tID" | |
| awk -F '\t' '{ print $1 FS $2+1 FS $3 FS NR }' | sed -e 's/^\([0-9]\+\)/chr\1/g' |