Documentation, examples, tutorials and more

<<

parse_gff

Parses a GFF file and returns a reference to an array containing Smash::Utils::GFF::Feature object. Normally called as

        my $gff = parse_gff($file);
        foreach my $feature (@$gff) {
                # do something on $feature
        }

but can also be called with an additional group field. Passing group field will make this function group the locations of multiple features with the same value for group field. For example,

my $gff = parse_gff($file, FIELD => "attribute", ATTRIBUTE => "gene_id");

will group all CDS features belonging to the same gene. Beware that it only groups the locations by making the locations attribute into an array of all the locations from the ungrouped features. It does not check if the other fields are the same, that responsibility lies with the caller. For example, if there are two unrelated genes with the same value for the "gene" attribute, they will be grouped as though they were the same entity.

<<