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
TATA.\{6,\}T[AG]G[CT]..A...G.\{33,\}G[AT]TC[AG]A..C.*TTTT |
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 | |
set -e | |
set -u | |
failed=0 | |
for file in *.fq.gz; do | |
md5=$(gunzip -c "$file" | openssl md5 | cut -f2 -d " ") | |
gold=$(grep "${file/.gz/}" md5sums.txt | cut -f2) | |
if [ "$md5" != "$gold" ]; then |
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
#ifndef TEXT_STRING_HPP | |
#define TEXT_STRING_HPP | |
#include <algorithm> | |
#include <cstring> | |
#include <iterator> | |
#include <memory> | |
#include <iosfwd> | |
namespace text { |
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
#include <algorithm> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <boost/container/vector.hpp> | |
struct TrieNode { | |
boost::container::vector<TrieNode> children; | |
std::vector<std::vector<std::string>::const_iterator> head; |
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
using System; | |
using System.Collections.Generic; | |
namespace klmr { | |
// Version from http://stackoverflow.com/a/75502/1968 | |
public class Test { | |
public static bool IsAssignableToGenericType(Type givenType, Type genericType) { | |
var interfaceTypes = givenType.GetInterfaces(); | |
foreach (var it in interfaceTypes) |
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
enum class dna_strand : char { | |
positive = '+', | |
negative = '-' | |
}; | |
std::ostream& operator <<(std::ostream& out, dna_strand strand) { | |
return out << static_cast<char>(strand); | |
} | |
std::istream& operator >>(std::istream& in, dna_strand& strand) { |
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
#!/usr/bin/env bash | |
set -e | |
set -u | |
input="${1-/dev/stdin}" | |
declare -A counts=( | |
[A]=0 | |
[C]=0 |
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
while (getline(in, line)) { | |
if (line.compare(0, 4, "@RG\t") != 0) continue; | |
size_t start = line.find("\tID:"); | |
if (start == string::npos) continue; | |
start += 4; | |
size_t end = line.find("\t", start); | |
if (end == string::npos or end == start) continue; | |
gids.emplace(string.begin() + start, string.begin() + end); | |
// Or, in C++03: | |
//gids.insert(line.substr(start, end - start)); |
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
result = x == "foo" ? foo() : | |
x == "bar" ? bar() : | |
x == "baz" ? baz() : | |
x == "qux" ? qux(); |
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
#!/usr/bin/env bash | |
source ~/.config/extpaths # For samtools | |
set -e | |
set -u | |
n=0 | |
for bam in $*; do |