- linker = seq.get_subsequence( first - 1 , last - 1 )
- linker.get_sequence_as_string
+ else
+ seq = msa.get_sequence( indices[ 0 ] )
+ end
+ seq
+ end
+
+
+ def extract_linker( first, last , seq, output_file )
+
+ if ( last - first >= 1 )
+ indices = msa.find_by_name_start( query , true )
+ if indices.length != 1
+ if query[ -1, 1 ] == "|"
+ query.chop!
+ end
+ seq = msa.get_by_name_pattern( /\b#{Regexp.quote(query)}\b/ )
+ else
+ seq = msa.get_sequence( indices[ 0 ] )
+ end
+ species = nil
+ if seq.get_name =~ /\[([A-Z0-9]{3,5})\]/
+ species = $1
+ end
+
+ output_file.print( ">" + seq.get_name + " [" + first.to_s + "-" + last.to_s + "]" + "\n")
+ output_file.print( seq.get_subsequence( first - 1 , last - 1 ).get_sequence_as_string + "\n" )