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
def is_valid_fastq(lines): | |
start = lines[0].startswith('@') | |
middle = lines[2].startswith('+') | |
length = len(lines[1]) == len(lines[3]) | |
return all([start, middle, length]) | |
def FastqIterator(file): | |
lines = [file.next(), file.next(), file.next()] | |
for line in file: | |
lines.append(line) |
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 unittest | |
class 유형: | |
def __init__(자기, *인수, **키워드인수): | |
자기.생성될때(*인수, **키워드인수) | |
class 시험사례(unittest.TestCase): | |
같아야함 = unittest.TestCase.assertEquals | |
class 배열(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
import unittest | |
from math import pi, degrees | |
def get_hour_angle(hour, minute=0): | |
angle = (hour / 6.) * pi | |
minute_angle = get_minute_angle(minute) / 12 | |
return angle + minute_angle | |
def get_minute_angle(minute): | |
angle = (minute / 30.) * pi |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# -*- coding:utf-8 -*- | |
""" | |
GEO file downloader | |
Requirements | |
* beautifulsoup4 (pip install lxml beautifulsoup4) | |
* wget | |
Usage | |
1. get CSV file in the GEO browse page. |
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 multiprocessing | |
import pandas as pd | |
import numpy as np | |
def _apply_df(args): | |
df, func, kwargs = args | |
return df.apply(func, **kwargs) | |
def apply_by_multiprocessing(df, func, **kwargs): | |
workers = kwargs.pop('workers') |
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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:9299994bc33725ce2fb54720efc2a7b1a7fb1e955d3914b9e8ba9de6a50bd456" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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 pandas as pd | |
from subprocess import Popen, PIPE | |
def len_fasta(filename): | |
p1 = Popen(['cat', filename], stdout=PIPE, stderr=PIPE) | |
p2 = Popen(['grep', '>'], stdin=p1.stdout, stdout=PIPE, stderr=PIPE) | |
p3 = Popen(['wc', '-l'], stdin=p2.stdout, stdout=PIPE, stderr=PIPE) | |
result, err = p3.communicate() | |
if p3.returncode != 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
""" | |
It's for counting biological_process terms which have is_a and part_of. | |
Usage: | |
$ wget http://purl.obolibrary.org/obo/go.obo | |
$ python3 go_term_stat.py < go.obo | |
Main data structure |
OlderNewer