<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dataframes_to_variant_collection( dataframes, source_path, info_parser=None, only_passing=True, max_variants=None, sample_names=None, sample_info_parser=None, variant_kwargs={}, variant_collection_kwargs={}):
 """ Load a VariantCollection from an iterable of pandas dataframes. This takes an iterable of dataframes instead of a single dataframe to avoid having to load huge dataframes at once into memory. If you have a single dataframe, just pass it in a single-element list. Parameters dataframes Iterable of dataframes (e.g. a generator). Expected columns are: ["CHROM", "POS", "ID", "REF", "ALT", "QUAL", "FILTER"] and 'INFO' if `info_parser` is not Null. Columns must be in this order. source_path : str Path of VCF file from which DataFrame chunks were generated. info_parser : string -> object, optional Callable to parse INFO strings. only_passing : boolean, optional If true, any entries whose FILTER field is not one of "." or "PASS" is dropped. max_variants : int, optional If specified, return only the first max_variants variants. sample_names : list of strings, optional Sample names. The final columns of the dataframe should match these. If specified, the per-sample info columns will be parsed. You must also specify sample_info_parser. sample_info_parser : string list * string -> dict, optional Callable to parse per-sample info columns. variant_kwargs : dict, optional Additional keyword paramters to pass to Variant.__init__ variant_collection_kwargs : dict, optional Additional keyword parameters to pass to VariantCollection.__init__. """


    expected_columns = (
        ["CHROM", "POS", "ID", "REF", "ALT", "QUAL", "FILTER"] +
        (["INFO"] if info_parser else []))

    if info_parser and sample_names:
        if sample_info_parser is None:
            raise TypeError(
                "Must specify sample_info_parser if specifying sample_names")
        expected_columns.append("FORMAT")
        expected_columns.extend(sample_names)

    variants = []
    metadata = {}
    try:
        for chunk in dataframes:
            assert chunk.columns.tolist() == expected_columns,\
                "dataframe columns (%s) do not match expected columns (%s)" % (
                    chunk.columns, expected_columns)

            for tpl in chunk.itertuples():
                (i, chrom, pos, id_, ref, alts, qual, flter) = tpl[:8]
                if flter == ".":
                    flter = None
                elif flter == "PASS":
                    flter = []
                elif only_passing:
                    continue
                else:
                    flter = flter.split(';')
                if id_ == ".":
                    id_ = None
                qual = float(qual) if qual != "." else None
                alt_num = 0
                info = sample_info = None
                for alt in alts.split(","):
                    if alt != ".":
                        if info_parser is not None and info is None:
                            info = info_parser(tpl[8])  # INFO column
                            if sample_names:
                                # Sample name -> field -> value dict.
                                sample_info = sample_info_parser(
                                    list(tpl[10:]),  # sample info columns
                                    tpl[9],    # FORMAT column
                                )

                        variant = Variant(
                            chrom,
                            int(pos),  # want a Python int not numpy.int64
                            ref,
                            alt,
                            **variant_kwargs)
                        variants.append(variant)
                        metadata[variant] = {
                            'id': id_,
                            'qual': qual,
                            'filter': flter,
                            'info': info,
                            'sample_info': sample_info,
                            'alt_allele_index': alt_num,
                        }
                        if max_variants and len(variants) > max_variants:
                            raise StopIteration
                    alt_num += 1
    except StopIteration:
        pass

    return VariantCollection(
        variants=variants,
        source_to_metadata_dict={source_path: metadata},
        **variant_collection_kwargs)