Module Expr Str Import alias Import alias Import alias identifier Import alias FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad AttributeLoad NameLoad attr For NameStore NameLoad body Assign SubscriptStore NameLoad Slice BinOpSub AttributeLoad NameLoad attr NameLoad BinOpSub AttributeLoad NameLoad attr NameLoad Num For NameStore NameLoad body Assign SubscriptStore NameLoad Slice BinOpSub AttributeLoad NameLoad attr NameLoad BinOpSub AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Num For NameStore NameLoad body If CompareEq NameLoad NameLoad body AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpOr CompareEq Call NameLoad NameLoad Num CompareEq Call NameLoad NameLoad Num body Return TupleLoad Num Num Num Num Assign NameStore Call NameLoad Call NameLoad Lambda arguments args NameParam defaults AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call NameLoad Lambda arguments args NameParam defaults AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call NameLoad Lambda arguments args NameParam defaults AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call NameLoad Lambda arguments args NameParam defaults AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad AttributeLoad NameLoad attr For NameStore SubscriptLoad NameLoad Slice Num body Assign SubscriptStore NameLoad Slice BinOpSub AttributeLoad NameLoad attr NameLoad BinOpSub AttributeLoad NameLoad attr NameLoad Num For NameStore SubscriptLoad NameLoad Slice Num body Assign SubscriptStore NameLoad Slice BinOpSub AttributeLoad NameLoad attr NameLoad BinOpSub AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr BinOpMult ListLoad Num BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Num Assign NameStore Call NameLoad NameLoad Num Assign NameStore Call NameLoad NameLoad Num Assign NameStore Call NameLoad NameLoad Num Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If CompareEq BinOpAdd NameLoad NameLoad Num body Assign NameStore Num orelse Assign NameStore BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad If CompareEq BinOpAdd NameLoad NameLoad Num body Assign NameStore Num orelse Assign NameStore BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore BinOpMult BinOpMult BinOpMult BinOpAdd NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpAdd NameLoad NameLoad If CompareEq NameLoad Num body Return Num orelse Return BinOpDiv BinOpSub BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore ListLoad SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore Num While CompareLt NameLoad NameLoad body If BoolOpOr CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr CompareLt NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body Return TupleLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore Num Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults TupleLoad AttributeLoad NameLoad attr body Expr Str Assign NameStore Dict For NameStore NameLoad body TryExcept body Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Index Num handlers ExceptHandler type NameLoad body Print BinOpMod Str AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Num If CompareNotIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad ListLoad Num Num Dict Dict Assign NameStore SubscriptLoad NameLoad Index NameLoad AugAssignAdd SubscriptStore NameLoad Index Num Num TryExcept body If CompareEq AttributeLoad NameLoad attr Str body AugAssignAdd SubscriptStore NameLoad Index Num Num orelse If CompareIn AttributeLoad NameLoad attr TupleLoad Str Str body For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Index Num If CompareNotIn NameLoad SubscriptLoad NameLoad Index Num body Assign SubscriptStore SubscriptLoad NameLoad Index Num Index NameLoad Num If CompareNotIn NameLoad SubscriptLoad NameLoad Index Num body Assign SubscriptStore SubscriptLoad NameLoad Index Num Index NameLoad Num If Call AttributeLoad NameLoad attr NameLoad NameLoad keyword AttributeLoad NameLoad attr body AugAssignAdd SubscriptStore SubscriptLoad NameLoad Index Num Index NameLoad Num AugAssignAdd SubscriptStore SubscriptLoad NameLoad Index Num Index NameLoad Num orelse If Call AttributeLoad NameLoad attr NameLoad NameLoad keyword AttributeLoad NameLoad attr body AugAssignAdd SubscriptStore SubscriptLoad NameLoad Index Num Index NameLoad Num handlers ExceptHandler type NameLoad body Print Str Call NameLoad NameLoad Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Call NameLoad NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore NameStore NameStore NameLoad If CompareEq NameLoad NameLoad body AugAssignAdd NameStore Num If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad orelse For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body AugAssignAdd NameStore Num If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Break orelse For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body AugAssignAdd NameStore Num If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Break Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword SubscriptLoad Call NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword Num keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq Call NameLoad NameLoad Num body Print NameLoad Print Str Expr Call AttributeLoad NameLoad attr Num Assign TupleStore NameStore NameStore NameLoad If CompareGtE AttributeLoad NameLoad attr Num body Print BinOpMod Str NameLoad Print Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str If CompareGtE AttributeLoad NameLoad attr Num body Print BinOpMod Str Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareGtE AttributeLoad NameLoad attr Num body Print BinOpMod Str NameLoad Print Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str If CompareGtE AttributeLoad NameLoad attr Num body Print BinOpMod Str Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareGtE AttributeLoad NameLoad attr Num body Print BinOpMod Str TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad If CompareGtE AttributeLoad NameLoad attr Num body Print Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Lambda arguments args NameParam NameParam defaults Call NameLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Lambda arguments args NameParam NameParam defaults Call NameLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareGtE AttributeLoad NameLoad attr Num body Print Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad NameLoad attr body Print Str Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str Print Call AttributeLoad Str attr NameLoad Assign TupleStore NameStore NameStore TupleLoad Num Num Assign TupleStore NameStore NameStore TupleLoad Num Num Assign TupleStore NameStore NameStore NameStore NameStore TupleLoad Num Num Num Num While BoolOpAnd CompareLt NameLoad NameLoad CompareLt NameLoad NameLoad body Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr While BoolOpAnd CompareLt NameLoad NameLoad CompareEq AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad CompareEq AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad body AugAssignAdd NameStore Num While BoolOpAnd CompareLt NameLoad NameLoad BoolOpOr CompareNotEq AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad CompareNotEq AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad body AugAssignAdd NameStore Num Assign NameStore NameLoad While BoolOpAnd CompareLt NameLoad NameLoad CompareEq AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad CompareEq AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad body AugAssignAdd NameStore Num Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Slice NameLoad NameLoad SubscriptLoad NameLoad Slice NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Print BinOpMod Str TupleLoad Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Print BinOpMod Str AttributeLoad NameLoad attr Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Print Call AttributeLoad Str attr NameLoad Assign TupleStore NameStore NameStore TupleLoad Num Num Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore NameStore TupleLoad Num Num Num Num Assign TupleStore NameStore NameStore NameStore NameStore TupleLoad Num Num Num Num Assign TupleStore NameStore NameStore NameStore NameStore TupleLoad Num Num Num Num Assign TupleStore NameStore NameStore NameStore NameStore TupleLoad Num Num Num Num Assign TupleStore NameStore NameStore TupleLoad Num Num Assign TupleStore NameStore NameStore TupleLoad Num Num Assign NameStore NameLoad Assign NameStore NameLoad While BoolOpAnd CompareLt NameLoad NameLoad CompareLt NameLoad NameLoad body Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr If CompareEq NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad If CompareEq NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad If CompareGtE AttributeLoad NameLoad attr Num body Print Str For NameStore NameLoad body Print Str Call NameLoad NameLoad For NameStore NameLoad body Print Str Call NameLoad NameLoad Assign NameStore NameLoad If BoolOpAnd CompareLt NameLoad NameLoad BoolOpOr CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body If CompareGtE AttributeLoad NameLoad attr Num body Print Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr While BoolOpOr BoolOpAnd CompareLt NameLoad NameLoad CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body AugAssignAdd NameStore Num AugAssignAdd NameStore Num Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad For NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad body Assign AttributeStore NameLoad attr Str For NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad body Assign AttributeStore NameLoad attr Str Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad orelse If BoolOpAnd CompareLt NameLoad NameLoad BoolOpOr CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body If CompareGtE AttributeLoad NameLoad attr Num body Print Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr While BoolOpOr BoolOpAnd CompareLt NameLoad NameLoad CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr CompareNotEq NameLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body AugAssignAdd NameStore Num AugAssignAdd NameStore Num Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad For NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad body Assign AttributeStore NameLoad attr Str For NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad body Assign AttributeStore NameLoad attr Str Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad orelse Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad If CompareGtE AttributeLoad NameLoad attr Num body Print Str If CompareGt BinOpSub Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad Num body Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad For NameStore NameLoad body Assign NameStore NameLoad For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad NameLoad keyword AttributeLoad NameLoad attr body Assign NameStore NameLoad Break If NameLoad body Assign NameStore NameLoad Break If NameLoad body Assign NameStore Str Assign NameStore Str AugAssignAdd NameStore Num AugAssignAdd NameStore Num If AttributeLoad NameLoad attr body Print Str For NameStore NameLoad body Print Str Call NameLoad NameLoad For NameStore NameLoad body Print Str Call NameLoad NameLoad orelse AugAssignAdd NameStore Num For NameStore NameLoad body Assign NameStore NameLoad For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad NameLoad keyword AttributeLoad NameLoad attr body Assign NameStore NameLoad Break If NameLoad body Assign NameStore NameLoad Break If NameLoad body AugAssignAdd NameStore Num Assign NameStore Str Assign NameStore Str Assign NameStore Str orelse AugAssignAdd NameStore Num Assign NameStore Str Assign NameStore Str Assign NameStore Str If AttributeLoad NameLoad attr body Print BinOpMod Str NameLoad For NameStore NameLoad body Print Str Call NameLoad NameLoad For NameStore NameLoad body Print Str Call NameLoad NameLoad If CompareEq NameLoad NameLoad body Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad orelse If CompareLt NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad orelse If CompareLt NameLoad NameLoad body If UnaryOpNot BoolOpAnd NameLoad UnaryOpNot NameLoad body If AttributeLoad NameLoad attr body Print Str For NameStore NameLoad body Print Str Call NameLoad NameLoad AugAssignAdd NameStore Num AugAssignAdd NameStore Num AugAssignAdd NameStore Num Assign NameStore Str Assign NameStore NameLoad orelse If UnaryOpNot BoolOpAnd NameLoad NameLoad body If AttributeLoad NameLoad attr body Print Str For NameStore NameLoad body Print Str Call NameLoad NameLoad AugAssignAdd NameStore Num AugAssignAdd NameStore Num AugAssignAdd NameStore Num Assign NameStore Str Assign NameStore NameLoad Assign NameStore NameLoad If CompareGtE AttributeLoad NameLoad attr Num body Print BinOpMod Str TupleLoad NameLoad NameLoad If NameLoad body For NameStore NameLoad body Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd CompareIn NameLoad TupleLoad Str Str AttributeLoad NameLoad attr body For NameStore NameLoad body Assign AttributeStore NameLoad attr NameLoad If NameLoad body For NameStore NameLoad body Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd CompareIn NameLoad TupleLoad Str Str AttributeLoad NameLoad attr body For NameStore NameLoad body Assign AttributeStore NameLoad attr NameLoad If BoolOpOr NameLoad CompareGtE NameLoad NameLoad CompareGtE NameLoad NameLoad body AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad If CompareNotEq BinOpAdd NameLoad NameLoad Num body Assign NameStore BinOpMod Str BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad orelse Assign NameStore Str If CompareNotEq BinOpAdd NameLoad NameLoad Num body Assign NameStore BinOpMod Str BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad orelse Assign NameStore Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpAdd NameLoad NameLoad Num Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpAdd NameLoad NameLoad Num Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore NameStore TupleLoad Num Num Num Num Assign TupleStore NameStore NameStore NameStore NameStore TupleLoad Num Num Num Num Assign TupleStore NameStore NameStore TupleLoad Num Num If CompareLt NameLoad NameLoad body For NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad body Assign AttributeStore NameLoad attr Str If CompareLt NameLoad NameLoad body For NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad body Assign AttributeStore NameLoad attr Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpAdd NameLoad NameLoad Num Print BinOpMod Str TupleLoad Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpAdd NameLoad NameLoad Num Print BinOpMod Str TupleLoad Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Print BinOpMod Str AttributeLoad NameLoad attr Assign NameStore ListLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str If CompareGtE AttributeLoad NameLoad attr Num body Print Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad keyword Call NameLoad BinOpMod AttributeLoad NameLoad attr Str Str If CompareGtE AttributeLoad NameLoad attr Num body Print Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad keyword Call NameLoad BinOpMod AttributeLoad NameLoad attr Str Str If CompareGtE AttributeLoad NameLoad attr Num body Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str Str Str Str Print Call AttributeLoad Str attr NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Num Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpAdd NameLoad NameLoad Num If CompareEq BinOpAdd NameLoad NameLoad Num body Assign NameStore NameLoad Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore NameLoad Assign NameStore Num Assign NameStore BinOpSub BinOpSub NameLoad NameLoad NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpAdd NameLoad NameLoad Num Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpDiv Call NameLoad NameLoad BinOpAdd NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr
N/A N/A gff_compare.py - compare two gene sets
======================================

:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python

Purpose
-------

This script benchmarks two gene predictions. Predictions are given as
gff files.

This script is transcript aware but not gene aware, i.e. if there are several
transcripts for a gene, overcounting happens.

Usage
-----

Example::

   python gff_compare.py --help

Type::

   python gff_compare.py --help

for command line help.

Command line options
--------------------

 N/A sys N/A re N/A CGAT.Experiment E N/A numpy Old N/A N/A N/A N/A N/A ref_nucleotides N/A N/A numpy zeros N/A max_end min_start N/A numpy int0 N/A target_nucleotides N/A N/A numpy zeros N/A max_end min_start N/A numpy int0 N/A x targets N/A N/A N/A target_nucleotides N/A N/A N/A x start min_start N/A N/A x end min_start 1 N/A x references N/A N/A N/A ref_nucleotides N/A N/A N/A x start min_start N/A N/A x end min_start 1 N/A not_ref N/A N/A numpy logical_not ref_nucleotides N/A not_target N/A N/A numpy logical_not target_nucleotides N/A v N/A N/A numpy logical_and ref_nucleotides target_nucleotides N/A tp N/A N/A numpy dot v v N/A v N/A N/A numpy logical_and ref_nucleotides not_target N/A fn N/A N/A numpy dot v v N/A v N/A N/A numpy logical_and not_ref target_nucleotides N/A fp N/A N/A numpy dot v v N/A v N/A N/A numpy logical_and not_ref not_target N/A tn N/A N/A numpy dot v v N/A GetCounts N/A N/A nucleotides val N/A N/A N/A count number of occurances of val in array.

    can't find a way without running into memory troubles.
     N/A t 0 N/A x nucleotides N/A N/A N/A x val N/A N/A t 1 N/A t N/A AnalyseOverlaps N/A N/A references targets N/A N/A N/A calculate nucleotide overlap.

    All references and targets should be on the same chromsome.
    Name and strand are not checked.
     N/A N/A N/A N/A len references 0 N/A N/A len targets 0 N/A N/A N/A 0 0 0 0 N/A targets_start N/A min N/A map N/A N/A N/A x N/A N/A x start targets N/A targets_end N/A max N/A map N/A N/A N/A x N/A N/A x end targets N/A refs_start N/A min N/A map N/A N/A N/A x N/A N/A x start references N/A refs_end N/A max N/A map N/A N/A N/A x N/A N/A x end references N/A min_start N/A min targets_start refs_start N/A max_end N/A max targets_end refs_end N/A nucleotides N/A N/A numpy zeros N/A max_end min_start N/A numpy int0 N/A x N/A targets N/A 100 N/A N/A N/A nucleotides N/A N/A N/A x start min_start N/A N/A x end min_start 1 N/A x N/A references N/A 100 N/A N/A N/A nucleotides N/A N/A N/A x start min_start N/A N/A x end min_start N/A N/A numpy array N/A N/A 2 N/A N/A x end N/A x start N/A numpy int0 N/A tp N/A GetCounts nucleotides 3 N/A fp N/A GetCounts nucleotides 1 N/A tn N/A GetCounts nucleotides 0 N/A fn N/A GetCounts nucleotides 2 N/A N/A tp fp tn fn N/A CalculateSpecificitySensitivity N/A N/A tp fp tn fn N/A N/A N/A N/A N/A fp tp 0 N/A N/A spec 1.0 N/A N/A spec N/A N/A float tp N/A fp tp N/A N/A N/A tp fn 0 N/A N/A sens 0.0 N/A N/A sens N/A N/A float tp N/A tp fn N/A N/A spec sens N/A CalculateCorrelationCoefficient N/A N/A tp fp tn fn N/A N/A N/A x N/A N/A N/A N/A tp fn N/A tn fp N/A tp fp N/A tn fn N/A N/A x 0 N/A N/A 0.0 N/A N/A N/A N/A N/A tp tn N/A fn fp x N/A GetFirstOverlaps N/A N/A gffs index N/A N/A N/A get next overlapping gffs from array starting at index.
     N/A this_name N/A N/A gffs N/A index mName N/A this_strand N/A N/A gffs N/A index strand N/A l N/A len gffs N/A min_start N/A N/A gffs N/A index start N/A max_end N/A N/A gffs N/A index end N/A overlaps N/A N/A gffs N/A index N/A index 1 N/A N/A index l N/A N/A N/A N/A this_name N/A N/A gffs N/A index mName N/A this_strand N/A N/A gffs N/A index strand N/A max_end N/A N/A gffs N/A index start N/A N/A N/A overlaps index min_start max_end N/A max_end N/A max max_end N/A N/A gffs N/A index end N/A N/A N/A overlaps append N/A gffs N/A index N/A index 1 N/A N/A overlaps index min_start max_end N/A CountMatchesPerGene N/A N/A gffs rx_gene rx_other write outfile N/A N/A N/A sys stdout N/A N/A use status information in gffs to check for completely matches/extra genes.
     N/A map_gene2matches N/A N/A x gffs N/A N/A N/A N/A gene N/A N/A N/A N/A N/A rx_gene search N/A x mInfo groups N/A 0 N/A N/A N/A AttributeError N/A N/A N/A # ERROR: could not find gene identifier in %s N/A x mInfo N/A N/A N/A N/A sys stdout flush N/A N/A N/A sys exit 1 N/A N/A gene map_gene2matches N/A N/A N/A map_gene2matches N/A gene N/A 0 0 N/A N/A N/A info N/A map_gene2matches N/A gene N/A N/A info N/A 0 1 N/A N/A N/A N/A N/A x mStatus extra N/A N/A N/A info N/A 1 1 N/A N/A N/A N/A x mStatus N/A match partial N/A N/A y N/A x mMatches N/A N/A other_gene N/A N/A N/A N/A N/A rx_other search N/A y mInfo groups N/A 0 N/A N/A other_gene N/A info N/A 2 N/A N/A N/A N/A info N/A 2 N/A other_gene 0 N/A N/A other_gene N/A info N/A 3 N/A N/A N/A N/A info N/A 3 N/A other_gene 0 N/A N/A N/A GTF Identity x y max_slippage N/A options max_exon_slippage N/A N/A N/A N/A info N/A 2 N/A other_gene 1 N/A N/A N/A info N/A 3 N/A other_gene 1 N/A N/A N/A N/A GTF HalfIdentity x y max_slippage N/A options max_exon_slippage N/A N/A N/A N/A info N/A 3 N/A other_gene 1 N/A N/A N/A AttributeError N/A N/A Programming ERROR: no mStatus for  N/A str x N/A total_extra 0 N/A total_match 0 N/A total_partial_match 0 N/A total N/A len map_gene2matches N/A N/A gene info N/A N/A map_gene2matches items N/A N/A N/A l nextra matches partials info N/A N/A nextra l N/A N/A total_extra 1 N/A N/A missed write N/A N/A N/A N/A outfile write N/A missed	%s
 N/A gene N/A N/A N/A x y N/A N/A matches items N/A N/A N/A y l N/A N/A total_match 1 N/A N/A match write N/A N/A N/A N/A outfile write N/A match	%s	%s
 N/A gene x N/A N/A N/A N/A x y N/A N/A partials items N/A N/A N/A y l N/A N/A total_partial_match 1 N/A N/A partial write N/A N/A N/A N/A outfile write N/A partial	%s	%s
 N/A gene x N/A N/A N/A total total_match total_partial_match total_extra N/A main N/A N/A argv N/A None N/A N/A script main.

    parses command line options in sys.argv, unless *argv* is given.
     N/A N/A argv None N/A N/A argv N/A sys argv N/A parser N/A N/A E OptionParser version %prog version: $Id: gff_compare.py 2781 2009-09-10 11:33:14Z andreas $ usage N/A N/A globals N/A __doc__ N/A N/A N/A parser add_option -f --output-full dest write_full help write full gff entries. action store_true N/A N/A N/A parser add_option -e --output-matched-exons dest write_matched_exons help write matched exons. action store_true N/A N/A N/A parser add_option -o --output-missed-exons dest write_missed_exons action store_true help write missed exons. N/A N/A N/A parser add_option -g --output-missed-genes dest write_missed_genes action store_true help write missed genes. N/A N/A N/A parser add_option -r --regex-reference dest regex_reference type string help regular expression mapping exon to transcript in reference. N/A N/A N/A parser add_option -t --regex-target dest regex_target type string help regular expression mapping exon to transcript in target. N/A N/A N/A parser add_option --no-nucleotides dest do_nucleotides action store_false help skip nucleotide benchmark. N/A N/A N/A parser add_option --no-exons dest do_exons action store_false help skip exon benchmark. N/A N/A N/A parser add_option --no-genes dest do_genes action store_false help skip gene benchmark. N/A N/A N/A parser add_option --output-filename-pattern dest outfile_pattern type string help output filename pattern for extra info (%s will be substituted with reference,target). N/A N/A N/A parser set_defaults remove_redundancy False max_exon_slippage 9 write_missed_exons False write_matched_exons False write_missed_genes False write_wrong_exons False write_wrong_genes False do_nucleotides True do_exons True do_genes True regex_reference None regex_target None outfile_pattern %s.info N/A N/A options args N/A N/A E Start parser N/A N/A N/A len args 2 N/A N/A USAGE N/A two arguments required N/A N/A N/A sys exit 1 N/A N/A input_filename_target input_filename_reference args N/A N/A N/A options loglevel 1 N/A N/A N/A # target entries from %s input_filename_target N/A # reading target entries ... N/A N/A N/A N/A sys stdout flush N/A gff_targets N/A N/A GTF readFromFile N/A open input_filename_target r N/A N/A N/A options loglevel 1 N/A N/A N/A finished: %i N/A len gff_targets N/A N/A N/A N/A sys stdout flush N/A N/A N/A options loglevel 1 N/A N/A N/A # reference entries from %s input_filename_reference N/A # reading reference entries ... N/A N/A N/A N/A sys stdout flush N/A gff_references N/A N/A GTF readFromFile N/A open input_filename_reference r N/A N/A N/A options loglevel 1 N/A N/A N/A finished: %i N/A len gff_references N/A N/A N/A N/A sys stdout flush N/A N/A options remove_redundancy N/A N/A gff_targets N/A N/A GTF CombineOverlaps gff_targets N/A gff_references N/A N/A GTF CombineOverlaps gff_references N/A N/A N/A options loglevel 1 N/A N/A N/A # after filtering: targets=%i, references=%i N/A N/A len gff_targets N/A len gff_references N/A N/A N/A options loglevel 1 N/A N/A # sorting exons ... N/A N/A N/A N/A sys stdout flush N/A N/A N/A gff_targets sort N/A N/A N/A x y N/A N/A cmp N/A N/A x mName N/A x strand N/A x start N/A x end N/A N/A y mName N/A y strand N/A y start N/A y end N/A N/A N/A gff_references sort N/A N/A N/A x y N/A N/A cmp N/A N/A x mName N/A x strand N/A x start N/A x end N/A N/A y mName N/A y strand N/A y start N/A y end N/A ntargets N/A len gff_targets N/A nreferences N/A len gff_references N/A N/A N/A options loglevel 1 N/A N/A finished N/A N/A N/A N/A sys stdout flush N/A N/A options do_nucleotides N/A N/A ##############################################################################
