[docs]@staticmethoddefencode_sequence(sequence:ReceptorSequence,params:EncoderParams):""" Encodes a ReceptorSequence based on information from within the ReceptorSequence and SequenceMetadata instances. This allows for looking at frequency for whole sequences, with flexible definition of what a unique whole sequence is. :param sequence: ReceptorSequence :param params: EncoderParams (params["model"]["sequence"] and params["model"]["metadata_fields_to_include"] are used) :return: list with only single feature """res=[]sequence_type=params.model.get('sequence_type',params.sequence_type)ifparams.model.get("sequence",True):res.append(sequence.get_sequence(sequence_type))forfieldinparams.model.get("metadata_fields_to_include",[]):ifsequence.metadataisNone:res.append("unknown")else:res.append(getattr(sequence.metadata,field))return[Constants.FEATURE_DELIMITER.join(res)]