Skip to content

Instantly share code, notes, and snippets.

View chapmanb's full-sized avatar

Brad Chapman chapmanb

View GitHub Profile
@chapmanb
chapmanb / arvados_add_update.py
Created October 31, 2021 00:15
Example of adding and updating a sequence in Arvados, with required remove/save step to avoid certificate error
def simple_add_update():
"""Test adding and updating a collection to reproduce certificate error.
"""
project_uuid = "pirca-j7d0g-h13mew3i5ya8cqq"
name = "save_new_test"
fname = "seqs.fa"
avoid_an_error = True
arvados_conn = get_connection_config()
c = arvados.collection.Collection(apiconfig=arvados_conn)
with c.open(fname, "wb") as writer:
2-584759 no MET
2-584751 MET (FISH and ddPCR)
2-584699 MET (FISH and ddPCR)
#!/bin/bash
set -eu -o pipefail
export TARGETDIR=`pwd`/anaconda
export BINDIR=`pwd`
wget http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
bash Miniconda2-latest-Linux-x86_64.sh -b -p $TARGETDIR
$TARGETDIR/bin/conda install --yes -c conda-forge -c bioconda bcbio-nextgen
$TARGETDIR/bin/conda install --yes -c conda-forge -c bioconda bcbio-nextgen-vm
mkdir -p $BINDIR/bin
@chapmanb
chapmanb / Seracare_CNV_control_a-normalized.cnr
Created December 12, 2018 20:38
CNVkit Seracare CNV segmentation
chromosome start end gene log2 depth weight
chr1 500 1094854 Antitarget -0.447257 0.03 0.708181
chr1 1094854 2189208 Antitarget 0.193 0.08 0.869498
chr1 2189708 2189781 FAAP20 0.166003 58.58 0.0757517
chr1 2191894 2192048 FAAP20 0.684696 184.21 0.125722
chr1 2192048 2192202 FAAP20 -0.549982 263.06 0.0954321
chr1 2192202 2192357 FAAP20 0.391232 247.57 0.125377
chr1 2192357 2192511 FAAP20 0.949453 287.09 0.1122
chr1 2192511 2192666 FAAP20 0.496266 206.08 0.113593
chr1 2192666 2192820 FAAP20 0.265958 58.87 0.0857653
include required(classpath("application"))
system {
workflow-restart = true
}
call-caching {
enabled = true
}
load-control {
# Avoid watching memory, since the load-controller stops jobs on local runs
chrI 230218
chrII 813184
chrIII 316620
chrIV 1531933
chrV 576874
chrVI 270161
chrVII 1090940
chrVIII 562643
chrIX 439888
chrX 745751
@chapmanb
chapmanb / tcga_capture.R
Created November 8, 2018 17:29
Query TCGA API for exome capture BED files -- thanks to Sehyun Oh
#!/usr/bin/env Rscript
library(GenomicDataCommons)
library(dplyr)
manifest = GenomicDataCommons::files() %>%
GenomicDataCommons::filter(~ cases.project.project_id == "TCGA-LUAD" &
experimental_strategy == "WXS" &
data_format == "BAM") %>%
GenomicDataCommons::manifest()
@chapmanb
chapmanb / bcbio-cromwell-http.conf
Created October 2, 2018 13:38
Cromwell configuration generated by bcbio for http inputs
include required(classpath("application"))
system {
workflow-restart = true
}
call-caching {
enabled = true
}
load-control {
@chapmanb
chapmanb / extract_umis.py
Created August 24, 2018 17:03
Extract UMIs from input fastq file
from __future__ import print_function
import collections
import gzip
import sys
from Bio.SeqIO.QualityIO import FastqGeneralIterator
nbases = 15
nreads = 1e6
toshow = 20
@chapmanb
chapmanb / main-arvados_testcwl-pack.cwl
Created August 3, 2018 13:58
Arvados WES test submission
{
"cwlVersion": "v1.0",
"$graph": [
{
"class": "Workflow",
"hints": [],
"inputs": [
{
"id": "#main/config__algorithm__align_split_size",
"type": {