# nucleotide accuracy
#
# TP: true postives  : nucleotides to be predicted coding in both target and reference.
# FN: true negatives : nucleotides to be predicted non-coding in both target and reference.
# FP: false positives: nucleotides to be predicted non-coding in target but not in reference.
# FN: false negatives: nucleotides to be predicted non-coding in reference but not in target.
#
# Sensitivity: TP / TP + FN = correct exons / actual exons
# Specificity: TP / TP + FP
# CC: correlation coefficient:  (tp*tn-fn*fp)/((tp+fn)*(tn+fp)*(tp+fp)*(tn+fn)) N/A headers N/A contig strand tp fp tn fn sp sn cc N/A N/A N/A join headers N/A N/A first_r first_t N/A 0 0 N/A N/A r t N/A 0 0 N/A N/A ttp tfp ttn tfn N/A 0 0 0 0 N/A N/A N/A r nreferences N/A t ntargets N/A N/A this_name N/A N/A gff_references N/A r mName N/A this_strand N/A N/A gff_references N/A r strand N/A N/A N/A r nreferences N/A N/A N/A gff_references N/A r mName this_name N/A N/A N/A gff_references N/A r strand this_strand N/A N/A r 1 N/A N/A N/A t ntargets N/A N/A N/A N/A gff_targets N/A t mName this_name N/A N/A N/A gff_targets N/A t strand this_strand N/A N/A t 1 N/A first_t t N/A N/A N/A t ntargets N/A N/A N/A gff_targets N/A t mName this_name N/A N/A N/A gff_targets N/A t strand this_strand N/A N/A t 1 N/A N/A tp fp tn fn N/A AnalyseOverlaps N/A gff_references N/A first_r r N/A gff_targets N/A first_t t N/A N/A spec sens N/A CalculateSpecificitySensitivity tp fp tn fn N/A cc N/A CalculateCorrelationCoefficient tp fp tn fn N/A N/A %s	%s	%i	%i	%i	%i	%5.2f	%5.2f	%5.2f N/A this_name this_strand tp fp tn fn spec sens cc N/A ttp tp N/A tfp fp N/A ttn tn N/A tfn fn N/A N/A first_r first_t N/A r t N/A N/A spec sens N/A CalculateSpecificitySensitivity ttp tfp ttn tfn N/A cc N/A CalculateCorrelationCoefficient ttp tfp ttn tfn N/A N/A %s	%s	%i	%i	%i	%i	%5.2f	%5.2f	%5.2f N/A all all ttp tfp ttn tfn spec sens cc N/A N/A N/A N/A sys stdout flush N/A N/A N/A options do_exons N/A options do_genes N/A N/A N/A ##############################################################################
# exon accuracy (see Burset & Guigo (1996))
#
# TP: true postives  : exons matching both exon boundaries exactly (a deviation of
#                         maximal %i nucleotides is allowed).
# FN: true negatives : not counted.
# FP: false positives: exons in target not overlapping with in reference.
# FN: false negatives: exons overlapping, but with deviant boundaries and exons
#                         in reference not overlapping with any target exon.
#
# ME: missed exons: exons in reference not overlapping with exons in target
#                 (add to false negative count).
# WE: wrong exons: exons in target not overlapping with exons in reference
#                 (add to false positive count).
#
# Sensitivity: TP / (TP + FN) = correct exons / actual exons
# Specificity: TP / (TP + FP) = correct exons / predicted exons
# CC: (sensitivity + specificity) / 2
#
# Values are calculated where both exon boundaries of a target exon have to be
# correct (category "full") and where only one exon boundary has to be correct (catgory "half"). N/A options max_exon_slippage N/A headers N/A category contig strand tp fp tn fn sp sn cc me we me we N/A N/A N/A join headers N/A N/A r t N/A 0 0 N/A N/A next_r next_t N/A r t N/A N/A tp fp tn fn N/A 0 0 0 0 N/A N/A ttp tfp ttn tfn N/A 0 0 0 0 N/A N/A ptp pfp ptn pfn N/A 0 0 0 0 N/A N/A tptp tpfp tptn tpfn N/A 0 0 0 0 N/A N/A missed_exons wrong_exons N/A 0 0 N/A N/A tmissed_exons twrong_exons N/A 0 0 N/A last_partial_overlap False N/A last_increased_ref False N/A N/A N/A r nreferences N/A t ntargets N/A N/A this_name N/A N/A gff_references N/A r mName N/A this_strand N/A N/A gff_references N/A r strand N/A N/A next_r r N/A N/A N/A ref_overlaps next_r ref_start ref_end N/A GetFirstOverlaps gff_references r N/A N/A next_t t N/A N/A N/A target_overlaps next_t target_start target_end N/A GetFirstOverlaps gff_targets t N/A N/A N/A options loglevel 3 N/A N/A ######################################################## N/A x ref_overlaps N/A N/A # N/A str x N/A x target_overlaps N/A N/A # N/A str x N/A do_summary False N/A N/A N/A next_r nreferences N/A N/A this_name N/A N/A gff_references N/A next_r mName N/A this_strand N/A N/A gff_references N/A next_r strand N/A N/A N/A N/A options loglevel 3 N/A N/A # target advance N/A do_summary True N/A last_increased_ref False N/A last_partial_overlap False N/A next_name N/A N/A gff_references N/A next_r mName N/A next_strand N/A N/A gff_references N/A next_r strand N/A N/A N/A N/A next_t ntargets N/A next_name N/A N/A gff_targets N/A next_t mName N/A next_strand N/A N/A gff_targets N/A next_t strand N/A N/A fp 1 N/A pfp 1 N/A N/A target_overlaps next_t target_start target_end N/A GetFirstOverlaps gff_targets next_t N/A x N/A gff_targets N/A t next_t N/A N/A N/A x mStatus extra N/A x N/A gff_references N/A r next_r N/A N/A N/A x mStatus extra N/A N/A r t N/A next_r next_t N/A N/A N/A N/A next_t ntargets N/A N/A this_name N/A N/A gff_targets N/A next_t mName N/A this_strand N/A N/A gff_targets N/A next_t strand N/A N/A N/A N/A options loglevel 3 N/A N/A # reference advance N/A do_summary True N/A last_increased_ref False N/A last_partial_overlap False N/A next_name N/A N/A gff_targets N/A next_t mName N/A next_strand N/A N/A gff_targets N/A next_t strand N/A N/A N/A N/A next_r nreferences N/A next_name N/A N/A gff_references N/A next_r mName N/A next_strand N/A N/A gff_references N/A next_r strand N/A N/A fn 1 N/A pfn 1 N/A N/A reference_overlaps next_r references_start references_end N/A GetFirstOverlaps gff_references next_r N/A x N/A gff_targets N/A t next_t N/A N/A N/A x mStatus extra N/A x N/A gff_references N/A r next_r N/A N/A N/A x mStatus extra N/A N/A r t N/A next_r next_t N/A N/A N/A ref_status target_status N/A None None N/A N/A N/A options loglevel 3 N/A N/A # same chromosome N/A N/A N/A N/A min ref_end target_end N/A max ref_start target_start 0 N/A N/A last_increased_ref False N/A last_partial_overlap False N/A found False N/A rr ref_overlaps N/A N/A xfound False N/A tt target_overlaps N/A N/A N/A N/A GTF Identity rr tt max_slippage N/A options max_exon_slippage N/A N/A xfound True N/A N/A xfound N/A N/A found True N/A N/A found N/A N/A ref_status match N/A target_status match N/A tp 1 N/A ptp 1 N/A N/A options write_matched_exons N/A N/A ############# matching exons ########################### N/A x ref_overlaps N/A N/A # N/A str x N/A x target_overlaps N/A N/A # N/A str x N/A N/A fn 1 N/A rr ref_overlaps N/A N/A xfound False N/A tt target_overlaps N/A N/A N/A N/A GTF HalfIdentity rr tt max_slippage N/A options max_exon_slippage N/A N/A xfound True N/A N/A xfound N/A N/A found True N/A N/A found N/A N/A ptp 1 N/A code partial N/A ref_status partial N/A target_status partial N/A N/A pfn 1 N/A code complete N/A ref_status mismatch N/A target_status mismatch N/A N/A options write_missed_exons N/A N/A N/A ############# %s non-overlapping exons ########################### code N/A x ref_overlaps N/A N/A # N/A str x N/A x target_overlaps N/A N/A # N/A str x N/A N/A ref_end target_end N/A N/A N/A r t N/A next_r next_t N/A N/A N/A ref_end target_end N/A N/A r next_r N/A last_increased_ref True N/A last_partial_overlap True N/A N/A t next_t N/A last_increased_ref False N/A last_partial_overlap True N/A N/A N/A ref_end target_start N/A N/A N/A N/A last_partial_overlap N/A last_increased_ref N/A N/A N/A options write_missed_exons N/A N/A ############# missed exon ########################### N/A x ref_overlaps N/A N/A # N/A str x N/A missed_exons 1 N/A fn 1 N/A pfn 1 N/A ref_status extra N/A r next_r N/A N/A N/A N/A last_partial_overlap last_increased_ref N/A N/A N/A options write_wrong_exons N/A N/A ############# wrong exon ########################### N/A x target_overlaps N/A N/A # N/A str x N/A wrong_exons 1 N/A fp 1 N/A pfp 1 N/A target_status extra N/A t next_t N/A last_partial_overlap False N/A N/A N/A options loglevel 3 N/A N/A N/A # ref_status=%s, target_status=%s N/A ref_status target_status N/A ref_status N/A N/A rr ref_overlaps N/A N/A N/A rr mStatus ref_status N/A N/A N/A ref_status N/A match partial N/A options do_genes N/A N/A rr ref_overlaps N/A N/A N/A rr mMatches target_overlaps N/A target_status N/A N/A tt target_overlaps N/A N/A N/A tt mStatus target_status N/A N/A N/A target_status N/A match partial N/A options do_genes N/A N/A tt target_overlaps N/A N/A N/A tt mMatches ref_overlaps N/A N/A do_summary N/A r nreferences N/A t ntargets N/A N/A ttp tp N/A tfp fp N/A ttn tn N/A tfn fn N/A tptp ptp N/A tpfp pfp N/A tptn ptn N/A tpfn pfn N/A tmissed_exons missed_exons N/A twrong_exons wrong_exons N/A N/A N/A tp fn 0 N/A N/A pmissed_exons N/A %5.2f N/A N/A float missed_exons N/A tp fn N/A N/A pmissed_exons 0 N/A N/A N/A tp fp 0 N/A N/A pwrong_exons N/A %5.2f N/A N/A float wrong_exons N/A tp fp N/A N/A pwrong_exons na N/A N/A spec sens N/A CalculateSpecificitySensitivity tp fp tn fn N/A cc N/A N/A spec sens 2.0 N/A N/A full	%s	%s	%i	%i	%i	%i	%5.2f	%5.2f	%5.2f	%i	%i	%s	%s N/A this_name this_strand tp fp tn fn spec sens cc missed_exons wrong_exons pmissed_exons pwrong_exons N/A N/A spec sens N/A CalculateSpecificitySensitivity ptp pfp ptn pfn N/A cc N/A N/A spec sens 2.0 N/A N/A half	%s	%s	%i	%i	%i	%i	%5.2f	%5.2f	%5.2f	%i	%i	%s	%s N/A this_name this_strand ptp pfp ptn pfn spec sens cc missed_exons wrong_exons pmissed_exons pwrong_exons N/A N/A tp fp tn fn N/A 0 0 0 0 N/A N/A ptp pfp ptn pfn N/A 0 0 0 0 N/A N/A missed_exons wrong_exons N/A 0 0 N/A N/A t ntargets N/A N/A x N/A gff_targets N/A t ntargets N/A N/A N/A x mStatus extra N/A N/A r nreferences N/A N/A x N/A gff_references N/A r nreferences N/A N/A N/A x mStatus extra N/A N/A spec sens N/A CalculateSpecificitySensitivity ttp tfp ttn tfn N/A cc N/A N/A spec sens 2.0 N/A N/A full	%s	%s	%i	%i	%i	%i	%5.2f	%5.2f	%5.2f	%i	%i	%5.2f	%5.2f N/A all all ttp tfp ttn tfn spec sens cc tmissed_exons twrong_exons N/A N/A float tmissed_exons N/A ttp tfn N/A N/A float twrong_exons N/A ttp tfp N/A N/A spec sens N/A CalculateSpecificitySensitivity tptp tpfp tptn tpfn N/A cc N/A N/A spec sens 2.0 N/A N/A half	%s	%s	%i	%i	%i	%i	%5.2f	%5.2f	%5.2f	%i	%i	%5.2f	%5.2f N/A all all tptp tpfp tptn tpfn spec sens cc tmissed_exons twrong_exons N/A N/A float tmissed_exons N/A ttp tfn N/A N/A float twrong_exons N/A ttp tfp N/A N/A N/A options do_genes N/A options regex_reference N/A options regex_target N/A N/A N/A ##############################################################################
# gene accuracy (see Burset & Guigo (1996))
#
# TP: true postives  : genes with exons matching both exon boundaries exactly (a deviation of
#                         maximal %i nucleotides is allowed).
# FN: true negatives : not counted.
# FP: false positives: genes in target not overlapping with in reference.
# FN: false negatives: genes overlapping, but with deviant exon boundaries and genes
#                         in reference not overlapping with any target exon.
#
# MG: missed genes: exons in reference not overlapping with exons in target
#                 (add to false negative count).
# WG: wrong genes: exons in target not overlapping with exons in reference
#                 (add to false positive count).
#
# Sensitivity: TP / (TP + FN) = correct genes / actual genes
# Specificity: TP / (TP + FP) = correct genes / predicted genes
# CC: (sensitivity + specificity) / 2
#
# Values are calculated where both exon boundaries of a target exon have to be
# correct (category "full") and where only one exon boundary has to be correct (catgory "half"). N/A options max_exon_slippage N/A out_options N/A N/A N/A options write_missed_genes N/A N/A N/A N/A out_options append missed N/A N/A N/A options loglevel 2 N/A N/A # counting matches for reference. N/A N/A N/A N/A sys stdout flush N/A N/A ref_total ref_match ref_partial ref_extra N/A CountMatchesPerGene gff_references N/A N/A re compile N/A options regex_reference N/A N/A re compile N/A options regex_target write out_options outfile N/A open N/A N/A options outfile_pattern reference w N/A N/A N/A options loglevel 2 N/A N/A # counting matches for target. N/A N/A N/A N/A sys stdout flush N/A N/A target_total target_match target_partial target_extra N/A CountMatchesPerGene gff_targets N/A N/A re compile N/A options regex_target N/A N/A re compile N/A options regex_reference write out_options outfile N/A open N/A N/A options outfile_pattern target w N/A N/A N/A options loglevel 1 N/A N/A N/A # reference: genes=%6i, matches=%6i, partial=%6i, extra=%6i N/A ref_total ref_match ref_partial ref_extra N/A N/A # target   : genes=%6i, matches=%6i, partial=%6i, extra=%6i N/A target_total target_match target_partial target_extra N/A headers N/A category tp fp tn fn sp sn cc mg wg mg wg N/A N/A N/A join headers N/A tp ref_match N/A fp target_extra N/A tn 0 N/A fn N/A ref_total ref_match N/A wrong_genes target_extra N/A missed_genes ref_extra N/A N/A spec sens N/A CalculateSpecificitySensitivity tp fp tn fn N/A cc N/A N/A spec sens 2.0 N/A N/A N/A tp fp 0 N/A N/A fp nreferences N/A N/A full	%i	%i	%i	%i	%5.2f	%5.2f	%5.2f	%i	%i	%5.2f	%5.2f N/A tp fp tn fn spec sens cc missed_genes wrong_genes N/A N/A float missed_genes N/A tp fn N/A N/A float wrong_genes N/A tp fp N/A tp N/A ref_match ref_partial N/A fp target_extra N/A tn 0 N/A fn N/A N/A ref_total ref_match ref_partial N/A wrong_genes target_extra N/A missed_genes ref_extra N/A N/A spec sens N/A CalculateSpecificitySensitivity tp fp tn fn N/A cc N/A N/A spec sens 2.0 N/A N/A half	%i	%i	%i	%i	%5.2f	%5.2f	%5.2f	%i	%i	%5.2f	%5.2f N/A tp fp tn fn spec sens cc missed_genes wrong_genes N/A N/A float missed_genes N/A tp fn N/A N/A float wrong_genes N/A tp fp N/A N/A N/A E Stop N/A N/A N/A __name__ __main__ N/A N/A N/A N/A sys exit N/A main N/A sys argv