<s> import sys <EOL> fasta_dic = { } <EOL> F = open ( sys . argv [ <NUM_LIT:1> ] , "<STR_LIT:r>" ) <EOL> for line in F : <EOL> if line [ <NUM_LIT:0> ] == "<STR_LIT:>>" : <EOL> try : <EOL> fasta_dic [ current_item ] = "<STR_LIT>" . join ( stringlist ) <EOL> except : pass <EOL> current_item = line [ <NUM_LIT:1> : ] . rstrip ( ) . split ( ) [ <NUM_LIT:0> ] <EOL> fasta_dic [ current_item ] = "<STR_LIT>" <EOL> stringlist = [ ] <EOL> else : <EOL> stringlist . append ( line . rstrip ( ) ) <EOL> fasta_dic [ current_item ] = "<STR_LIT>" . join ( stringlist ) <EOL> F . close ( ) <EOL> F = open ( sys . argv [ <NUM_LIT:2> ] , "<STR_LIT:r>" ) <EOL> ref_lines = F . readlines ( ) <EOL> for line in ref_lines [ <NUM_LIT:1> : ] : <EOL> fields = line . split ( ) <EOL> print "<STR_LIT>" % ( fields [ <NUM_LIT:0> ] , fields [ <NUM_LIT:3> ] ) <EOL> sequence = fasta_dic [ fields [ <NUM_LIT:0> ] ] [ int ( fields [ <NUM_LIT:1> ] ) : int ( fields [ <NUM_LIT:2> ] ) + <NUM_LIT:1> ] <EOL> for i in range ( <NUM_LIT:0> , len ( sequence ) , <NUM_LIT> ) : <EOL> print "<STR_LIT:%s>" % ( sequence [ i : i + <NUM_LIT> ] ) </s>
