use of ubic.gemma.model.common.description.CitationValueObject in project Gemma by PavlidisLab.
the class ShortBibliographicReferenceTag method doStartTag.
@Override
public int doStartTag() throws JspException {
ShortBibliographicReferenceTag.log.debug("start tag");
StringBuilder buf = new StringBuilder();
if (this.citation == null) {
buf.append("No accession");
} else {
String authorList = citation.getAuthorList();
if (authorList != null) {
String[] authors = StringUtils.split(authorList, ";");
// if there are authors, only display the first author
if (authors.length == 0) {
} else if (authors.length == 1) {
buf.append(authors[0]).append(" ");
} else {
buf.append(authors[0]).append(" et al. ");
}
} else {
buf.append("Null author list");
}
// display the publication year
Calendar pubDate = new GregorianCalendar();
Date publicationDate = citation.getPublicationDate();
if (publicationDate != null) {
pubDate.setTime(publicationDate);
buf.append("(").append(pubDate.get(Calendar.YEAR)).append(") ");
} else {
buf.append("Null publication date");
}
// add pubmed link
if (citation.getPubAccession() != null) {
String pubMedId = citation.getPubAccession().getAccession();
CitationValueObject citationVO = CitationValueObject.convert2CitationValueObject(citation);
if (StringUtils.isNotBlank(pubMedId)) {
String link = citationVO.getPubmedURL();
buf.append("<a target='_blank' href='").append(link).append("' ><img src='").append(Settings.getRootContext()).append("/images/pubmed.gif' /> </a> ");
/*
* Add link to edit page within Gemma
*/
buf.append("<a target='_blank' href='").append(Settings.getRootContext()).append("/bibRef/bibRefView.html?accession=").append(pubMedId).append("'><img src='").append(Settings.getRootContext()).append("/images/magnifier.png' /></a>");
}
}
}
try {
pageContext.getOut().print(buf.toString());
} catch (Exception ex) {
throw new JspException(this.getClass().getName() + ex.getMessage());
}
return Tag.SKIP_BODY;
}
use of ubic.gemma.model.common.description.CitationValueObject in project Gemma by PavlidisLab.
the class PhenotypeAssociationTest method createLiteratureEvidence.
private void createLiteratureEvidence(int geneNCBIid, String uri) {
this.litEvidence = new LiteratureEvidenceValueObject(-1L);
this.litEvidence.setDescription("Test Description");
this.litEvidence.setEvidenceCode("TAS");
this.litEvidence.setGeneNCBI(geneNCBIid);
this.litEvidence.setClassName("LiteratureEvidenceValueObject");
CitationValueObject citationValueObject = new CitationValueObject();
citationValueObject.setPubmedAccession("1");
ExternalDatabaseValueObject externalDatabaseValueObject = new ExternalDatabaseValueObject();
externalDatabaseValueObject.setName(PhenotypeAssociationTest.TEST_EXTERNAL_DATABASE);
EvidenceSourceValueObject evidenceSourceValueObject = new EvidenceSourceValueObject("url_link", externalDatabaseValueObject);
SortedSet<CharacteristicValueObject> phenotypes = new TreeSet<>();
CharacteristicValueObject characteristicValueObject = new CharacteristicValueObject(-1L, uri);
phenotypes.add(characteristicValueObject);
this.litEvidence.setPhenotypes(phenotypes);
SortedSet<PhenotypeAssPubValueObject> phenotypeAssPubVO = new TreeSet<>();
PhenotypeAssPubValueObject phenotypeAssPubValueObject = new PhenotypeAssPubValueObject();
phenotypeAssPubValueObject.setType("Primary");
phenotypeAssPubValueObject.setCitationValueObject(citationValueObject);
phenotypeAssPubVO.add(phenotypeAssPubValueObject);
this.litEvidence.setPhenotypeAssPubVO(phenotypeAssPubVO);
this.litEvidence.setEvidenceSource(evidenceSourceValueObject);
// those extra fields tell us where the phenotype came from if different than the one given
this.litEvidence.setPhenotypeMapping(PhenotypeMappingType.INFERRED_CURATED.toString());
this.litEvidence.setOriginalPhenotype("Original Value Test");
ValidateEvidenceValueObject e = this.phenotypeAssociationManagerService.makeEvidence(this.litEvidence);
assertNull(e);
}
use of ubic.gemma.model.common.description.CitationValueObject in project Gemma by PavlidisLab.
the class BibliographicReferenceControllerImpl method showAllForExperiments.
@Override
public ModelAndView showAllForExperiments(HttpServletRequest request, HttpServletResponse response) {
Map<ExpressionExperiment, BibliographicReference> eeToBibRefs = bibliographicReferenceService.getAllExperimentLinkedReferences();
// map sorted in natural order of the keys
SortedMap<CitationValueObject, Collection<ExpressionExperimentValueObject>> citationToEEs = new TreeMap<>();
for (Entry<ExpressionExperiment, BibliographicReference> entry : eeToBibRefs.entrySet()) {
if (entry.getValue().getTitle() == null || entry.getValue().getTitle().isEmpty() || entry.getValue().getAuthorList() == null || entry.getValue().getAuthorList().isEmpty()) {
continue;
}
CitationValueObject cvo = CitationValueObject.convert2CitationValueObject(entry.getValue());
if (!citationToEEs.containsKey(cvo)) {
citationToEEs.put(cvo, new ArrayList<ExpressionExperimentValueObject>());
}
ExpressionExperiment ee = entry.getKey();
ee.setBioAssays(null);
ee.setAccession(null);
ee.setExperimentalDesign(null);
citationToEEs.get(cvo).add(new ExpressionExperimentValueObject(ee));
}
return new ModelAndView("bibRefAllExperiments").addObject("citationToEEs", citationToEEs);
}
use of ubic.gemma.model.common.description.CitationValueObject in project Gemma by PavlidisLab.
the class PhenotypeAssPubValueObject method createRelevantPublication.
public static PhenotypeAssPubValueObject createRelevantPublication(String accession) {
CitationValueObject citationValueObject = new CitationValueObject();
citationValueObject.setPubmedAccession(accession);
PhenotypeAssPubValueObject phenotypeAssPubValueObject = new PhenotypeAssPubValueObject();
phenotypeAssPubValueObject.setType(PhenotypeAssPubValueObject.RELEVANT);
phenotypeAssPubValueObject.setCitationValueObject(citationValueObject);
return phenotypeAssPubValueObject;
}
use of ubic.gemma.model.common.description.CitationValueObject in project Gemma by PavlidisLab.
the class PhenotypeAssPubValueObject method createPrimaryPublication.
public static PhenotypeAssPubValueObject createPrimaryPublication(String accession) {
CitationValueObject citationValueObject = new CitationValueObject();
citationValueObject.setPubmedAccession(accession);
PhenotypeAssPubValueObject phenotypeAssPubValueObject = new PhenotypeAssPubValueObject();
phenotypeAssPubValueObject.setType(PhenotypeAssPubValueObject.PRIMARY);
phenotypeAssPubValueObject.setCitationValueObject(citationValueObject);
return phenotypeAssPubValueObject;
}
Aggregations