def convert_block_dicts_to_string(self, block_1st2nd, block_1st, block_2nd, block_3rd):
        """Takes into account whether we need to output all codon positions."""
        out = ""
        # We need 1st and 2nd positions
        if self.codon_positions in ['ALL', '1st-2nd']:
            for gene_code, seqs in block_1st2nd.items():
                out += '>{0}_1st-2nd\n----\n'.format(gene_code)
                for seq in seqs:
                    out += seq
        elif self.codon_positions == '1st':
            for gene_code, seqs in block_1st.items():
                out += '>{0}_1st\n----\n'.format(gene_code)
                for seq in seqs:
                    out += seq
        elif self.codon_positions == '2nd':
            for gene_code, seqs in block_2nd.items():
                out += '>{0}_2nd\n----\n'.format(gene_code)
                for seq in seqs:
                    out += seq

        # We also need 3rd positions
        if self.codon_positions in ['ALL', '3rd']:
            for gene_code, seqs in block_3rd.items():
                out += '\n>{0}_3rd\n----\n'.format(gene_code)
                for seq in seqs:
                    out += seq
        return out
def convert_block_dicts_to_string ( self , block_1st2nd , block_1st , block_2nd , block_3rd ) : out = "" if self . codon_positions in [ 'ALL' , '1st-2nd' ] : for gene_code , seqs in block_1st2nd . items ( ) : out += '>{0}_1st-2nd\n----\n' . format ( gene_code ) for seq in seqs : out += seq elif self . codon_positions == '1st' : for gene_code , seqs in block_1st . items ( ) : out += '>{0}_1st\n----\n' . format ( gene_code ) for seq in seqs : out += seq elif self . codon_positions == '2nd' : for gene_code , seqs in block_2nd . items ( ) : out += '>{0}_2nd\n----\n' . format ( gene_code ) for seq in seqs : out += seq if self . codon_positions in [ 'ALL' , '3rd' ] : for gene_code , seqs in block_3rd . items ( ) : out += '\n>{0}_3rd\n----\n' . format ( gene_code ) for seq in seqs : out += seq return out
Takes into account whether we need to output all codon positions.