Skip to content

Commit

Permalink
Updating jinja template
Browse files Browse the repository at this point in the history
  • Loading branch information
marchoeppner committed Oct 28, 2024
1 parent 893c336 commit 2005645
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
5 changes: 2 additions & 3 deletions assets/gabi_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,13 @@ <h2>Assembly metrics</h2>
<table>
<tr>
<th scope="col">Sample</th>
<th scope="col">Assembly size</th>
<th scope="col">Assembly size (Mb)</th>
<th scope="col">Fraction of reference</th>
<th scope="col">Ns per 100kb</th>
<th scope="col">Largest contig</th>
<th scope="col">Largest contig (Kb)</th>
<th scope="col">Misassembled contigs</th>
<th scope="col">Contigs > 5kb</th>
<th scope="col">Size (Mb) in contigs > 5kb</th>

</tr>

{% for row in summary %}
Expand Down
19 changes: 8 additions & 11 deletions bin/gabi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

parser = argparse.ArgumentParser(description="Script options")
parser.add_argument("--input", help="An input option")
parser.add_argument("--references", help="Reference values for various taxa")
parser.add_argument("--template", help="A JINJA2 template")
parser.add_argument("--output")
args = parser.parse_args()
Expand All @@ -23,9 +24,9 @@
references = {
"genomes" : {
"Escherichia coli": {
"size": 4.8,
"size": 5.0,
"max_contigs": 500,
"n50": 200
"n50": 80
},
"Listeria monocytogenes": {
"size": 2.9,
Expand Down Expand Up @@ -87,11 +88,12 @@

def main(yaml, template, output):

# Read all the JSON files we see in this folder
json_files = [pos_json for pos_json in os.listdir('.') if pos_json.endswith('.json')]
json_files.sort()

data = {}
data["summary"] = [ ]
data["summary"] = []

samples = []

Expand Down Expand Up @@ -148,15 +150,10 @@ def main(yaml, template, output):
if taxon_perc >= 80.0:
taxon_status = status["pass"]
elif taxon_perc >= 60.0:
taxon_status = status["warn"]
if (this_status == status["pass"]):
this_status = status["warn"]
taxon_status = status["warn"]
else:
taxon_status = status["fail"]
# probably not an outright fail for the whole analysis
if (this_status == status["pass"]):
this_status = status["warn"]


taxon_count = 0
taxon_count_status = status["pass"]

Expand Down Expand Up @@ -218,7 +215,7 @@ def main(yaml, template, output):
quast["duplication"] = jdata["quast"]["Duplication ratio"]
quast["N"] = jdata["quast"]["# N's per 100 kbp"]
quast["mismatches"] = jdata["quast"]["# mismatches per 100 kbp"]
quast["largest_contig"] = jdata["quast"]["Largest contig"]
quast["largest_contig"] = round((int(jdata["quast"]["Largest contig"])/1000),2)
quast["misassembled"] = jdata["quast"]["# misassembled contigs"]
quast["contigs_5k"] = jdata["quast"]["# contigs (>= 5000 bp)"]
quast["size_5k"] = round(float(int(jdata["quast"]["Total length (>= 5000 bp)"])/1000000),2)
Expand Down
4 changes: 3 additions & 1 deletion subworkflows/mlst/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ workflow MLST_TYPING {
meta.db_name = m.db_name
tuple(meta, a, d)
}.groupTuple(by: [0, 2])
.filter { m, a, d -> a.size() > 2 }
.set { ch_assemblies_chewie_grouped }

ch_assemblies_chewie_grouped.filter { m, a, d -> (a.size() > 2) }
.set { ch_assemblies_chewie_call }

CHEWBBACA_ALLELECALL(
Expand Down

0 comments on commit 2005645

Please sign in to comment.