Difference between revisions of "Jwoodlee Week 14"

From LMU BioDB 2015
Jump to: navigation, search
(Milestone 3: Species Profile Creation: added non customized procedure)
(Milestone 3: Species Profile Creation: added procedure)
Line 1: Line 1:
 
=== Milestone 3: Species Profile Creation ===
 
=== Milestone 3: Species Profile Creation ===
 +
Majority of the procedure was from [[Coder | here]].
 
==== Adding a Species Profile to GenMAPP Builder ====
 
==== Adding a Species Profile to GenMAPP Builder ====
  
All of this work happens in the ''Java'' perspective, so switch to that first if you’re not already there.
+
In the Java perspective within Eclipse(change perspective on the top right), the following was executed.
  
 
====== Create the Species Profile ======
 
====== Create the Species Profile ======
  
# Expose the contents of the ''src'' folder.
+
# I exposed the contents of the ''src'' folder in my gmbuilder project.
# Right-click on the ''edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles'' package and choose '''New > Class''' from the popup menu.
+
# Right-clicked on the ''edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles'' package and chose '''New > Class''' from the popup menu.
# In the dialog that appears, enter the following:
+
# In the dialog that appears, I entered the following:
#* '''Name:''' <code>''name-of-your-species-without-spaces''UniProtSpeciesProfile</code> (in ''camel case'': no spaces, capitalizing the first letters of each word)
+
#* '''Name:''' <code>ShigellaflexneriUniProtSpeciesProfile</code>
#* '''Superclass:''' <code>edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles.UniProtSpeciesProfile</code> (you can also click on ''Browse...'' to navigate to this if you don’t feel like typing)
+
#* '''Superclass:''' <code>edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles.UniProtSpeciesProfile</code>
# Click ''Finish''. There should now be a new ''.java'' file within the ''edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles'' package (the one you just created).
+
# Clicked ''Finish''. A new ''.java'' file within the ''edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles'' package was created.
  
 
====== Customize the Species Profile ======
 
====== Customize the Species Profile ======
  
* Open the file that you have just created. It should appear in the editor area of Eclipse.
+
* I opened the file that I just created.
* Override the method that supplies the name of the species and the description of the profile: add the following constructor block right below the ''public class'' line in the new file. Remember to customize according to your particular species; the portions that need to be customized are highlighted in asterisks.
+
* I added the following constructor block right below the ''public class'' line in the new file.
  public ***NameOfYourSpecies***UniProtSpeciesProfile() {
+
  public ShigellaflexneriUniProtSpeciesProfile() {
     super("***Genus species***",
+
     super("Shigella flexneri",
         ***taxonIDOfYourSpecies***,
+
         623,
 
         "This profile customizes the GenMAPP Builder export for " +
 
         "This profile customizes the GenMAPP Builder export for " +
             "***Genus species***" +
+
             "Shigella flexneri" +
 
             " data loaded from a UniProt XML file.");
 
             " data loaded from a UniProt XML file.");
 
  }
 
  }
* To customize the species profile with the species name in the OrderedLocusNames record of the Systems table as well as a link query for that same record, add the following method block right below the constructor block that you added above.  Again, the key information to customize is highlighted in asterisks.
+
* I added the following method block right below the constructor block that I added above.
 
  @Override
 
  @Override
 
  public TableManager getSystemsTableManagerCustomizations(TableManager tableManager, DatabaseProfile dbProfile) {
 
  public TableManager getSystemsTableManagerCustomizations(TableManager tableManager, DatabaseProfile dbProfile) {
Line 35: Line 36:
 
     tableManager.submit("Systems", QueryType.update, new String[][] {
 
     tableManager.submit("Systems", QueryType.update, new String[][] {
 
         { "SystemCode", "N" },
 
         { "SystemCode", "N" },
         { "Link", "***species-specific-database-link***" }
+
         { "Link", "http://www.mgc.ac.cn/cgi-bin/ShiBASE/ShiBASE_query.cgi?synonym=~" }
 
     });
 
     });
 
   
 
   
 
     return tableManager;
 
     return tableManager;
 
  }
 
  }
* Note the '''species-specific-database-link''' placeholder above. This is a species-specific URL that returns a web page describing a gene for that species. It should look like a standard URL, with the tilde ('''~''') standing in for the gene ID. For example, the link for ''Vibrio cholerae'' is <code>http://bacteria.ensembl.org/Multi/Search/Results?species=all;idx=;q=~;site=ensemblunit</code>. The link for ''Plasmodium falciparum'' is <code>http://plasmodb.org/plasmo/showRecord.do?name=GeneRecordClasses.GeneRecordClass&project_id=PlasmoDB&source_id=~</code>. Work with your GenMAPP User and/or QA to determine the appropriate URL for your species.
+
* I chose ''Organize Imports'' from the ''Source'' menu to make sure I had everything imported.
* Your code may have a red error badge at this point; assuming you typed everything in exactly, the fix for this is to choose ''Organize Imports'' from the ''Source'' menu. If the red error badge persists, make sure that you typed everything in correctly.
+
* Save the file and see if these changes worked (see below).
+
 
