#NEWLINE# def write_agp( self , filename ) : #NEWLINE# #INDENT# sizes = self . sz #NEWLINE# agp = [ ] #NEWLINE# for ( scaffold , lines ) in self . iter_scaffold ( ) : #NEWLINE# #INDENT# for ( a , b ) in pairwise ( a ) : #NEWLINE# #INDENT# cline = AGPLine . cline ( scaffold , a . tig , sizes , a . oo ) #NEWLINE# gline = AGPLine . gline ( scaffold , a . gaps ) #NEWLINE# agp . append ( cline ) #NEWLINE# agp . append ( gline ) #NEWLINE# #UNINDENT# a = lines [ ( - 1 ) ] #NEWLINE# cline = AGPLine . cline ( scaffold , a . tig , sizes , a . oo ) #NEWLINE# agp . append ( cline ) #NEWLINE# #UNINDENT# fw = open ( filename , 'w' ) #NEWLINE# for a in agp : #NEWLINE# #INDENT# ( ( print >> fw ) , a ) #NEWLINE# #UNINDENT# fw . close ( ) #NEWLINE# reindex ( [ filename , '--inplace' ] ) #NEWLINE# return filename