/**
  * This method is used to dump all human pathway diagrams into a specified directory.
  *
  * @param dir
  * @throws Exception
  */
 public void dumpHumanPathwayDiagrams(File dir) throws Exception {
   Collection<?> diagrams = adaptor.fetchInstancesByClass(ReactomeJavaConstants.PathwayDiagram);
   SchemaClass cls = adaptor.fetchSchema().getClassByName(ReactomeJavaConstants.PathwayDiagram);
   SchemaAttribute att = cls.getAttribute(ReactomeJavaConstants.representedPathway);
   adaptor.loadInstanceAttributeValues(diagrams, att);
   // Group all human pathways
   for (Iterator<?> it = diagrams.iterator(); it.hasNext(); ) {
     GKInstance diagram = (GKInstance) it.next();
     GKInstance pathway =
         (GKInstance) diagram.getAttributeValue(ReactomeJavaConstants.representedPathway);
     GKInstance species = (GKInstance) pathway.getAttributeValue(ReactomeJavaConstants.species);
     if (species == null) continue;
     if (species.getDBID().equals(48887L)) {
       String fileName = getFileName(pathway);
       File file = new File(dir, fileName);
       convertReactomeToGPML(pathway, file.getAbsolutePath());
     }
   }
 }