+
Additional customization, particularly with regard to the exported data, will depend on the species. Communicate with your QA to see if additional customization is needed. If the additional customization is not too complicated, you might be able to do the work yourself with some instructions. However, if the customization is too difficult, Dr. Dionisio will probably be the one to do the work.
+
  
 
====== Add the Species Profile to the Catalog of Known Species Profiles ======
 
====== Add the Species Profile to the Catalog of Known Species Profiles ======
  
The last step involves actually making GenMAPP Builder ''know'' that your new species profile exists. This involves a change in an existing file:
+
* Under ''edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles'', I opened ''UniProtDatabaseProfile.java''.
* Under ''edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles'', open ''UniProtDatabaseProfile.java''.
+
 
* Near the top of the file is a block that looks like this:
 
* Near the top of the file is a block that looks like this:
 
  super("org.uniprot.uniprot.Uniprot",
 
  super("org.uniprot.uniprot.Uniprot",
Line 59: Line 55:
 
     new PlasmodiumFalciparumUniProtSpeciesProfile(),
 
     new PlasmodiumFalciparumUniProtSpeciesProfile(),
 
     new VibrioCholeraeUniprotSpeciesProfile() });
 
     new VibrioCholeraeUniprotSpeciesProfile() });
* What you want to do is add the species profile that you just created to this block. If your species profile is called ''MySpecialUniProtSpeciesProfile'', your modified code should look like this:
+
* I added the species profile that I created to the block.
 
  super("org.uniprot.uniprot.Uniprot",
 
  super("org.uniprot.uniprot.Uniprot",
 
     "This profile defines the requirements "
 
     "This profile defines the requirements "
Line 68: Line 64:
 
     new PlasmodiumFalciparumUniProtSpeciesProfile(),
 
     new PlasmodiumFalciparumUniProtSpeciesProfile(),
 
     new VibrioCholeraeUniprotSpeciesProfile(),
 
     new VibrioCholeraeUniprotSpeciesProfile(),
     new MySpecialUniProtSpeciesProfile() });
+
     new ShigellaflexneriUniProtSpeciesProfile() });
* Essentially, you need to add an item to the comma-separated list, beginning with ''new'', followed by the species profile name, finally followed by ''()''.
+
 
* Save your changes, do ''Organize Imports'' to eliminate any red errors, and try a test build!
+
* I saved changes and selected ''Organize Imports''.
  
 
====== Build, Test, and Possibly Commit ======
 
====== Build, Test, and Possibly Commit ======
  
# Create a new distribution of GenMAPP Builder based on [[#Creating a Distribution|Creating a Distribution]].
+
# I created a new distribution of GenMAPP Builder.
# Perform a new export run with this version of GenMAPP Builder (you can skip the import steps and use the same PostgreSQL database if it’s available).
+
#*Expanded the custom project, scrolled down the build.xml and right clicked it.  In the menu that appeared I clicked on Ant Build... (with ellipses).  Now in the menu that appeared I deselected dist, and selected clean, dist in that order.  The build order was now clean, dist so it will wipe the current version of genmappbuilder and create a new distribution.  I clicked run.
# Check the ''Systems'' table in the resulting ''.gdb'' to see if it contains the custom information:
+
# With Trixie, we performed a new export run with this custom version of GenMAPP Builder.  A new .gdb was created.
#* Open the ''.gdb'' in Microsoft Access, then open the ''Systems'' table.
+
# I checked the ''Systems'' table in the resulting ''.gdb'' with Microsoft Access and verified that it contained the custom information:
#* Look for the record for ''OrderedLocusNames''. Your species name should appear under the ''Species'' column and your link URL should appear under the ''Link'' column.
+
#* The record ''OrderedLocusNames'' was there with the species name under the ''Species'' column and our link URL under the ''Link'' column.
# If all goes well, commit your code as described in [[#Updating and Committing Code|Updating and Committing Code]].  You have now officially contributed to the XMLPipeDB project ''':)'''
+
# I then committed the custom version of GenMAPP builder to our GitHub branch.
 
+
 
+
  
  

Revision as of 23:57, 3 December 2015

Milestone 3: Species Profile Creation

Majority of the procedure was from here.

