<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def predict_from_variants( self, variants, transcript_expression_dict=None, gene_expression_dict=None):
 """ Predict epitopes from a Variant collection, filtering options, and optional gene and transcript expression data. Parameters variants : varcode.VariantCollection transcript_expression_dict : dict Maps from Ensembl transcript IDs to FPKM expression values. gene_expression_dict : dict, optional Maps from Ensembl gene IDs to FPKM expression values. Returns DataFrame with the following columns: - variant - gene - gene_id - transcript_id - transcript_name - effect - effect_type - peptide - peptide_offset - peptide_length - allele - affinity - percentile_rank - prediction_method_name - contains_mutant_residues - mutation_start_in_peptide - mutation_end_in_peptide Optionall will also include the following columns if corresponding expression dictionary inputs are provided: - gene_expression - transcript_expression """

        # pre-filter variants by checking if any of the genes or
        # transcripts they overlap have sufficient expression.
        # I'm tolerating the redundancy of this code since it's much cheaper
        # to filter a variant *before* trying to predict its impact/effect
        # on the protein sequence.
        variants = apply_variant_expression_filters(
            variants,
            transcript_expression_dict=transcript_expression_dict,
            transcript_expression_threshold=self.min_transcript_expression,
            gene_expression_dict=gene_expression_dict,
            gene_expression_threshold=self.min_gene_expression)

        effects = variants.effects(raise_on_error=self.raise_on_error)

        return self.predict_from_mutation_effects(
            effects=effects,
            transcript_expression_dict=transcript_expression_dict,
            gene_expression_dict=gene_expression_dict)