$ cat contigs.fasta
>NODE_1_length_869844_cov_1135.34
ACTGNacgtn
>NODE_2_length_576386_cov_975.882
acgtn
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
scaf001 glean mRNA 20 30 0.4 - . somestring | |
scaf001 glean CDS 30 50 . + 0 asdfasd | |
scaf003 glean CDS 10 25 0.4 - . somestring |
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/python | |
import re | |
from itertools import groupby | |
s = '11M1D31M1I3M1D48M2I1M1D28M' | |
g = re.findall('\d+[A-Z]', s) # ['11M', '1D', '31M', '1I', '3M', '1D', '48M', '2I', '1M', '1D', '28M'] | |
kv = [[x[-1], int(x[0:-1])] for x in g] # [['M', 11], ['D', 1], ['M', 31], ['I', 1], ['M', 3], ['D', 1], ['M', 48], ['I', 2], ['M', 1], ['D', 1], ['M', 28]] | |
kv = sorted(kv, key=lambda e: e[0]) # fuck !! sorting needed! | |
stat = { k: sum((g[1] for g in group)) for k, group in groupby(kv, key=lambda e: e[0])} | |
print(stat) # {'M': 122, 'I': 3, 'D': 3} |
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 python | |
# different implemention of nested dict in Python | |
from collections import defaultdict | |
# from: http://stackoverflow.com/questions/635483/what-is-the-best-way-to-implement-nested-dictionaries-in-python | |
class AutoVivification(dict): | |
def __getitem__(self, item): | |
try: | |
return dict.__getitem__(self, item) |
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
// run: | |
// | |
// go test -test.bench="." -test.cpuprofile=prof.out | |
// go tool pprof ./gist.test prof.out | |
package main | |
import ( | |
"bytes" | |
"testing" | |
) |
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 python | |
import argparse | |
import random | |
parser = argparse.ArgumentParser(description="generate test data", | |
epilog="https://github.com/shenwei356/") | |
parser.add_argument('-n', | |
type=int, | |
default=700000, | |
help='number of query list') |
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
package main | |
import ( | |
"fmt" | |
) | |
type IntGenerator struct { | |
Chan chan int | |
n int | |
} |
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
var system = require('system'); | |
var page = require('webpage').create(); | |
page.open(system.args[1], function() | |
{ | |
console.log(page.content); | |
phantom.exit(); | |
}); |
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
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
URL list
$ head choose_ftp.txt
ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/000/015/405/GCA_000015405.1_ASM1540v1
ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/000/620/625/GCA_000620625.1_ASM62062v1
ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/000/972/925/GCA_000972925.1_ASM97292v1
ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/001/021/385/GCA_001021385.1_ASM102138v1
ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/000/328/565/GCA_000328565.1_ASM32856v1
Target files
OlderNewer