Mercurial > repos > galaxyp > fasta_merge_files_and_filter_unique_sequences
comparison fasta_merge_files_and_filter_unique_sequences.py @ 1:74144834b0bd draft
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/fasta_merge_files_and_filter_unique_sequences commit 9f9eba8df62b4db1ef35718d880a1bcda7457b99
author | galaxyp |
---|---|
date | Fri, 16 Dec 2016 05:19:27 -0500 |
parents | 2904d46167da |
children | 379c41d859aa |
comparison
equal
deleted
inserted
replaced
0:2904d46167da | 1:74144834b0bd |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 import sys,os | 2 import os |
3 import sys | |
3 | 4 |
4 #====================================================================== Classes | |
5 class Sequence: | 5 class Sequence: |
6 ''' Holds protein sequence information ''' | 6 ''' Holds protein sequence information ''' |
7 def __init__(self): | 7 def __init__(self): |
8 self.header = "" | 8 self.header = "" |
9 self.sequence = "" | 9 self.sequence = "" |
54 for protein in fa_reader: | 54 for protein in fa_reader: |
55 if protein.sequence in seen_sequences: | 55 if protein.sequence in seen_sequences: |
56 pass | 56 pass |
57 else: | 57 else: |
58 seen_sequences.add(protein.sequence) | 58 seen_sequences.add(protein.sequence) |
59 | |
60 out_file.write(protein.header) | 59 out_file.write(protein.header) |
61 out_file.write(os.linesep) | 60 out_file.write(os.linesep) |
62 out_file.write(protein.sequence) | 61 out_file.write(protein.sequence) |
63 out_file.write(os.linesep) | 62 out_file.write(os.linesep) |
64 out_file.close() | 63 out_file.close() |