def df_representative_sequences(self):
        """DataFrame: Pandas DataFrame of representative sequence information per protein."""

        seq_mapping_pre_df = []
        df_cols = ['gene', 'uniprot', 'kegg', 'num_pdbs', 'pdbs', 'seq_len', 'sequence_file', 'metadata_file']

        for g in self.genes_with_a_representative_sequence:
            gene_dict = g.protein.representative_sequence.get_dict(df_format=True, only_attributes=df_cols)
            gene_dict['gene'] = g.id
            seq_mapping_pre_df.append(gene_dict)

        df = pd.DataFrame.from_records(seq_mapping_pre_df, columns=df_cols).set_index('gene')
        if df.empty:
            log.warning('Empty dataframe')
            return df
        else:
            return ssbio.utils.clean_df(df)
def df_representative_sequences ( self ) : seq_mapping_pre_df = [ ] df_cols = [ 'gene' , 'uniprot' , 'kegg' , 'num_pdbs' , 'pdbs' , 'seq_len' , 'sequence_file' , 'metadata_file' ] for g in self . genes_with_a_representative_sequence : gene_dict = g . protein . representative_sequence . get_dict ( df_format = True , only_attributes = df_cols ) gene_dict [ 'gene' ] = g . id seq_mapping_pre_df . append ( gene_dict ) df = pd . DataFrame . from_records ( seq_mapping_pre_df , columns = df_cols ) . set_index ( 'gene' ) if df . empty : log . warning ( 'Empty dataframe' ) return df else : return ssbio . utils . clean_df ( df )
DataFrame: Pandas DataFrame of representative sequence information per protein.