SynBioDex / libSBOLj

Java Library for Synthetic Biology Open Language (SBOL)
Apache License 2.0
37 stars 24 forks source link

Corrections to code example for constructing a CRISPR circuit PDF #415

Closed minnatwang closed 7 years ago

minnatwang commented 7 years ago

Some parts of the code example for constructing a CRISPR circuit PDF are unclear or don't cover steps that the user encounters in Eclipse. I'd suggest the instructions be updated as follows:

[EDIT 12.19]

3ach commented 7 years ago

Hi Minna -- the SBOLValidationException gives reference to a specific SBOL validation rule which may help you in diagnosing your problem. Your screenshot does not give the full error code, but it begins sbol-1060. Take a peek at the SBOL specification for more information on that group of errors, and please post the full validation rule identifier so that we can help diagnose the issue.

cjmyers commented 7 years ago

Hi Minna,

The full validation error message is:

Exception in thread "main" org.sbolstandard.core2.SBOLValidationException: sbol-10604: The URI contained by the definition property MUST refer to a ComponentDefinition object. Reference: SBOL Version 2.1.0 Section 7.7.1 on page 26 : http://sbols.org/CRISPR_Example/CRPb_characterization_circuit/1.0 at org.sbolstandard.core2.ModuleDefinition.createFunctionalComponent(ModuleDefinition.java:644) at org.sbolstandard.core2.ModuleDefinition.createFunctionalComponent(ModuleDefinition.java:601) at org.sbolstandard.core2.examples.CopyOfRepressionModel.main(CopyOfRepressionModel.java:201)

If you examine the line of code that is causing, it you find:

    CRPb_circuit.createFunctionalComponent(
            "EYFP",
            AccessType.PRIVATE,
            "EYFP",
            version,
            DirectionType.NONE);

The message is stating essentially that the ComponentDefinition for EYFP cannot be found. On page 8, second paragraph, it says "Other ComponentDefinition objects can be created using the same set of method calls. As an exercise, the reader is encouraged to specify them according to Table 1 and 2.” Perhaps, we should not use the word “encouraged”, since it will not work if you don’t do this step. The tutorial is not meant to give you complete code but representative code. The user is expected to follow the patterns and write their own code. So, perhaps we should change the text to, “As an exercise, the reader should next create the ComponentDefinitions specified in Table 1 and 2."

On Nov 28, 2016, at 7:31 AM, Zach Zundel notifications@github.com wrote:

Hi Minna -- the SBOLValidationException gives reference to a specific SBOL validation rule which may help you in diagnosing your problem. Your screenshot does not give the full error code, but it begins sbol-1060. Take a peek at the SBOL specification http://sbolstandard.org/wp-content/uploads/2016/10/BBF-RFC112-SBOL2.1.0.pdf#page=76 for more information on that group of errors, and please post the full validation rule identifier so that we can help diagnose the issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SynBioDex/libSBOLj/issues/415#issuecomment-263201556, or mute the thread https://github.com/notifications/unsubscribe-auth/ADWD95r5984NXUTVnNosHOUPLxc7x3bsks5rCoNngaJpZM4K9W-D.

cjmyers commented 7 years ago

These are good suggestions. One comment though is I’m not sure we want to make it easy to cut and paste code from the tutorial. Shouldn’t the users be forced to type this themselves? We need to make sure that there is actually some thought going into building it, so the user actually learns how to use the library. I think the action of typing them (plus the additional pieces of code we don’t provide) is crucial to the user’s understanding process.

Minna: after completing the tutorial, do you feel like if you were given a similar diagram and asked to create it using libSBOLj that you could? The goal of the tutorial is to ensure that people doing it would be able to port their knowledge into using the library within their own application.

minnatwang commented 7 years ago

Thanks for the feedback. I'll go through and finish the code based on what's in the tables.

@cjmyers, I would say it still might be good practice to make the text boxes copy-paste friendly. There are some segments, such as the sequences for CRa_U6 promoter and others in the same box, that would be difficult and tedious to type. If we do want to discourage readers from copying and pasting, we could include screenshots rather than text, but I don't recommend it.

In reference to page 8 paragraph 2, I'd suggest we change to the following: "As an exercise, the reader should next create the ComponentDefinitions specified in Table 1 and 2. Please note that the code will not run correctly unless these ComponentDefinitions are created." with the last piece in bold or italicized or a different color--whatever will make it stand out.

If I were given a similar diagram and asked to create it, I think I could do it. This tutorial seems to be fairly comprehensive.

minnatwang commented 7 years ago

@cjmyers, will most circuits being modeled with SBOL be a similar level of complexity and have as many elements as this one? If not, it might be useful to include a tutorial for a smaller, simpler circuit and let the user choose which tutorial to follow in the beginning. It'd be more work, but it could help the user get used to the software and not be overwhelmed. But if this is a fairly basic synthetic biology circuit, or it's doubtful that scientists would feel overwhelmed, it probably wouldn't be worth it.

cjmyers commented 7 years ago

Additional tutorials would be wonderful focusing on different aspects. The current one covers a lot of the classes but not all. Additional smaller ones could target additional aspects, which would be nice. BTW: developers will not build SBOL for designs directly like this. Instead they will build software that, for example provides a GUI for design, such as our SBOLDesigner tool. The software will need to call these methods though to convert the user input into SBOL data objects.

Please try adding the following code at the bottom of your solution to validate and compare your result with an existing solution. Change path to where you put the attached file.

    SBOLValidate.validateSBOL(doc, true, true, true);
    if (SBOLValidate.getNumErrors() > 0) {
        for (String error : SBOLValidate.getErrors()) {
            System.out.println(error);
        }
        return;
    }
    //SBOLWriter.write(doc, "/Users/myers/RepressionModel.rdf");
    SBOLDocument doc2 = SBOLReader.read("/Users/Myers/RepressionModel.rdf");
    SBOLValidate.compareDocuments("Mine", doc, "Solution", doc2);

Note there will be differences in the GenericTopLevel due to a known bug. No other differences should be reported though.

On Dec 7, 2016, at 10:37 PM, Minna Wang notifications@github.com wrote:

@cjmyers https://github.com/cjmyers, will most circuits being modeled with SBOL be a similar level of complexity and have as many elements as this one? If not, it might be useful to include a tutorial for a smaller, simpler circuit and let the user choose which tutorial to follow in the beginning. It'd be more work, but it could help the user get used to the software and not be overwhelmed. But if this is a fairly basic synthetic biology circuit, or it's doubtful that scientists would feel overwhelmed, it probably wouldn't be worth it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SynBioDex/libSBOLj/issues/415#issuecomment-265657518, or mute the thread https://github.com/notifications/unsubscribe-auth/ADWD9_rPUmSDF_bz8Mg2DAxAYHtsGvkvks5rF5ejgaJpZM4K9W-D.

mehersam commented 7 years ago

Done.