Class: Bio::GFFbrowser::Digest::InMemory
- Inherits:
-
Object
- Object
- Bio::GFFbrowser::Digest::InMemory
- Includes:
- Parser, Gff3Sequence
- Defined in:
- lib/bio/db/gff/gffinmemory.rb
Instance Attribute Summary collapse
-
#sequencelist ⇒ Object
readonly
Returns the value of attribute sequencelist.
Instance Method Summary collapse
- #each_item(list) ⇒ Object
-
#initialize(filename, options) ⇒ InMemory
constructor
A new instance of InMemory.
-
#parse ⇒ Object
Digest mRNA from the GFFdb and store in Hash Next yield(id, seq) from Hash.
Methods included from Parser
#each_CDS, #each_CDS_seq, #each_exon, #each_exon_seq, #each_mRNA, #each_mRNA_seq, #read_fasta, #show_unrecognized_features, #store_record, #validate_cdss, #validate_mrnas
Methods included from Helpers::Error
Constructor Details
Instance Attribute Details
#sequencelist ⇒ Object (readonly)
Returns the value of attribute sequencelist.
18 19 20 |
# File 'lib/bio/db/gff/gffinmemory.rb', line 18 def sequencelist @sequencelist end |
Instance Method Details
#each_item(list) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/bio/db/gff/gffinmemory.rb', line 52 def each_item list list.each do | id, recs | seqid = recs[0].seqname component = find_component(recs[0]) yield id, recs, component end end |
#parse ⇒ Object
Digest mRNA from the GFFdb and store in Hash Next yield(id, seq) from Hash
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/bio/db/gff/gffinmemory.rb', line 28 def parse info "---- Digest DB and store data in mRNA Hash" @count_ids = Counter.new # Count ids @count_seqnames = Counter.new # Count seqnames @componentlist = {} # Store containers, like genes, contigs @mrnalist = LinkedRecs.new # Store linked mRNA records @cdslist = LinkedRecs.new @exonlist = LinkedRecs.new @sequencelist = {} @unrecognized_features = {} @gff.records.each do | rec | store_record(rec) end @gff.sequences.each do | bioseq | id = bioseq.entry_id @sequencelist[id] = bioseq.to_s # in Bio::Sequence with contained Bio::FastaFormat end validate_mrnas validate_cdss show_unrecognized_features @genelist = @count_ids.keys read_fasta end |