/// \brief TODOCUMENT
///
/// \relates display_colourer
display_colour_spec cath::get_colour_spec(const display_colourer &arg_colourer, ///< TODOCUMENT
                                          const pdb_list         &arg_pdbs,     ///< TODOCUMENT
                                          const str_vec          &arg_names,    ///< TODOCUMENT
                                          const alignment        &arg_alignment ///< TODOCUMENT
                                          ) {
	const alignment::size_type num_entries   = arg_alignment.num_entries();
	const alignment::size_type aln_length    = arg_alignment.length();

	if ( aln_length <= 0 || num_entries <= 0 ) {
		BOOST_THROW_EXCEPTION(invalid_argument_exception("Unable to colour the alignment_context because the alignment is empty"));
	}
	if ( num_entries != arg_pdbs.size()  ) {
		BOOST_THROW_EXCEPTION(invalid_argument_exception("Unable to colour the alignment_context because the number of entries doesn't match the number of PDBs"));
	}
	if ( num_entries != arg_names.size() ) {
		BOOST_THROW_EXCEPTION(invalid_argument_exception("Unable to colour the alignment_context because the number of entries doesn't match the number of names"));
	}
	auto &&result_spec = arg_colourer.get_colour_spec( alignment_context(
		arg_pdbs,
		arg_names,
		arg_alignment
	) );

	return has_score_colour_handler( arg_colourer )
		? adjust_display_colour_spec_copy(
			std::forward< decltype( result_spec ) >( result_spec ),
			get_score_colour_handler( arg_colourer ),
			arg_alignment
		)
		: result_spec;
}
Example #2
0
/// \brief TODOCUMENT
///
/// \relates display_colourer
void cath::colour_viewer(const display_colourer  &arg_colourer, ///< TODOCUMENT
                         ostream                 &arg_os,       ///< TODOCUMENT
                         const viewer            &arg_viewer,   ///< TODOCUMENT
                         const alignment_context &arg_aln_con   ///< TODOCUMENT
                         ) {
	const display_colour_spec the_spec = arg_colourer.get_colour_spec( arg_aln_con );
	colour_viewer_with_spec( the_spec, arg_viewer, arg_aln_con, arg_os );
}
/// \brief Write instructions for the specified viewer to the specified ostream
///        to represent the specified display_colourer in the context of the specified alignment_context
///
/// \relates display_colourer
void cath::colour_viewer(const display_colourer  &arg_colourer, ///< The display_colourer to write to the ostream
                         ostream                 &arg_os,       ///< The ostream to which the instructions should be written
                         const viewer            &arg_viewer,   ///< The viewer defining the instructions to be written
                         const alignment_context &arg_aln_con   ///< The alignment_context providing the context for the display_colourer
                         ) {
	colour_viewer_with_spec(
		arg_colourer.get_colour_spec( arg_aln_con ),
		arg_viewer,
		arg_aln_con,
		arg_os
	);
}
Example #4
0
/// \brief TODOCUMENT
///
/// \relates display_colourer
display_colour_spec cath::get_colour_spec(const display_colourer &arg_colourer, ///< TODOCUMENT
                                          const pdb_list         &arg_pdbs,     ///< TODOCUMENT
                                          const str_vec          &arg_names,    ///< TODOCUMENT
                                          const alignment        &arg_alignment ///< TODOCUMENT
                                          ) {
	const alignment::size_type num_entries   = arg_alignment.num_entries();
	const alignment::size_type aln_length    = arg_alignment.length();

	if ( aln_length <= 0 || num_entries <= 0 ) {
		BOOST_THROW_EXCEPTION(invalid_argument_exception("Unable to colour the alignment_context because the alignment is empty"));
	}
	if ( num_entries != arg_pdbs.size()  ) {
		BOOST_THROW_EXCEPTION(invalid_argument_exception("Unable to colour the alignment_context because the number of entries doesn't match the number of PDBs"));
	}
	if ( num_entries != arg_names.size() ) {
		BOOST_THROW_EXCEPTION(invalid_argument_exception("Unable to colour the alignment_context because the number of entries doesn't match the number of names"));
	}
	return arg_colourer.get_colour_spec( alignment_context(
		arg_pdbs,
		arg_names,
		arg_alignment
	) );
}