Skip to content

Instantly share code, notes, and snippets.

View standage's full-sized avatar

Daniel Standage standage

View GitHub Profile
#!/usr/bin/env python
from __future__ import print_function
import khmer
import sys
# Usage: $scriptname <infile> <numbands>
infile = sys.argv[1]
numbands = int(sys.argv[2])
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>PSPT: Precision Solar Photometric Telescope</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/custom-theme/jquery-ui-1.7.3.custom.css">
<link rel="stylesheet" type="text/css" href="css/pspt.css">
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
#!/usr/bin/env bash
curl http://lasp.colorado.edu/lisird/nrlssi/ > e7f9b45a-8fbe-441e-a9a6-5cb74a2591c3.html
curl http://lasp.colorado.edu/lisird/tss/nrlssi.csv? > nrlssi.csv
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>LISIRD - Flare Irradiance Spectral Model (FISM)</title>
<link rel="stylesheet" type="text/css" href="/lisird/CSS/fism.css" />
<script type="text/javascript" src="/lisird/scripts/js/fism.js"></script>
</head>
#!/usr/bin/env python
from __future__ import print_function
import re
import khmer
import screed
import sys
infile = sys.argv[1]
bands = int(sys.argv[2])
#!/usr/bin/env python
from __future__ import print_function
import khmer
cg = khmer.Countgraph(31, 2e6, 4)
cg.consume_fasta('testing.fq.gz')
fpr = khmer.calc_expected_collisions(cg)
print('eFPR {:1.3f}'.format(fpr))
kmer1 = 'TTACCATGACCAGTTTCTATGGTCATCCCAA'
>read0r start=10476,mutations=0
GATTTGCGTTAGCAGACCGAACGGTGATATCCTGATACGAGCTGGACTTT
>read1f start=409,mutations=0
TCGTTGCGCGTGAGCGCTGAGGTTCCAGTCTTTCCCTACGGCGTAGATGA
>read2r start=4012,mutations=0
TTTGATGCGCGCTTGGTTCTTGTCTGCCGCCCAGCGCAGCCAAGCCGGTG
>read3r start=2286,mutations=0
CATAAAGCATGCGGGGACCACCTGCATTTGGCCGCCTCGTAGTTCATTCT
>read4r start=11087,mutations=0
CTGCGCTTGCAATGTAACATACGTTACGCAAAGCATAAGTGACCGGTCAA
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@standage
standage / mp3-sort.py
Created January 2, 2017 18:10
In iTunes you can't sort files by filename, but you can sort by album. This script overwrites each MP3 file's "album" tag with the filename to enable sorting.
#!/usr/bin/env python
import glob
import taglib
for filename in sorted(glob.glob('*.mp3')):
mp3 = taglib.File(filename)
mp3.tags['ALBUM'] = [filename]
_ = mp3.save()
import khmer
k = 31
tablesize = 1e9 # 1GB
ntables = 4
counts = khmer.Countgraph(k, tablesize, ntable) # 4GB total
counts.consume_fasta('NA19240.not-boring.fq.gz') # handles FASTA and FASTQ
bogus_kmer = 'A' * k # 31 As