Rosetta
|
Data structure for storing a citation. More...
#include <Citation.hh>
Public Member Functions | |
Citation ()=default | |
Constructor. More... | |
Citation (std::string const &citation_as_string) | |
Initialization constructor. More... | |
Citation (Citation const &)=default | |
Copy constructor. More... | |
~Citation () override=default | |
CitationOP | clone () const |
void | clear () |
Completely clear the data in this citation. More... | |
void | initialize_from_string (std::string const &citation_as_string) |
Initializes from a string formatted as in the Rosetta database. See initialization constructor's description for an example. More... | |
void | add_primary_author (std::string const &given_names, std::string const &surname, std::string const &initials) |
Add a primary author. More... | |
void | add_co_author (std::string const &given_names, std::string const &surname, std::string const &initials) |
Add a co-author. More... | |
void | add_senior_author (std::string const &given_names, std::string const &surname, std::string const &initials) |
Add a primary author. More... | |
void | set_year_and_article (int const year_in, std::string const &article_title, std::string const &journal_title, std::string const &volume_issue_pages, std::string const &doi) |
Set the year, article title, journal title, and the string for the volume/issue/pages. More... | |
void | get_formatted_citation (std::ostream &outstream, CitationFormat const format=CitationFormat::DefaultStyle) const |
Get this citation as a string, in a particular format. More... | |
utility::vector1< AuthorNames > const & | primary_authors () const |
Access the list of primary authors. More... | |
utility::vector1< AuthorNames > const & | co_authors () const |
Access the list of coauthors. More... | |
utility::vector1< AuthorNames > const & | senior_authors () const |
Access the list of senior authors. More... | |
int | year () const |
Get the year. More... | |
std::string const & | article_title () const |
Get the article title. More... | |
std::string const & | journal_title () const |
Get the journal title. More... | |
std::string const & | volume_issue_pages () const |
Get the volume, issue, and pages. More... | |
std::string const & | doi () const |
Get the DOI. More... | |
![]() | |
VirtualBase ()=default | |
Default constructor. More... | |
virtual | ~VirtualBase ()=default |
The virtual destructor is one of the main reasons for the VirtualBase class. More... | |
VirtualBase (VirtualBase const &)=default | |
VirtualBase (VirtualBase &&)=default | |
VirtualBase & | operator= (VirtualBase const &)=default |
VirtualBase & | operator= (VirtualBase &&)=default |
Private Member Functions | |
void | get_default_formatted_citation (std::ostream &outstream) const |
Get the formatted citation, in default format. More... | |
void | get_nature_formatted_citation (std::ostream &outstream) const |
Get the formatted citation, in Nature format. More... | |
void | parse_authors (std::string const §ion_name, utility::vector1< AuthorNames > &destination, utility::vector1< std::string > const &lines) |
Given a list of lines, parse out a list of author names from a block of the format: [BEGIN_SECTION_NAME] "Given names" "Surname" "Initials" "Given names" "Surname" "Initials" "Given names" "Surname" "Initials" [END_SECTION_NAME]. More... | |
void | parse_year (utility::vector1< std::string > const &lines) |
Given a list of lines, parse out an integer from a block of the format: [BEGIN_YEAR] 1982 [END_YEAR]. More... | |
void | parse_string_entry (std::string const §ion_name, std::string &destination, utility::vector1< std::string > const &lines) |
Given a list of lines, parse out a string from a block of the format: [BEGIN_SECTION_NAME] The string to parse out [END_SECTION_NAME]. More... | |
Private Attributes | |
utility::vector1< AuthorNames > | primary_authors_ |
utility::vector1< AuthorNames > | co_authors_ |
utility::vector1< AuthorNames > | senior_authors_ |
int | year_ = 0 |
std::string | article_title_ = "" |
std::string | journal_title_ = "" |
std::string | volume_issue_pages_ = "" |
std::string | doi_ = "" |
Data structure for storing a citation.
|
default |
Constructor.
basic::citation_manager::Citation::Citation | ( | std::string const & | citation_as_string | ) |
Initialization constructor.
Initializes from input string. Below is an example of the format: [BEGIN_CITATION] [BEGIN_PRIMARY_AUTHORS] "Bobo" "Dang" "B" "Haifan" "Wu" "H" "Vikram Khipple" "Mulligan" "VK" [END_PRIMARY_AUTHORS] [BEGIN_COAUTHORS] "Marco" "Mravic" "M" "Yibing" "Wu" "Y" "Thomas" "Lemmin" "T" "Alexander" "Ford" "A" "Daniel-Adriano" "Silva" "D-A" "David" "Baker" "D" [END_COAUTHORS] [BEGIN_SENIOR_AUTHORS] "William" "DeGrado" "WF" [END_SENIOR_AUTHORS] [BEGIN_YEAR] 2017 [END_YEAR] [BEGIN_TITLE] De novo design of covalently constrained mesosize protein scaffolds with unique tertiary structures [END_TITLE] [BEGIN_JOURNAL] Proc Natl Acad Sci USA [END_JOURNAL] [BEGIN_VOLUME_ISSUE_PAGES] 114(41):10852–10857 [END_VOLUME_ISSUE_PAGES] [BEGIN_DOI] 10.1073/pnas.1710695114 [END_DOI] [END_CITATION]
References initialize_from_string().
|
default |
Copy constructor.
|
overridedefault |
void basic::citation_manager::Citation::add_co_author | ( | std::string const & | given_names, |
std::string const & | surname, | ||
std::string const & | initials | ||
) |
Add a co-author.
Must be added in order of appearance.
References co_authors_.
void basic::citation_manager::Citation::add_primary_author | ( | std::string const & | given_names, |
std::string const & | surname, | ||
std::string const & | initials | ||
) |
Add a primary author.
Must be added in order of appearance.
References primary_authors_.
void basic::citation_manager::Citation::add_senior_author | ( | std::string const & | given_names, |
std::string const & | surname, | ||
std::string const & | initials | ||
) |
Add a primary author.
Must be added in order of appearance.
References senior_authors_.
|
inline |
void basic::citation_manager::Citation::clear | ( | ) |
Completely clear the data in this citation.
References article_title_, co_authors_, doi_, journal_title_, primary_authors_, senior_authors_, volume_issue_pages_, and year_.
Referenced by pyrosetta.bindings.pose.ResidueLabelAccessor::discard(), and initialize_from_string().
CitationOP basic::citation_manager::Citation::clone | ( | ) | const |
|
inline |
Access the list of coauthors.
References co_authors_.
|
inline |
|
private |
Get the formatted citation, in default format.
References article_title_, conf::author, co_authors_, doi_, journal_title_, primary_authors_, senior_authors_, volume_issue_pages_, and year_.
Referenced by get_formatted_citation().
void basic::citation_manager::Citation::get_formatted_citation | ( | std::ostream & | outstream, |
CitationFormat const | format = CitationFormat::DefaultStyle |
||
) | const |
Get this citation as a string, in a particular format.
References enumerate_junctions::default, basic::citation_manager::DefaultStyle, pyrosetta.tests.distributed.test_dask::format, get_default_formatted_citation(), get_nature_formatted_citation(), basic::citation_manager::NatureStyle, and utility_exit_with_message.
|
private |
Get the formatted citation, in Nature format.
References article_title_, conf::author, co_authors_, doi_, journal_title_, primary_authors_, senior_authors_, volume_issue_pages_, and year_.
Referenced by get_formatted_citation().
void basic::citation_manager::Citation::initialize_from_string | ( | std::string const & | citation_as_string | ) |
Initializes from a string formatted as in the Rosetta database. See initialization constructor's description for an example.
Calls clear() before initializing.
References article_title_, clear(), co_authors_, doi_, errmsg(), journal_title_, solution_counts::lines, parse_authors(), parse_string_entry(), parse_year(), primary_authors_, runtime_assert_string_msg, senior_authors_, utility::split_by_newlines(), utility::strip(), and volume_issue_pages_.
Referenced by Citation().
|
inline |
|
private |
Given a list of lines, parse out a list of author names from a block of the format: [BEGIN_SECTION_NAME] "Given names" "Surname" "Initials" "Given names" "Surname" "Initials" "Given names" "Surname" "Initials" [END_SECTION_NAME].
Stores the result in destination.
References line, solution_counts::lines, utility::quoted_split(), runtime_assert_string_msg, and utility::strip().
Referenced by initialize_from_string().
|
private |
Given a list of lines, parse out a string from a block of the format: [BEGIN_SECTION_NAME] The string to parse out [END_SECTION_NAME].
Stores the result in destination.
References line, solution_counts::lines, runtime_assert_string_msg, and utility::strip().
Referenced by initialize_from_string().
|
private |
Given a list of lines, parse out an integer from a block of the format: [BEGIN_YEAR] 1982 [END_YEAR].
Stores the result in year_.
References line, solution_counts::lines, runtime_assert_string_msg, utility::strip(), and year_.
Referenced by initialize_from_string().
|
inline |
Access the list of primary authors.
References primary_authors_.
|
inline |
Access the list of senior authors.
References senior_authors_.
void basic::citation_manager::Citation::set_year_and_article | ( | int const | year_in, |
std::string const & | article_title, | ||
std::string const & | journal_title, | ||
std::string const & | volume_issue_pages, | ||
std::string const & | doi | ||
) |
Set the year, article title, journal title, and the string for the volume/issue/pages.
References article_title(), article_title_, doi(), doi_, journal_title(), journal_title_, runtime_assert_string_msg, volume_issue_pages(), volume_issue_pages_, and year_.
|
inline |
Get the volume, issue, and pages.
References volume_issue_pages_.
Referenced by set_year_and_article().
|
inline |
Get the year.
References year_.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by clear(), get_default_formatted_citation(), get_nature_formatted_citation(), parse_year(), set_year_and_article(), and year().