bin/gff3-fetch in bio-gff3-0.8.3 vs bin/gff3-fetch in bio-gff3-0.8.4

- old
+ new

@@ -24,11 +24,11 @@ type is any valid type in the GFF3 definition. For example: mRNA : assemble mRNA CDS : assemble CDS exon : list all exons - gene/ORF : list gene ORFs -- NYI + gene|ORF : list gene ORFs other : use any type from GFF3 definition, e.g. 'Terminate' -- NYI and the following performance options: --cache full : load all in RAM (fast) @@ -165,12 +165,10 @@ } opts.parse!(ARGV) gfftype = ARGV.shift -raise "Unknown GFF type '#{gfftype}'" if gfftype !~ /mrna|cds|exon/i - fastafn = nil ARGV.each do | fn | if File.extname(fn) =~ /fa|fas|fasta$/i raise "Only one fasta file allowed per GFF3" if fastafn != nil @@ -187,11 +185,19 @@ opts[:fix] = options.fix gffdb = Bio::GFFbrowser::GFFdb.new(fn,opts) gff = gffdb.assembler writer = Bio::GFFbrowser::FastaWriter.new(options.translate, options.validate) case gfftype.downcase - when 'mrna' + when 'gene' + gff.each_gene_seq do | id, seq | + writer.put(id,seq) + end + when 'orf' + gff.each_gene_seq do | id, seq | + writer.put(id,seq) + end + when 'mrna' gff.each_mRNA_seq do | id, seq | writer.put(id,seq) end when 'exon' gff.each_exon_seq do | id, seq | @@ -200,10 +206,10 @@ when 'cds' gff.each_CDS_seq do | id, seq | writer.put(id,seq) end else - raise "Unknown action <#{gfftype}>" + raise "Unknown action on type <#{gfftype}>" end fastafn = nil end