Adding a Species Profile to GenMAPP Builder

In the Java perspective within Eclipse(change perspective on the top right), the following was executed.

Create the Species Profile
  1. I exposed the contents of the src folder in my gmbuilder project.
  2. Right-clicked on the edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles package and chose New > Class from the popup menu.
  3. In the dialog that appears, I entered the following:
    • Name: ShigellaflexneriUniProtSpeciesProfile
    • Superclass: edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles.UniProtSpeciesProfile
  4. Clicked Finish. A new .java file within the edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles package was created.
Customize the Species Profile
  • I opened the file that I just created.
  • I added the following constructor block right below the public class line in the new file.
public ShigellaflexneriUniProtSpeciesProfile() {
    super("Shigella flexneri",
        623,
        "This profile customizes the GenMAPP Builder export for " +
            "Shigella flexneri" +
            " data loaded from a UniProt XML file.");
}
  • I added the following method block right below the constructor block that I added above.
@Override
public TableManager getSystemsTableManagerCustomizations(TableManager tableManager, DatabaseProfile dbProfile) {
    super.getSystemsTableManagerCustomizations(tableManager, dbProfile);
    tableManager.submit("Systems", QueryType.update, new String[][] {
        { "SystemCode", "N" },
        { "Species", "|" + getSpeciesName() + "|" }
    });

    tableManager.submit("Systems", QueryType.update, new String[][] {
        { "SystemCode", "N" },
        { "Link", "http://www.mgc.ac.cn/cgi-bin/ShiBASE/ShiBASE_query.cgi?synonym=~" }
    });

    return tableManager;
}
  • I chose Organize Imports from the Source menu to make sure I had everything imported.
Add the Species Profile to the Catalog of Known Species Profiles
  • Under edu.lmu.xmlpipedb.gmbuilder.databasetoolkit.profiles, I opened UniProtDatabaseProfile.java.
  • Near the top of the file is a block that looks like this:
super("org.uniprot.uniprot.Uniprot",
    "This profile defines the requirements "
        + "for any UniProt centric gene database.",
    new SpeciesProfile[] {
    new EscherichiaColiUniProtSpeciesProfile(),
    new ArabidopsisThalianaUniProtSpeciesProfile(),
    new PlasmodiumFalciparumUniProtSpeciesProfile(),
    new VibrioCholeraeUniprotSpeciesProfile() });
  • I added the species profile that I created to the block.
super("org.uniprot.uniprot.Uniprot",
    "This profile defines the requirements "
        + "for any UniProt centric gene database.",
    new SpeciesProfile[] {
    new EscherichiaColiUniProtSpeciesProfile(),
    new ArabidopsisThalianaUniProtSpeciesProfile(),
    new PlasmodiumFalciparumUniProtSpeciesProfile(),
    new VibrioCholeraeUniprotSpeciesProfile(),
    new ShigellaflexneriUniProtSpeciesProfile() });
  • I saved changes and selected Organize Imports.
Build, Test, and Possibly Commit
  1. I created a new distribution of GenMAPP Builder.
    • Expanded the custom project, scrolled down the build.xml and right clicked it. In the menu that appeared I clicked on Ant Build... (with ellipses). Now in the menu that appeared I deselected dist, and selected clean, dist in that order. The build order was now clean, dist so it will wipe the current version of genmappbuilder and create a new distribution. I clicked run.
  2. With Trixie, we performed a new export run with this custom version of GenMAPP Builder. A new .gdb was created.
  3. I checked the Systems table in the resulting .gdb with Microsoft Access and verified that it contained the custom information:
    • The record OrderedLocusNames was there with the species name under the Species column and our link URL under the Link column.
  4. I then committed the custom version of GenMAPP builder to our GitHub branch.


Follow the instructions in the Adding a Species Profile to GenMAPP Builder section of this wiki page in order to:

  • Add a species profile to the GenMAPP Builder code base.
  • Customize the species profile with the species name in the OrderedLocusNames record of the Systems table.
  • Customize the Link field in the OrderedLocusNames record of the Systems table to hold a URL query with ~ standing in for the gene ID.
    • (with QA) The URL would need to be determined first, of course.

Milestone 4: Species Export Customization

  1. Based on observations from the GenMAPP User and QA, determine and document (as thoroughly as possible) any other modified export behavior that GenMAPP Builder will have to manifest for this species.
  2. Implement this export behavior.
  3. As needed, commit and push your work to your GitHub branch.
  4. Additional milestones will depend on how the rest of the project goes, and the bugs/features generated by that work.
  5. Document/log all work done, problems encountered, and how they were resolved.
  6. When your work is complete, issue a GitHub pull request to merge your branch into the main development line.