Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions agr_indexer/src/main/java/org/alliancegenome/indexer/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,7 @@ public static void main(String[] args) {
log.info("Args[" + i + "]: " + args[i]);
}

ExecutorService parallelExecutor = Executors.newFixedThreadPool(10);
ExecutorService sequentialExecutor = Executors.newFixedThreadPool(1);

for (String type : parallelMap.keySet()) {
if (argumentSet.size() == 0 || argumentSet.contains(type)) {
log.info("Running Parallel for: " + type);
parallelExecutor.execute(indexers.get(type));
//indexers.get(type).start();
} else {
log.info("Not Starting: " + type);
}
}

for (String type : sequentialMap.keySet()) {
if (argumentSet.size() == 0 || argumentSet.contains(type)) {
Expand All @@ -90,29 +79,41 @@ public static void main(String[] args) {
log.info("Not Starting: " + type);
}
}

parallelExecutor.shutdown();
while (!parallelExecutor.isTerminated()) {
sequentialExecutor.shutdown();
while (!sequentialExecutor.isTerminated()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
ExceptionCatcher.report(e);
e.printStackTrace();
}
}
log.info("Finished Running Curation Indexers");
sequentialExecutor.shutdown();
while (!sequentialExecutor.isTerminated()) {
log.info("Finished Running Sequential Indexers");


ExecutorService parallelExecutor = Executors.newFixedThreadPool(10);

for (String type : parallelMap.keySet()) {
if (argumentSet.size() == 0 || argumentSet.contains(type)) {
log.info("Running Parallel for: " + type);
parallelExecutor.execute(indexers.get(type));
//indexers.get(type).start();
} else {
log.info("Not Starting: " + type);
}
}
parallelExecutor.shutdown();
while (!parallelExecutor.isTerminated()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
ExceptionCatcher.report(e);
e.printStackTrace();
}
}
log.info("Finished Running Neo4j Indexers");
log.info("Finished Running Parallel Indexers");

log.debug("Waiting for Indexers to finish");
log.debug("Waiting for ALL Indexers to finish");
for (Indexer i : indexers.values()) {
try {
if (i.isAlive()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void main(String[] args) throws Exception {
String taxonCurie = species.getTaxon() != null ? species.getTaxon().getCurie() : "null";
Integer order = species.getPhylogeneticOrder();
String fullName = species.getFullName();
System.out.println(" " + fullName + " | taxon: " + taxonCurie + " | phylogeneticOrder: " + order);
System.out.println(fullName + " | taxon: " + taxonCurie + " | phylogeneticOrder: " + order);

if (species.getTaxon() != null && order != null) {
String taxonIdPart = taxonCurie.replace("NCBITaxon:", "");
Expand All @@ -41,15 +41,15 @@ public static void main(String[] args) throws Exception {
System.out.println("\n=== Species order lookup map ===");
speciesOrderLookup.entrySet().stream()
.sorted(Map.Entry.comparingByValue())
.forEach(e -> System.out.println(" " + e.getKey() + " -> " + e.getValue()));
.forEach(e -> System.out.println(e.getKey() + " -> " + e.getValue()));

// Test buildSpeciesOrder for a specific taxon (e.g. Xenopus laevis 8355)
String testTaxon = args.length > 0 ? args[0] : "NCBITaxon:8355";
System.out.println("\n=== buildSpeciesOrder for " + testTaxon + " ===");
HashMap<String, Integer> speciesOrder = buildSpeciesOrder(speciesOrderLookup, testTaxon);
speciesOrder.entrySet().stream()
.sorted(Map.Entry.comparingByValue())
.forEach(e -> System.out.println(" " + e.getKey() + " -> " + e.getValue()));
.forEach(e -> System.out.println(e.getKey() + " -> " + e.getValue()));

System.out.println("\nDone.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public enum IndexerConfig {

// Curation Indexers

// Run Sequentially -- typically take a lot of RAM or do consolidation in memory
ReleaseInfoIndexer("release", ReleaseInfoIndexer.class, 1, 1, 1, 1, 1, false),

// Run Parallelly
ParalogyIndexer("paralogy", GeneToGeneParalogyIndexer.class, 4, 5000, 5000, 8, 1, true),
AffectedGenomicModelAnnotationIndexer("agmAnnotation", AGMAnnotationCurationIndexer.class, 4, 1500, 1500, 8, 1, true),
Expand All @@ -44,16 +47,13 @@ public enum IndexerConfig {
DiseaseSummaryIndexer("diseaseSummary", DiseaseSummaryCurationIndexer.class, 4, 1500, 1500, 4, 1, true),
TransgenicAlleleIndexer("transgenicAlleles", TransgenicAlleleCurationIndexer.class, 1, 3000, 1500, 8, 1, true),
GeneExpressionRibbonSummaryIndexer("geneExpressionRibbonSummary", GeneExpressionRibbonSummaryIndexer.class, 1, 1, 1, 1, 1, true),
ReleaseInfoIndexer("release", ReleaseInfoIndexer.class, 1, 1, 1, 1, 1, true),

// Run Sequentially -- typically take a lot of RAM or do consolidation in memory
DiseaseSearchResultIndexer("diseaseSearchResult", DiseaseSearchResultCurationIndexer.class, 8, 50, 50, 4, 1, false),
GOSearchResultCurationIndexer("goSearchResult", GOSearchResultCurationIndexer.class, 4, 1500, 1500, 4, 1, false),
AlleleSummaryIndexer("alleleSummary", AlleleSummaryCurationIndexer.class, 4, 1500, 1500, 4, 1, false),
GeneToGeneOrthologyIndexer("geneToGeneOrthology", GeneToGeneOrthologyIndexer.class, 4, 2500, 2500, 8, 1, false),
GeneMolecularInteractionIndexers("geneMolecularInteraction", GeneMolecularInteractionCurationIndexer.class, 4, 1500, 1500, 2, 1, false),
PhenotypeAnnotationIndexer("phenotypeAnnotation", PhenotypeAnnotationCurationIndexer.class, 4, 1500, 1500, 2, 1, false),
DiseaseAnnotationIndexer("diseaseAnnotation", DiseaseAnnotationCurationIndexer.class, 1, 1500, 1500, 2, 1, false),
DiseaseSearchResultIndexer("diseaseSearchResult", DiseaseSearchResultCurationIndexer.class, 8, 50, 50, 4, 1, true),
GOSearchResultCurationIndexer("goSearchResult", GOSearchResultCurationIndexer.class, 4, 1500, 1500, 4, 1, true),
AlleleSummaryIndexer("alleleSummary", AlleleSummaryCurationIndexer.class, 4, 1500, 1500, 4, 1, true),
GeneToGeneOrthologyIndexer("geneToGeneOrthology", GeneToGeneOrthologyIndexer.class, 4, 2500, 2500, 8, 1, true),
GeneMolecularInteractionIndexers("geneMolecularInteraction", GeneMolecularInteractionCurationIndexer.class, 4, 1500, 1500, 2, 1, true),
PhenotypeAnnotationIndexer("phenotypeAnnotation", PhenotypeAnnotationCurationIndexer.class, 4, 1500, 1500, 2, 1, true),
DiseaseAnnotationIndexer("diseaseAnnotation", DiseaseAnnotationCurationIndexer.class, 1, 1500, 1500, 2, 1, true),
;

private String typeName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ public List<AlleleSearchResultDocument> convert(List<AlleleSummaryDocument> alle
}

if (doc.getAlleleOfGene() != null && doc.getAlleleOfGene().getGeneSymbol() != null) {
String geneSymbol = doc.getAlleleOfGene().getGeneSymbol().getDisplayText();
String geneSymbol = doc.getAlleleOfGene().getGeneSymbol().getFormatText();
if (taxon != null) {
geneSymbol = geneSymbol + " (" + taxon.getName() + ")";
Species geneSpecies = taxon.getSpecies();
if (geneSpecies != null) {
geneSymbol = geneSymbol + " (" + geneSpecies.getAbbreviation() + ")";
} else {
geneSymbol = geneSymbol + " (" + taxon.getName() + ")";
}
}
searchDoc.setGenes(List.of(geneSymbol));
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
<checkstyle.version>10.17.0</checkstyle.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<curation.version>v0.47.20</curation.version>
<curation.version>v0.47.21</curation.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
Loading