Skip to content
This repository has been archived by the owner on Nov 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #34 from satta/work
Browse files Browse the repository at this point in the history
Latest work
  • Loading branch information
bewt85 committed Nov 16, 2015
2 parents 8c584ba + 5fab9c2 commit 38ae701
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
data/** linguist-vendored
RATT/** linguist-vendored
ABACAS2/** linguist-vendored
example-data/** linguist-vendored
*.nf linguist-language=Groovy
5 changes: 3 additions & 2 deletions annot.nf
Original file line number Diff line number Diff line change
Expand Up @@ -1356,16 +1356,17 @@ process make_report {
input:
set file('pseudo.fasta.gz'), file('scaf.fasta.gz') from report_inseq
set file('pseudo.gff3'), file('scaf.gff3') from report_gff3
val params.SPECK_TEMPLATE
val specfile

output:
set file('pseudo.report.html'), file('scaf.report.html') into report_output

"""
gt speck -specfile ${specfile} -matchdescstart -seqfile pseudo.fasta.gz \
-provideindex -typecheck so -output html pseudo.gff3 > pseudo.report.html
-provideindex -typecheck so -output "${params.SPECK_TEMPLATE}" pseudo.gff3 > pseudo.report.html
gt speck -specfile ${specfile} -matchdescstart -seqfile scaf.fasta.gz \
-provideindex -typecheck so -output html scaf.gff3 > scaf.report.html
-provideindex -typecheck so -output "${params.SPECK_TEMPLATE}" scaf.gff3 > scaf.report.html
"""
}

Expand Down
2 changes: 1 addition & 1 deletion bin/infernal_to_gff3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-- TODO: make this dynamic
models = {}
models.rRNA = {"SSU_rRNA_eukarya","5S_rRNA", "5_8S_rRNA"}
models.snRNA = {"U2", "U6"}
models.snRNA = {"U1", "U2", "U4", "U5", "U6"}
models.snoRNA = {"snoTBR5", "snoTBR17", "snoTBR7"}

package.path = gt.script_dir .. "/?.lua;" .. package.path
Expand Down
2 changes: 1 addition & 1 deletion bin/pseudo_merge_with_genes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function stream:process_current_cluster()
io.stderr:write("partial alignment ".. tostring(best) ..
" ignored as it is not degenerated\n")
end
table.insert(self.outqueue, deep_copy(best, nil, to_gene))
table.insert(self.outqueue, deep_copy(best, nil))
end
end
elseif #genes == 1 then
Expand Down
104 changes: 104 additions & 0 deletions data/speck/companion_html
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
--[[
This is an output template for Companion web HTML output.
]]

function valorzero(val)
if val > 0 then
return val
else
return ''
end
end

-- XXX improve performance
function make_popover_content(aspect_details)
local rval = ""
for n, node in ipairs(aspect_details.nodes) do
rval = rval .. ' ' .. node.ID
end
return rval
end

function print_aspects(ftype, aspects)
local str = ""
local first = true
local aspcnt = 0
local i = 0
for aspect, aspect_details in pairs(aspects) do
aspcnt = aspcnt + 1
end
for aspect, aspect_details in pairs(aspects) do
if aspect_details.failures > 0 or aspect_details.runtime_errors > 0 then
str = "fail"
else
str = "ok"
end

template_print('<tr>')
if first then
template_print('<td rowspan=' .. aspcnt .. '><i>' .. ftype .. '</i></td>')
first = false
end

template_print('<td>' .. aspect .. '</td><td class="text-success">')
template_print(valorzero(aspect_details.successes))
template_print('</td><td>')
if aspect_details.failures > 0 then
template_print('<a class="label label-danger" data-toggle="popover" title="Failed items" data-placement="left" data-content="' .. make_popover_content(aspect_details) .. '">')
end
template_print(valorzero(aspect_details.failures))
if aspect_details.failures > 0 then
template_print('</a>')
end
template_print('</td><td>')
if aspect_details.runtime_errors > 0 then
template_print('<a class="label label-danger" data-toggle="popover" title="Errored items" data-placement="left" data-content="' .. make_popover_content(aspect_details) .. '">')
end
template_print(valorzero(aspect_details.runtime_errors))
if aspect_details.runtime_errors > 0 then
template_print('</a>')
end
template_print('</td></tr>')
i = i + 1
end
end

template_print([[<i class="glyphicon glyphicon-ok" aria-hidden="true"></i> = confirmed aspects &emsp; <i class="glyphicon glyphicon-warning-sign" aria-hidden="true"></i> = aspect violations &emsp; <i class="glyphicon glyphicon-fire" aria-hidden="true"></i> = runtime errors while checking]])

template_print("<h3>Features</h3>")
template_print([[<table class="table table-striped table-condensed" style="border-collapse:collapse;">
<thead>
<tr>
<th>type</td>
<th>aspect</th>
<th><i class="glyphicon glyphicon-ok" aria-hidden="true"></i></th>
<th><i class="glyphicon glyphicon-warning-sign" aria-hidden="true"></i></th>
<th><i class="glyphicon glyphicon-fire" aria-hidden="true"></i></th>
</tr>
</thead>
<tbody>]])
for feature, aspects in pairs(features) do
local str
for aspect, aspect_details in pairs(aspects) do
if aspect_details.failures > 0 or aspect_details.runtime_errors > 0 then
str = "fail"
break
else
str = "ok"
end
end
print_aspects(feature, aspects)
end
template_print("</tbody></table>\n")

if #warnings > 0 then
template_print("<h3>Warnings</h3>")
template_print("<ul>\n")
for _, msg in ipairs(warnings) do
template_print("<li>" .. msg .. "</li>\n")
end
template_print("</ul>\n")
template_print("</div></li>\n")

template_print("</ul>\n")
end
19 changes: 16 additions & 3 deletions data/speck/output_check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,36 @@ end
==== ]]

describe.feature("gene", function(gene)
local valid_child_types = {"mRNA","tRNA","rRNA","snoRNA","snRNA", "scRNA",
"lncRNA", "ncRNA", "promoter"}

does_not_cross_a_contig_boundary(gene)

it("has only allowed child types", function()
for f in gene:direct_children() do
expect({"mRNA","tRNA","rRNA","snoRNA","snRNA", "scRNA",
"lncRNA", "ncRNA", "promoter"}).should_contain(f:get_type())
expect(valid_child_types).should_contain(f:get_type())
end
end)

it("has at least one valid child", function()
local has_child = false
for f in gene:direct_children() do
if not has_child and table.contains(valid_child_types, f:get_type()) then
has_child = true
break
end
end
expect(has_child).should_be(true)
end)

it("only contains allowed attributes", function()
for k,_ in gene:attribute_pairs() do
expect({"ID", "Name", "comment", "Note", "End_range",
"Start_range", "Dbxref", "controlled_curation",
"previous_systematic_id", "fiveEndPartial", "threeEndPartial",
"literature", "synonym", "eupathdb_uc",
"internalGap", "ratt_ortholog"}).should_contain(k)
"internalGap", "ratt_ortholog", "original_prot_length",
"Target", "has_internal_stop", "has_frameshift"}).should_contain(k)
end
end)

Expand Down
3 changes: 3 additions & 0 deletions params_default.config
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ params {
// Weight description file for kinetoplastids
WEIGHT_FILE = "${baseDir}/data/weight/weight_kinetoplastid.lua"

// Template for spec check output
SPECK_TEMPLATE = "html"

// Transcript (e.g. RNA-seq) evidence file to use for hints generation
// (GTF as produced by cufflinks/cuffmerge/...)
//TRANSCRIPT_FILE = ""
Expand Down

0 comments on commit 38ae701

Please sign in to comment.