9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/gene_assembler/gff_contig.rb', line 9
def report(contig,seqid,parent,name_mode)
features_parent=nil
seq=nil
if !parent.nil? seqid=parent if !contig.seq.nil? seq=contig.seq
end
end
parent_hit=nil
contig_text=[]
if parent.nil? parent_hit=contig.name
text="#{seqid}\tunknown\t#{contig.type}\t1\t#{contig.length}\t.\t+\t.\tID=#{contig.name};Name=#{contig.name}"
contig_text << text
end
gff_hit=GffHit.new
contig.each_hit{|hit|
text,features_parent= gff_hit.report(hit, parent_hit, seqid, contig.name, name_mode, seq) contig_text << text
}
gff_frameshift=GffFrameshift.new
contig.each_q_frameshift{|fs|
contig_text << gff_frameshift.report(fs,features_parent,seqid)
}
gff_stop=GffStop.new
contig.each_stop{|stop|
contig_text << gff_stop.report(stop,features_parent,seqid)
}
gff_snp=GffSNP.new
contig.each_snp_with_index{|snp,n|
contig_text << gff_snp.report(snp, features_parent, seqid,n)
}
gff_go=GffGo.new
contig.each_go{|go|
contig_text << gff_go.report(go, features_parent, seqid)
}
gff_localization=Localization.new
contig.each_localization_with_index{|localization,n|
contig_text << gff_localization.report(localization,features_parent, seqid, contig, n)
}
return contig_text
end
|