<s> """<STR_LIT>""" <EOL> import sys <EOL> import CGAT . Experiment as E <EOL> import CGAT . Blat as Blat <EOL> def main ( argv = None ) : <EOL> """<STR_LIT>""" <EOL> if not argv : <EOL> argv = sys . argv <EOL> parser = E . OptionParser ( version = "<STR_LIT>" , <EOL> usage = globals ( ) [ "<STR_LIT>" ] ) <EOL> ( options , args ) = E . Start ( parser , argv = argv ) <EOL> ninput , nskipped , noutput = <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> <EOL> for psl in Blat . iterator ( options . stdin ) : <EOL> ninput += <NUM_LIT:1> <EOL> if psl . strand == "<STR_LIT:->" : <EOL> qstart , qend = psl . mQueryLength - psl . mQueryTo , psl . mQueryLength - psl . mQueryFrom <EOL> else : <EOL> qstart , qend = psl . mQueryFrom , psl . mQueryTo <EOL> options . stdout . write ( "<STR_LIT>" % <EOL> ( psl . mNMatches , <EOL> psl . mSbjctId , <EOL> psl . mSbjctLength , <EOL> "<STR_LIT:+>" , <EOL> psl . mSbjctFrom , <EOL> psl . mSbjctTo , <EOL> psl . mQueryId , <EOL> psl . mQueryLength , <EOL> psl . strand , <EOL> qstart , <EOL> qend , <EOL> ninput ) ) <EOL> size , tend , qend = <NUM_LIT:0> , None , None <EOL> for qstart , tstart , size in psl . getBlocks ( ) : <EOL> if tend is not None : <EOL> options . stdout . write ( <EOL> "<STR_LIT>" % ( tstart - tend , qstart - qend ) ) <EOL> qend , tend = qstart + size , tstart + size <EOL> options . stdout . write ( "<STR_LIT>" % ( size , ) ) <EOL> options . stdout . write ( "<STR_LIT:\n>" ) <EOL> noutput += <NUM_LIT:1> <EOL> E . info ( "<STR_LIT>" % ( ninput , noutput , nskipped ) ) <EOL> E . Stop ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> sys . exit ( main ( sys . argv ) ) </s>
