Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

誰か
2012年 3月 29日 木曜日 01:55:07 MDT 

  1. #!/usr/bin/python2.7
  2. import string
  3. from sys import *
  4. from Bio import SeqIO
  5. from Bio.Seq import Seq
  6. from Bio.SeqRecord import SeqRecord
  7.  
  8. def stripPunct(astr):
  9.     #For now, only output letters to satisfy EMBOSS
  10.     tmpstr = astr.translate(None, string.digits + string.punctuation + string.whitespace)
  11.     #tmpstr = astr.translate(None, string.whitespace)
  12.     return tmpstr
  13.  
  14. def main():
  15.     txtfile1 = open(argv[1],"r")
  16.     txtfile2 = open(argv[2],"r")
  17.     txt1 = txtfile1.read()
  18.     txt2 = txtfile2.read()
  19.     txtfile1.close()
  20.     txtfile2.close()
  21.  
  22.     txtstrip1 = stripPunct(txt1)
  23.     txtstrip2 = stripPunct(txt2)
  24.     seq1 = Seq(txtstrip1)
  25.     seq2 = Seq(txtstrip2)
  26.     rec1 = SeqRecord(seq1,id="FILE_ONE")
  27.     rec2 = SeqRecord(seq2,id="FILE_TWO")
  28.     out1 = open(".tmp1.fasta", "w")
  29.     out2 = open(".tmp2.fasta", "w")
  30.     SeqIO.write(rec1, out1, "fasta")
  31.     SeqIO.write(rec2, out2, "fasta")
  32.  
  33.    
  34.    
  35.    
  36. if __name__ == "__main__":
  37.     main()

advertising

ポストを更新

このポストは更新できる、または、新しいポストを作成

You may also comment on this post.

ペーストの更新
ポストの詳細 (随意)

注目: ペーストのコンテントだけで必要ですが、以下の情報は便利かも知れません。

名前/タイトルを保存する?

(スペースで切る, 随意)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right