Skip to content

Commit

Permalink
Merge pull request #333 from Rothamsted/201902_pubfilter
Browse files Browse the repository at this point in the history
201902 pubfilter
  • Loading branch information
KeywanHP authored Feb 22, 2019
2 parents fa1df88 + 60a332e commit ef56be8
Showing 1 changed file with 9 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,12 @@ public Set<QTL> findQTL(String keyword) throws ParseException {
ConceptClass ccSNP = graph.getMetaData().getConceptClass("SNP");

// no Trait-QTL relations found
if (ccTrait == null && (ccQTL == null || ccSNP == null)) {
if (ccTrait == null && (ccQTL == null || ccSNP == null) ) {
return new HashSet<QTL>();
}

// no keyword provided
if (keyword==null || keyword.equals("")) {
return new HashSet<QTL>();
}

Expand Down Expand Up @@ -2457,8 +2462,8 @@ public String writeEvidenceTable(String keywords, HashMap<ONDEXConcept, Float> l
// All publications will have the format PMID:15487445
//if (type == "Publication" && !name.contains("PMID:"))
// name = "PMID:" + name;
// Do not print publications or proteins in evidence view
if (type == "Publication" || type == "Protein") {
// Do not print publications or proteins or enzymes in evidence view
if (type == "Publication" || type == "Protein" || type == "Enzyme") {
continue;
}
Float score = luceneConcepts.get(lc);
Expand Down Expand Up @@ -2501,16 +2506,6 @@ public String writeEvidenceTable(String keywords, HashMap<ONDEXConcept, Float> l
if (mapGene2QTL.containsKey(log)) {
numberOfQTL++;

// for(Integer cid : mapGene2QTL.get(log)){
// ONDEXConcept qtl = graph.getConcept(cid);
// String traitDesc =
// qtl.getAttribute(attTrait).getValue().toString();
//
// if (infoQTL == "")
// infoQTL += traitDesc + "//" + traitDesc;
// else
// infoQTL += "||" + traitDesc + "//" + traitDesc;
// }
}

String chr = null;
Expand Down Expand Up @@ -2541,85 +2536,11 @@ public String writeEvidenceTable(String keywords, HashMap<ONDEXConcept, Float> l
if (qtlChrom.equals(chr) && beg >= qtlStart && beg <= qtlEnd) {

numberOfQTL++;
// if (infoQTL == "")
// infoQTL += loci.getLabel() + "//" +
// loci.getTrait();
// else
// infoQTL += "||" + loci.getLabel() + "//" +
// loci.getTrait();

}
}
}

// int chr = 0, beg = 0, end = 0;
// Double cm = 0.00;
// if (graph.getConcept(log).getAttribute(attChr) != null) {
// chr = (Integer)
// graph.getConcept(log).getAttribute(attChr).getValue();
// }
// else if (graph.getConcept(log).getAttribute(attScaf) !=
// null) {
// chr = (Integer)
// graph.getConcept(log).getAttribute(attScaf).getValue();
// }
// if (graph.getConcept(log).getAttribute(attBeg) != null) {
// beg = (Integer)
// graph.getConcept(log).getAttribute(attBeg).getValue();
// }
// if (graph.getConcept(log).getAttribute(attEnd) != null) {
// end = (Integer)
// graph.getConcept(log).getAttribute(attEnd).getValue();
// }
// if (attCM != null) {
// if (graph.getConcept(log).getAttribute(attCM) != null) {
// cm = (Double)
// graph.getConcept(log).getAttribute(attCM).getValue();
// }
// }
// if(!qtls.isEmpty()){
// for(QTL loci : qtls) {
// try{
// Integer qtlChrom =
// chromBidiMap.inverseBidiMap().get(loci.getChrName());
// Long qtlStart = Long.parseLong(loci.getStart());
// Long qtlEnd = Long.parseLong(loci.getEnd());
//
// if (cm != null) {
// if((qtlChrom == chr) && (cm >= qtlStart) && (cm <=
// qtlEnd)){
// if (!evidenceQTL.contains(loci)) {
// numberOfQTL++;
// evidenceQTL.add(loci);
// if (infoQTL == "")
// infoQTL += loci.getLabel() + "//" + loci.getTrait();
// else
// infoQTL += "||" + loci.getLabel() + "//" +
// loci.getTrait();
// }
// }
// }
// else {
// if((qtlChrom == chr) && (beg >= qtlStart) && (end <=
// qtlEnd)){
// if (!evidenceQTL.contains(loci)) {
// numberOfQTL++;
// evidenceQTL.add(loci);
// if (infoQTL == "")
// infoQTL += loci.getLabel() + "//" + loci.getTrait();
// else
// infoQTL += "||" + loci.getLabel() + "//" +
// loci.getTrait();
// }
// }
// }
// }
// catch(Exception e){
// System.out.println("An error occurred in method:
// writeEvidenceOut.");
// System.out.println(e.getMessage());
// }
// }
// }
}

// omit last comma from user_genes String
Expand Down

0 comments on commit ef56be8

Please sign in to comment.