Skip to content

Commit

Permalink
t.display_name bug and new pathways data
Browse files Browse the repository at this point in the history
  • Loading branch information
kkarra committed Jan 13, 2020
1 parent b42bb35 commit 143a2bc
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class SgdConverter extends BioDBConverter {
private static final String TAXON_ID = "4932";
private Item organism;
private Map<String, String> featureMap = new HashMap();
private static final boolean TEST_LOCAL = true;
private static final boolean TEST_LOCAL = false;
private String licence;


Expand Down Expand Up @@ -135,12 +135,11 @@ public void process() throws Exception {
processRegulation(connection);
processRegulationSummary(connection);

processPathways(connection);
storePathways();

if(TEST_LOCAL) {

processPathways(connection);
storePathways();

processPhysicalInteractions(connection);
processGeneticInteractions(connection);
storeInteractionTypes();
Expand Down Expand Up @@ -181,7 +180,6 @@ private void processGenes(Connection connection) throws SQLException,
String symbol = res.getString("gene_name");
String name = res.getString("name_description");
String feature_type = res.getString("feature_type");
System.out.println("feature TYpe got from SQL is " + feature_type);
String headline = res.getString("headline");
String description = res.getString("description");
String qualifier = res.getString("qualifier");
Expand Down Expand Up @@ -250,7 +248,6 @@ private void processGenes(Connection connection) throws SQLException,

// set for all types, so you can use LSF to query for these
// different type of objects in a template.
System.out.println("feature Type is...."+ feature_type);
item.setAttribute("featureType", feature_type);
item.setAttribute("primaryIdentifier", primaryIdentifier);
if (StringUtils.isNotEmpty(name)) item.setAttribute("name", name);
Expand Down Expand Up @@ -608,10 +605,11 @@ private void processPathways(Connection connection)
String dbxref_name = res.getString("display_name"); //pathway identifier i.e. short name
String summary_type = res.getString("summary_type");
String text = res.getString("text");
String refNo = res.getString("reference_id"); // refs for pathways

Item item = genes.get(geneFeatureNo);
if (item != null) {
getPathway(item.getIdentifier(), dbxref_id, dbxref_name, summary_type, text);
getPathway(item.getIdentifier(), dbxref_id, dbxref_name, summary_type, text, refNo);
}
}
}
Expand Down Expand Up @@ -1927,17 +1925,18 @@ private void processAllPubs(Connection connection) throws SQLException,
String referenceNo = res.getString("dbentity_id");
String pubMedId = res.getString("pmid");
String title = res.getString("title");
String volume = res.getString("volume");
String pages = res.getString("page");
String year = res.getString("year");
String issue = res.getString("issue");
String citation = res.getString("citation");
String topic = res.getString("topic");
String journal = res.getString("med_abbr");
String volume = res.getString("volume");
String pages = res.getString("page");
String year = res.getString("year");
String issue = res.getString("issue");
String abst = res.getString("fulltext_status");
String abstractText = res.getString("text");
String dbxrefid = res.getString("sgdid");
String date_created = res.getString("date_created");

System.out.println(abstractText);
if (firstrow) {
prevReferenceNo = referenceNo;
firstrow = false;
Expand All @@ -1963,11 +1962,12 @@ private void processAllPubs(Connection connection) throws SQLException,
prevYear = year;
prevIssue = issue;
prevPages = pages;
prevAbst = abst;
prevAbst = abstractText;
prevDbxRef = dbxrefid;
prevDateCreated = date_created;

}

// process the very last reference group
getPub(prevReferenceNo, prevTitle, prevPubMedId, prevCitation, hm,
prevJournal, prevVolume, prevPages, prevYear, prevIssue,
Expand Down Expand Up @@ -2699,7 +2699,7 @@ private String getSynonym(String subjectId, String type, String value)
}


private String getPathway(String geneIdentifier, String id, String name, String summaryType, String text)
private String getPathway(String geneIdentifier, String id, String name, String summaryType, String text, String refNo)
throws ObjectStoreException {

Item crf = pathways.get(id);
Expand All @@ -2709,13 +2709,26 @@ private String getPathway(String geneIdentifier, String id, String name, String
crf.setAttribute("identifier", id);
crf.setAttribute("name", name);
crf.setAttribute("summaryType", summaryType);
crf.setAttribute("text", text);
if (!StringUtils.isEmpty(text)) { crf.setAttribute("text", text);}

Item publication = publications.get(refNo);
if(publication == null) {
publication = createItem("Publication");
publications.put(refNo, publication);
}
crf.addToCollection("publications", publication);

pathways.put(id, crf);

crf.addToCollection("genes", geneIdentifier);

}else{
Item publication = publications.get(refNo);
if(publication == null) {
publication = createItem("Publication");
publications.put(refNo, publication);
}
crf.addToCollection("publications", publication);
crf.addToCollection("genes", geneIdentifier);
}

Expand Down Expand Up @@ -2879,7 +2892,7 @@ private String getLiteratureTopic(String topic) throws ObjectStoreException {

private void getPub(String referenceNo, String title, String pubMedId,
String citation, ArrayList hm, String journal, String volume,
String pages, String year, String issue, String abst, String dbxrefid, String datecreated)
String pages, String year, String issue, String abstractText, String dbxrefid, String datecreated)
throws ObjectStoreException {

Item storedRef = publications.get(referenceNo);
Expand Down Expand Up @@ -2915,8 +2928,8 @@ private void getPub(String referenceNo, String title, String pubMedId,
if (StringUtils.isNotEmpty(issue)) {
item.setAttribute("issue", issue);
}
if (StringUtils.isNotEmpty(abst)) {
item.setAttribute("summary", abst);
if (StringUtils.isNotEmpty(abstractText)) {
item.setAttribute("abstractText", abstractText);
}
if (StringUtils.isNotEmpty(datecreated)) {
item.setAttribute("dateCreated", datecreated);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ protected ResultSet getChildrenFeatureLocationResults(Connection connection)
+ " and a2.dbentity_id = d2.dbentity_id "
+ " and d2.dbentity_id = ld.dbentity_id "
+ " and a.taxonomy_id = t.taxonomy_id "
+ " and t.display_name = 'Saccharomyces cerevisiae S288c'";
+ " and t.taxid = 'TAX:559292'";
//+ " and t.display_name = 'Saccharomyces cerevisiae S288c'";

LOG.info("executing: " + query);
Statement stmt = connection.createStatement();
Expand Down Expand Up @@ -338,7 +339,7 @@ protected ResultSet getPubWithFeaturesResults(Connection connection)
protected ResultSet getPubAllResults(Connection connection)
throws SQLException {

String query = "select r.dbentity_id, r.pmid, r.fulltext_status, r.title, r.volume, r.page, r.year, r.issue,"
String query = "select r.dbentity_id, r.pmid, r.title, r.volume, r.page, r.year, r.issue,"
+ " r.citation, la.topic, j.med_abbr, rd.text, db.sgdid, db.date_created"
+ " from nex.dbentity db"
+ " inner join nex.referencedbentity r on db.dbentity_id = r.dbentity_id"
Expand Down Expand Up @@ -647,13 +648,21 @@ protected ResultSet getCrossReferences(Connection connection)
protected ResultSet getPathways(Connection connection)
throws SQLException {

String query = "select distinct db.dbentity_id, biocyc_id, db2.display_name, ps.summary_type, ps.text "
/*String query = "select distinct db.dbentity_id, biocyc_id, db2.display_name, ps.summary_type, ps.text "
+ " from nex.dbentity db, nex.pathwaydbentity pdf, nex.pathwayannotation pa, nex.dbentity db2, nex.pathwaysummary ps "
+ " where db.dbentity_id = pa.dbentity_id "
+ " and ps.pathway_id = pdf.dbentity_id "
+ " and pa.pathway_id = pdf.dbentity_id "
+ " and pdf.dbentity_id = db2.dbentity_id "
+ " order by 1";
+ " order by 1";*/

String query = "select distinct db.dbentity_id, biocyc_id, db2.display_name, ps.summary_type, ps.text, pa.reference_id" +
" from nex.dbentity db" +
" inner join nex.pathwayannotation pa on db.dbentity_id = pa.dbentity_id" +
" inner join nex.pathwaydbentity pdf on pdf.dbentity_id = pa.pathway_id" +
" inner join nex.dbentity db2 on db2.dbentity_id = pdf.dbentity_id" +
" left join nex.pathwaysummary ps on ps.pathway_id = pdf.dbentity_id" +
" order by 1";

LOG.info("executing: " + query);
Statement stmt = connection.createStatement();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private void processDataSets(Connection connection) throws SQLException,
Item dataset = getDataSet(pubmedID, fileName, geoID, platformID,
channelCount, datasetName, description, numCond, numGenes,
author, allAuthors, title, journal, pubYear, tags);
System.out.println("gene: "+geneName + " condDesc: "+ condDesc + " data_table: " + dataTable);
//System.out.println("gene: "+geneName + " condDesc: "+ condDesc + " data_table: " + dataTable);

// add score to gene - using the condition and dataset info
getConditionScore(dataset, condDesc, dataTable, geneName);
Expand Down Expand Up @@ -262,7 +262,7 @@ private Item getDataSet(String pubmedID, String fileName, String geoID,
item.addToCollection("expressiondatasettags", dtag.getIdentifier());

}
System.out.println("pubmed: "+pubmedID + " geoID: "+ geoID + " datasetName: " + datasetName);
//System.out.println("pubmed: "+pubmedID + " geoID: "+ geoID + " datasetName: " + datasetName);
datasets.put(fileName, item);
}

Expand Down Expand Up @@ -290,7 +290,6 @@ private void getConditionScore(Item dataSet, String condDesc,

String cond = expconditions[i];
String condscore = scores[i];
System.out.println("cond:" + cond + " score:"+ condscore);

Item dcond = conditions.get(cond);
if (dcond == null) {
Expand Down
11 changes: 10 additions & 1 deletion yeastmine-global_additions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,18 @@
<class name="Pathway" is-interface="true">
<attribute name="identifier" type="java.lang.String"/>
<attribute name="summaryType" type="java.lang.String"/>
<attribute name="name" type="java.lang.String"/>
<attribute name="text" type="java.lang.String"/>
<attribute name="name" type="java.lang.String"/>
<!--<reference name="summary" referenced-type="PathwaySummary"/>-->
<collection name="genes" referenced-type="Gene" reverse-reference="pathways"/>
<collection name="dataSets" referenced-type="DataSet"/>
<collection name="publications" referenced-type="Publication" reverse-reference="pathways"/>
</class>
<!--<class name="PathwaySummary" is-interface="true">
<attribute name="summaryType" type="java.lang.String"/>
<attribute name="text" type="java.lang.String"/>
<collection name="publications" referenced-type="Publication" reverse-reference="pathwaysummary"/>
</class>-->
<class name="Phenotype" is-interface="true">
<attribute name="mutantType" type="java.lang.String"/>
<attribute name="strainBackground" type="java.lang.String"/>
Expand Down Expand Up @@ -615,6 +622,8 @@
<collection name="literatureTopics" referenced-type="LiteratureTopic"/>
<collection name="crossReferences" referenced-type="DatabaseReference" reverse-reference="subject"/>
<collection name="meshTerms" referenced-type="MeshTerm" reverse-reference="publications"/>
<collection name="pathways" referenced-type="Pathway" reverse-reference="publications"/>
<!--<collection name="pathwaysummary" referenced-type="Phenotype" reverse-reference="publications"/>-->
</class>
<class name="PublicationAnnotation" is-interface="true">
<reference name="publication" referenced-type="Publication"/>
Expand Down

0 comments on commit 143a2bc

Please sign in to comment.