This file contains 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
import contextlib | |
import sys | |
import pandas as pd | |
try: | |
import pandas.io.formats.format as pf | |
except ImportError: | |
import pandas.formats.format as pf | |
except ImportError: |
This file contains 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
class IgvCanvasToStatic(object): | |
def __init__(self): | |
self._javascript = """ | |
// Converts canvas to an image | |
function convertCanvasToImage(canvas) | |
{ | |
var image = canvas.toDataURL("image/png"); | |
return '<img src="' + image + '"/>'; | |
} |
This file contains 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.sh | |
# request Bourne shell as shell for job | |
#$ -S /bin/sh | |
#$ -cwd | |
#$ -V | |
#$ -m e | |
#$ -pe whole_nodes 7 | |
#$ -M [email protected] | |
############################### | |
module add bwa/0.6.1 |
This file contains 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
{ | |
"A10": [ | |
0.0034329041, 0.0137316166, 0.0344053282, 0.0188924926, 0.0240140593, | |
0.0212451426, 0.0821539635, 0.0064712216, 0.0620039955, 0.0524827040, | |
0.2530320358, 0.0485341620, 0.0114430138, 0.0159038497, 0.0332954789, | |
0.0099940168, 0.0068658083, 0.0000000000, 0.0062555142, 0.0113354956, | |
0.0026682288, 0.0070817142, 0.0072488791, 0.0161780540, 0.0074404795, | |
0.0071567324, 0.0295204042, 0.0000000000, 0.0022886028, 0.0000000000, | |
0.0030268617, 0.0099940168, 0.0000000000, 0.0000000000, 0.0218942998, | |
0.0000000000, 0.0000000000, 0.0035408571, 0.0144977583, 0.0032356108, |
This file contains 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
import textwrap | |
from operator import itemgetter | |
from Bio.Seq import reverse_complement | |
from pyfaidx import Fasta, FetchError | |
from collections import Counter, defaultdict, OrderedDict | |
from pymutagenesis.seq import * | |
link = '<a target="_blank" href={}>{}</a>' |
This file contains 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
import re | |
import csv | |
import textwrap | |
import matplotlib.pyplot as plt | |
from collections import Counter | |
class ReadError(LookupError): | |
"""Raise this when a property of a read is called for and no data exists""" | |
pass |
This file contains 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
from Bio.Seq import Seq | |
from Bio.Seq import reverse_complement | |
dna_bases = ('A', 'C', 'G', 'T') | |
purines = ('A', 'G') | |
pyrimidines = ('C', 'T') | |
transitions = ('A>T', 'C>G', 'G>C', 'T>A') | |
transversions = ('A>C', 'A>G', 'C>A', 'C>T', 'G>A', 'G>T', 'T>C', 'T>G') |
This file contains 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
# Pipe in the karyotype chromosomes | |
# Prefix each chromosome name with `chr` if necessary | |
# Slice the contigs from the source indexed FASTA with samtools | |
# Output to file | |
build="${build}" | |
echo {1..20} X Y M \ | |
| xargs printf -- 'chr%s ' \ | |
| xargs samtools faidx "${build}".fa \ |
This file contains 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
import sys | |
import threading | |
import time | |
# Really though just use a library for this: | |
# https://github.com/ManrajGrover/halo | |
# | |
class Spinner: | |
"""https://stackoverflow.com/a/39504463/3727678""" | |
busy = False |
This file contains 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 | |
# | |
# drawHelix.sh <input.fa> | |
# | |
# Reads a fasta input file and stream a B-Form DNA | |
# helix with the sequence to STDOUT | |
# | |
## __ __ __ ___ | |
### |__) | / \ /__` \ / |\ | | /\ \_/ | |
#### |__) | \__/ .__/ | | \| | /~~\ / \ |