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


Thursday, March 29th, 2012 at 1:55:07am UTC 

  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
  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
  14. def main():
  15.     txtfile1 = open(argv[1],"r")
  16.     txtfile2 = open(argv[2],"r")
  17.     txt1 =
  18.     txt2 =
  19.     txtfile1.close()
  20.     txtfile2.close()
  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")
  36. if __name__ == "__main__":
  37.     main()


Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)

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