5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

bioinfoの競技プログラミングRosalindoを解いてみた

Posted at

概要

 最近、ちょこちょこ競技プログラミング(Atcoder)を解いているのですが、自分の専門により近いのがあれば、もっと楽しいし、やっている時の罪悪感がないのではと思い、bioinfoの競技プログラミングを探していました。

 ということでググっってみたのですが、やはり競技プログラミングっぽいものはあまりなくて、以下の2つしか見当たらなかった
 

Bioinformatics Contest

Bioinformatics Institute
というNPOが1年に一回開催しているもの(今年は2月(例年?)でもう終わっている)

競技プログラミングっぽいけど、入賞者を見ると僕でも論文を何本も読んだことのある人がいてびっくり(学生以外のプロも参加してそう)

Rosalind  

2012年ぐらいからあるbioinfoの競技プログラミングサイト

問題数があまり多くないっぽいのと、定期的にコンテストが開催されるわけではなく、project Eulerのバイオ特化みたいな感じなので、バイオの人が触れてみる価値はありそう。

Reddit のポスト を見ると、Rosallingはアルゴリズムに偏っているので実の解析を学びたいならBioconductorやDatacampの解析を学ぶと良いが、アルゴリズムが好きな人や、興味を持つにはベストな方法ではないかと書いている。

注意点として、回答のコードを他の場所(例えばQiitaとかブログとか)に投稿してはいけないというルールがある。
(以下公式のQAから)

Can I post my solutions somewhere?
No. The goal of Rosalind is to facilitate learning through problem solving. We encourage you to search the Internet or communicate with each other to find the best algorithms to solve our problem. However, there is a difference between looking for inspiration and copy-pasting someone else's code; we strongly advise you not to use others' source code. Once you have solved a problem, then we encourage you to post your code to the problem's comments section (which can be seen only by users who have also solved the problem). However, please do not publish your code outside of the Rosalind website.

国籍とスコアの表
を見ると319点がマックス?
日本人でも登録している人は100人ぐらいいるけど、今やっている人はほとんどいなさそう笑

2012年の黎明期にやっていた人のブログ
にファイルの操作などのtipsが載っている。

実際にやってみた上でのtips

  • ファイルをダウンロードし、そのファイルを入力とした時の回答をファイルか、直打ちで提出する方式
  • 問題によってはダウンロードから提出まで1minしかないので、ダウンロードまでにコード書いたり、デバッグも終わらせとく必要がある(以外に1minは短い)
  • ファイルを開いて入力を確認するのはめんどくさいので、https://qiita.com/taashi/items/07bf75201a074e208ae5 を参考にしてpythonでファイル名を引数にとって展開する方法を学んだ
  • また、提出も高速化しないと間に合わないのでpython complemnt_seq.py test.txt のようにコピペも最速化する。(ファイルを作ってもいいがこっちの方が早そう)

入力例

in_out.py

# !/use/bin/env python
# count ACGT occurance
import sys
import re
def ans(filename):
    with open(filename,"rU") as f:
        s = f.readline().split() # read 1 line
        print(ans)
if __name__ == '__main__':
    args = sys.argv
    ans(args[1])

感想

まだ簡単なのしかやっていない(Rosallindoはtree 形式とやらをとっていて、特定の系列に対してある問題をとかないと、次の問題を解くことができない)だが、やはり馴染みの深い分野だと、アルゴリズムとか全然なくても楽しい。
 
 まだ問題としては、塩基配列を受け取り、ACGTの頻度を返す、RNAの配列にする(T->U への変換)、逆相補鎖を返すなど、単純な(pythonの文字列の扱いになれる程度の)問題しかやっていないが、他の人の回答をみることができ、色々と学びになる。

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?