Skip to content

Instantly share code, notes, and snippets.

View chapmanb's full-sized avatar

Brad Chapman chapmanb

View GitHub Profile
@chapmanb
chapmanb / gatk_vcfsimplify-orig.vcf
Created December 14, 2011 11:29
GATK VCF over-simplification of multiple alleles example
##fileformat=VCFv4.1
#CHROM POS ID REF ALT QUAL FILTER INFO
6 58777178 . GG G,TG 106.357 . .
@chapmanb
chapmanb / biostar_challenge_ZC3H7B.vcf
Created December 21, 2011 20:46
BioStar Challenge variants in ZC3H7B
child_111217_biostar-variants.vcf:chr22 41742029 . T A 201.60 PASS AC=1;AF=0.50;AN=2;BaseQRankSum=3.515;DP=22;Dels=0.00;FS=0.000;HRun=2;HaplotypeScore=6.7867;MQ=48.95;MQ0=0;MQRankSum=0.853;QD=9.16;ReadPosRankSum=0.853;SNPEFF_AMINO_ACID_CHANGE=C/*;SNPEFF_CODON_CHANGE=tgT/tgA;SNPEFF_EFFECT=STOP_GAINED;SNPEFF_EXON_ID=exon_22_41742007_41742212;SNPEFF_FUNCTIONAL_CLASS=NONSENSE;SNPEFF_GENE_BIOTYPE=protein_coding;SNPEFF_GENE_NAME=ZC3H7B;SNPEFF_IMPACT=HIGH;SNPEFF_TRANSCRIPT_ID=ENST00000351589;set=child_111217_biostar-sort-dup-gatkrecal-realign-variants-snp-filterSNP GT:AD:DP:GQ:PL 0/1:8,14:22:1.52:230,0,2
child_111217_biostar-variants.vcf:chr22 41742047 . C G 71.96 PASS AC=1;AF=0.50;AN=2;BaseQRankSum=-0.972;DP=19;Dels=0.00;FS=0.000;HRun=1;HaplotypeScore=6.7516;MQ=48.19;MQ0=0;MQRankSum=-2.071;QD=3.79;ReadPosRankSum=0.972;SNPEFF_AMINO_ACID_CHANGE=C/W;SNPEFF_CODON_CHANGE=tgC/tgG;SNPEFF_EFFECT=NON_SYNONYMOUS_CODING;SNPEFF_EXON_ID=exon_22_41742007_41742212;SNPEFF_FUNCTIONAL_CLASS=MISSENSE;SNPEFF_GENE_BIOTYPE=protein_codin
def runGlobPlot():
try:
smoothFrame = int(sys.argv[1])
DOM_joinFrame = int(sys.argv[2])
DOM_peakFrame = int(sys.argv[3])
DIS_joinFrame = int(sys.argv[4])
DIS_peakFrame = int(sys.argv[5])
file = str(sys.argv[6])
db = open(file,'r')
except:
#!/usr/local/bin/python
# Copyright (C) 2004 Rune Linding & Lars Juhl Jensen - EMBL
# The DisEMBL is licensed under the GPL license
# (http://www.opensource.org/licenses/gpl-license.php)
# DisEMBL pipeline
from string import *
from sys import argv
from Bio import SeqIO
import fpformat
@chapmanb
chapmanb / SelectVariants-discordance.patch
Created January 28, 2012 17:15
GATK SelectVariants --discordance: check comparison genotypes
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java
index 6d94ffe..1d6a7f7 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/SelectVariants.java
@@ -557,7 +557,7 @@ public class SelectVariants extends RodWalker<Integer, Integer> implements TreeR
// Look for this sample in the all vcs of the comp ROD track.
boolean foundVariant = false;
for (VariantContext compVC : compVCs) {
- if (sampleHasVariant(compVC.getGenotype(g.getSampleName()))) {
+ if (haveSameGenotypes(g, compVC.getGenotype(g.getSampleName()))) {
@chapmanb
chapmanb / AbstractVCFCodec_Allele-breakends.patch
Created February 21, 2012 02:16
GATK support for breakend alleles
diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java
index e44c10f..3c498c8 100755
--- a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java
+++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java
@@ -540,12 +540,15 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec {
}
/**
- * return true if this is a symbolic allele (e.g. <SOMETAG>) otherwise false
+ * return true if this is a symbolic allele (e.g. <SOMETAG>) or
# Perform peak calling with Peter Park's SPP
# http://compbio.med.harvard.edu/Supplements/ChIP-seq/tutorial.html
library(spp)
align.dir <- "/store3/projects/Oettinger/mouse/solexa/ToshiAnalysis/alignments"
cur.analysis <- "lane1"
chip.file <- file.path(align.dir, "lane1_sample4_pml3_10.uniq.ilt.qltout.onehead")
back.file <- file.path(align.dir, "lane8_TIC_pml3_10.uniq.ilt.qltout.onehead")
@chapmanb
chapmanb / process_calls-allow_ns.patch
Created August 22, 2012 18:36
cortex_var patch to allow reference base Ns in discovered indels
--- scripts/analyse_variants/process_calls.pl.orig 2012-08-17 11:49:14.000000000 -0400
+++ scripts/analyse_variants/process_calls.pl 2012-08-22 13:02:23.612425014 -0400
@@ -1754,17 +1754,17 @@
my $two_alleles = $aref_indel_alleles->[ $cnt - 1 ];
my $this_indel_ref_allele;
my $this_indel_alt_allele;
- if ( $two_alleles =~ /^([ACGT]+)_([ACGT]+)$/ )
+ if ( $two_alleles =~ /^([ACGTN]+)_([ACGTN]+)$/ )
{
$this_indel_ref_allele = $1;
@chapmanb
chapmanb / dpsample_nullallele.patch
Created August 27, 2012 10:50
Fix GATK null allele error when calculating DepthPerAlleleBySample for indels
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java
index 5d83ddd..928d836 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java
@@ -87,12 +87,12 @@ public class DepthPerAlleleBySample extends GenotypeAnnotation implements Standa
for ( PileupElement p : pileup ) {
if ( p.isBeforeInsertion() ) {
-
- final Allele insertion = Allele.create((char)refBase + p.getEventBases(), false);
@chapmanb
chapmanb / fastqc_checker.py
Created October 25, 2012 16:50
FastQC summarizer
#!/usr/bin/env python
'''
FastQC checker for Galaxy biomedical data analysis platform
@author: Ilya Sytchev
Input: one or more files in fastq format
Output: sequencing quality report in text format