-
Completing a TreeBioinformatics/Rosalind 2019. 6. 17. 23:37
http://rosalind.info/problems/tree/ ROSALIND | Completing a Tree It appears that your browser has JavaScript disabled. Rosalind requires your browser to be JavaScript enabled. Completing a Tree solved by 2689 2012년 7월 11일 12:00:00 오전 by Rosalind Team Topics: Graph Algorithms, Phylogeny The Tree of Life Figure 1. A phylo rosalind.info adjacency list를 입력으로 주고 그 리스트들을 하나의 tree로 만들려면 몇개의 최소 edge가 필요..
-
대한민국 넷페미사 1 - 총체적 난국의 시작잡담 2019. 6. 16. 20:00
얼마전에 뇌종양 수술을 받았다. 정말 위험한 수술이었고 약간의 후유증은 남았지만 큰 후유증은 남지 않았다. 입원한동안 정말 힘들었다. 몸은 생각대로 잘 움직여주지 않았고 입원생활은 너무 심심했다. 환상을 보고 망상에 시달리기도 했다. 그 와중에 정말 힘이 되어준 책이 바로 이 '대한민국 넷페미사'였다. 나는 전부터 페미니스트들이 이해가 되지 않았다. 인터넷상에서도 토론(키배)를 하다보면 도저히 얘기가 통하지 않았고 돌아오는 말은 조롱, 인신공격, 공부좀 해라였다. 전에 지나가듯 한번 보았던 넷페미사가 리디 셀렉트에 있길래 입원생활이 심심하기도 했고 공부해보라길래 다운받아서 보았다. 책은 권김현영, 손희정, 박은하, 이민경 이렇게 네명의 페미니스트들이 돌아가면서 강연한것을 묶은 형식으로 돼있다. 일단 여성..
-
Genome Assembly as Shortest SuperstringBioinformatics/Rosalind 2019. 6. 13. 22:39
http://rosalind.info/problems/long/ Bioinformatics contest 2019의 Final Round의 4번문제인 Minimal Genom이 생각나는 문제였다. Dynamic을 쓸 수 있을것 같아 보이지만 그렇지 않다. 선택이나 그런게 아닌 모든 경우의 수를 생각해야하는 np complete 문제이기 때문이다. from util.read import read_fasta def weld_seq(seq1, seq2): for weld_len in reversed(range(min(len(seq1), len(seq2)))): if seq1[-weld_len:] == seq2[0: weld_len]: return seq1 + seq2[weld_len:] return seq1 ..
-
Independent AllelesBioinformatics/Rosalind 2019. 6. 8. 15:04
http://rosalind.info/problems/lia/ from itertools import combinations from functools import reduce from math import factorial with open('rosalind_lia.txt') as f: data= list(map(lambda x: int(x), f.read().strip().split(' '))) def combi(n, r): return int(factorial(n) / factorial(r) / factorial(n - r)) AaBb_prob= 0.25 total = 2 ** data[0] # result = reduce(lambda a, b: a+b, map(lambda x: len(list(c..
-
Qualification Round. Problem 3 Introns DetectionBioinformatics/Bioinformatics Contest 2017 2019. 4. 4. 23:30
DNA원본과 splicing후 조각들의 read로 exon을 재조합하는 문제이다. exon1 - intron1 - exon2 - intron2 - exon3 - intron3 이고 exon1 - exon2 exon2 - exon3 이런식으로 주어지면 exon1 - exon2 - exon3을 구하면 되는것이다. 간단하게 말하자면 원본 DNA seq에서 임의의 seq를 제거해 주어진 exon들을 모두 포함하는 새로운 sequence를 만들면 된다. 가장 단순하게 생각해보면 DNA seq에서 모든 base들을 하나씩 포함하거나 제외하면서 만든 seq가 exon들을 전부 포함하는지 보면 된다. base별로 포함/미포함 조합을 가지고 있으므로 길이 l인 sequence의 모든 조합만 구하는것만으로도 2^l의 복잡..
-
Qualification Round. Problem 2 The Secondary Structure of RNABioinformatics/Bioinformatics Contest 2017 2019. 3. 28. 22:18
RNA sequence를 주고 해당 rna의 모든 염기들이 쌍을 이루는 secondary structure를 형성할수있는지를 묻는 문제이다. 괄호문제랑 사실상 똑같다. Stack에 염기를 하나씩 넣으면서 넣기직전에 stack의 제일 위에있는 염기와 넣을 염기가 쌍을 이루면 제일 위의 염기를 pop하면 된다. 아니면 push한다. from functools import reduce input = input() # with open('6') as f: # input = f.read().strip() combine = {'A': 'U', 'U': 'A', 'C': 'G', 'G': 'C'} pair_stack = [] for base in input: if len(pair_stack) == 0: pair_st..
-
Qualification Round. Problem 1 Chemical ReactionsBioinformatics/Bioinformatics Contest 2017 2019. 3. 23. 23:41
화학 반응식과 초기 substrate로 최종적으로 생성되는 물질들을 구하는 문제이다. from functools import reduce import sys input = [] for line in sys.stdin: input.append(line.strip()) # with open('2') as f: # input = f.read().strip().split('\n') chemicals = set(input[0].split(' ')) reactions = list(map(lambda reaction: list(map(lambda side: side.split('+'), reaction.split('->'))), input[1:])) num_chemicals = len(chemicals) while ..
-
S-H-ESD를 node로 포팅CS 2019. 3. 14. 22:38
회사에서 사용하는 다차원분석툴에 abnormal detection을 넣어보면 어떨까 생각을 했다. 여러 서비스들을 한번에 보는 툴이기 때문에 각 서비스별로 패턴이 다르고 다차원분석을 해야하기 때문에 deep learning을 통한 abnormal detection을 하기엔 여러가지 문제점이 있었다. abnormal detection을 찾아보던중 twitter에서 만든 s-h-esd가 눈에 들어왔다. https://h3imdallr.github.io/2017-06-20/anomaly_detection/ 이상탐지 Anomaly Detection 시계열 이상탐지 중심으로 time series anomaly detection h3imdallr.github.io 사내에서 사용하는 다차원분석툴은 node로 만들어져..