Sha256: ef536f0dc51b6b426f2acf101d1ea00fdfd6d320a55904a334f8bb27b1fbe47a

Contents?: true

Size: 505 Bytes

Versions: 2

Compression:

Stored size: 505 Bytes

Contents

class GenomerPluginValidate::Validator::Gff3Attributes < Genomer::Plugin

  def valid_gff3_attributes
    %w|ID Name Alias Parent Target Gap Derives_from Note
      Dbxref Ontology_term Is_circular|
  end

  def run
    annotations.
      map{|attn| attn.attributes.map{|(k,v)| [k,attn] }}.
      flatten(1).
      select{|(term,_)| term =~ (/^[A-Z]/) }.
      reject{|(term,_)| valid_gff3_attributes.include? term }.
      map{|(term,attn)| "Illegal GFF3 attribute '#{term}' for '#{attn.id}'"}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
genomer-plugin-validate-0.0.2 lib/genomer-plugin-validate/validator/gff3_attributes.rb
genomer-plugin-validate-0.0.1 lib/genomer-plugin-validate/validator/gff3_attributes.rb