#NEWLINE# def split_name( csv_list ) : #NEWLINE# #INDENT# csv_list [ 0 ] . insert ( 1 , 'Accession' ) #NEWLINE# for row in csv_list [ 1 : ] : #NEWLINE# #INDENT# phagename = row [ 1 ] #NEWLINE# row . insert ( 1 , '' ) #NEWLINE# try : #NEWLINE# #INDENT# phagename . index ( 'gi|' ) #NEWLINE# r = phagename . index ( 'ref|' ) #NEWLINE# s = phagename [ ( r + 4 ) : ] . index ( '|' ) #NEWLINE# refseq = phagename [ ( r + 4 ) : ( ( r + 4 ) + s ) ] #NEWLINE# row [ 1 ] = refseq #NEWLINE# n = phagename . index ( ' ' ) #NEWLINE# name = phagename [ ( n + 1 ) : phagename . index ( ',' ) ] #NEWLINE# row [ 2 ] = name #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# phagename . index ( 'ENA|' ) #NEWLINE# r = phagename [ 4 : ] . index ( '|' ) #NEWLINE# n = phagename . index ( ' ' ) #NEWLINE# refseq = phagename [ ( r + 5 ) : n ] #NEWLINE# row [ 1 ] = refseq #NEWLINE# try : #NEWLINE# #INDENT# name = phagename [ ( n + 1 ) : phagename . index ( ',' ) ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# name = phagename [ ( n + 1 ) : ] #NEWLINE# #UNINDENT# row [ 2 ] = name #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return csv_list