Mercurial > repos > rnateam > rnacommender
comparison rbpfeatures.py @ 4:a609d6dc8047 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/rna_commander/tools/rna_tools/rna_commender commit 7ad344d108076116e702e1c1e91cea73d8fcadc4
author | rnateam |
---|---|
date | Thu, 28 Jul 2016 05:55:25 -0400 |
parents | 8918de535391 |
children |
comparison
equal
deleted
inserted
replaced
3:ecf125a1ad73 | 4:a609d6dc8047 |
---|---|
1 """Compute the RBP features.""" | 1 """Compute the RBP features.""" |
2 | 2 |
3 import re | 3 import re |
4 import sys | |
4 import subprocess as sp | 5 import subprocess as sp |
5 import uuid | 6 import uuid |
6 from os import mkdir | 7 from os import mkdir |
7 from os import listdir | 8 from os import listdir |
8 from os.path import isfile, join | 9 from os.path import isfile, join |
54 """Scan the sequences against the Pfam database.""" | 55 """Scan the sequences against the Pfam database.""" |
55 nf = open(self.pfam_scan, "w") | 56 nf = open(self.pfam_scan, "w") |
56 nf.write(pfam_utils.search_header()) | 57 nf.write(pfam_utils.search_header()) |
57 | 58 |
58 fasta = fasta_utils.import_fasta(self.fasta) | 59 fasta = fasta_utils.import_fasta(self.fasta) |
60 | |
61 if len(fasta) != 1: | |
62 sys.exit("""Fasta file must contain exactly one sequence.""") | |
59 | 63 |
60 for rbp in sorted(fasta.keys()): | 64 for rbp in sorted(fasta.keys()): |
61 seq = fasta[rbp] | 65 seq = fasta[rbp] |
62 text = pfam_utils.sequence_search(rbp, seq) | 66 text = pfam_utils.sequence_search(rbp, seq) |
63 nf.write(text) | 67 nf.write(text) |