Created
November 5, 2013 16:18
-
-
Save danmaclean/7321562 to your computer and use it in GitHub Desktop.
irb session using Bio::GFF::GFF3::Record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> require 'bio' | |
=> true | |
irb(main):002:0> r = Bio::GFF::GFF3.new() | |
=> #<Bio::GFF::GFF3:0x007ff22b911ea8 @gff_version=nil, @records=[], @sequence_regions=[], @metadata=[], @sequences=[], @in_fasta=false> | |
irb(main):003:0> r = Bio::GFF::GFF3::Record.new() | |
=> #<Bio::GFF::GFF3::Record:0x007ff22c104728 @seqname=nil, @source=nil, @feature=nil, @score=nil, @strand=nil, @attributes=[], @start=nil, @end=nil, @frame=nil> | |
irb(main):004:0> r.seqname = "meh" | |
=> "meh" | |
irb(main):005:0> r | |
=> #<Bio::GFF::GFF3::Record:0x007ff22c104728 @seqname="meh", @source=nil, @feature=nil, @score=nil, @strand=nil, @attributes=[], @start=nil, @end=nil, @frame=nil> | |
irb(main):006:0> r.seqname | |
=> "meh" | |
irb(main):007:0> r.attributes.class | |
=> Array | |
irb(main):008:0> r.attributes.length | |
=> 0 | |
irb(main):009:0> r.attributes << ["ID", "CHAL0001"] | |
=> [["ID", "CHAL0001"]] | |
irb(main):010:0> r.attributes << ["GO", "0001"] | |
=> [["ID", "CHAL0001"], ["GO", "0001"]] | |
irb(main):011:0> r.attributes << ["Desc", "actin"] | |
=> [["ID", "CHAL0001"], ["GO", "0001"], ["Desc", "actin"]] | |
irb(main):012:0> r.to_s | |
=> "meh\t.\t.\t.\t.\t.\t.\t.\tID=CHAL0001;GO=0001;Desc=actin\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment