Hi, I try to generate BTP file from CSV file and the batch mode of using ImageGeneratorApplication class works fine in shell script. However, I want this process can be integrated into our java_based applications rather than shell mode, additionally, I found the 'regions' in generated BTP results are not sorted, which shall be displayed in Biotapestry in order, not random. Therefore, I look at the source code of an example ImageGeneratorAppTestWrapper.java that shows how to use ImageGeneratorApplication class. So far 2 problems
come up, one is 'import org.systemsbiology.biotapestry.app.ImageGeneratorApplication;' is missing, which is easy. Another one is when " // main1 (argv); main2 (argv); " is changed to "main1 (argv); // main2 (argv);" and I run it with command "java generateBTP /home/javaTest/1131323607.csv /home/javaTest/" , the following error message shows Exception in thread "main" java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer at
org.systemsbiology.biotapestry.cmd.MainCommands$ImportFullHierarchyFromCSVAction.performOperation(MainCommands.java:7470) at org.systemsbiology.biotapestry.app.ImageGeneratorApplication.process(ImageGeneratorApplication.java:282) at xxx.generateBTP.generateOrderedBTP(generateBTP.java:78) at xxx.generateBTP.main(generateBTP.java:51) I have to look inside the code of MainCommands class. Just wondering whether the code downloaded from http://www.biotapestry.org/src/BioTapestry-5.0.2-src.tar.gz is the latest ? or anyone has done similar stuff using ImageGeneratorApplication class? any example would be helpful. many thanks
Kind Regards jié zuo Email: po_...@yahoo.com Tel: +44 (0)1865 222470 Fax: +44 (0)1865 222501 |
osArgs = new Object[7];
osArgs[0] = csvCompress_;
osArgs[1] = csvMode_;
osArgs[2] = csvOverlayMode_;
osArgs[3] = new Boolean(false);
osArgs[4] = input_;
osArgs[5] = nodeIDMap_;
osArgs[6] = modelIDMap_;
The argument list was changed and the above fix was not added.
Though I have not tested the above fix, I think it should do
the trick. Let me know.
I'm not exactly sure what the issue is with the region
sorting in the BTP result? If I recall, the right-to-left
arrangement is based on a partial ordering of the regions
based on inter region links, with feedback loops removed.
I would have to go in and look at the code to remember the
tie-breaker driving the first region in the event of feedback.
Hope this helps,
Bill
> ji� zuo
>
> Email: po_...@yahoo.com
> Tel: +44 (0)1865 222470
> Fax: +44 (0)1865 222501
>
> --
> You received this message because you are subscribed to the Google
> Groups "BioTapestry-users" group.
> To post to this group, send email to biotapes...@googlegroups.com.
> To unsubscribe from this group, send email to
> biotapestry-us...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/biotapestry-users?hl=en.
thanks Bill, The replacement does fix the previous bug after I changed the ImageGeneratorApplication class, buy another exception remains that sounds related to KeysToPublish class, please have a look of error message attached, also the example csv file. Another question, is it possible to provide with org.systemsbiology.chem class (or code) that is required in MainCommands class when I tried to compile the whole class files? Or maybe I can find somewhere. many thanks. Kind Regards jié zuo |
--- On Wed, 9/21/11, William Longabaugh <wlong...@systemsbiology.org> wrote: |
|
|
|
|
|
String mod1 = (String)modelIDMap.get("ENDOMESODERM");
keysToPublish.add(new WebPublisher.ModelScale(mod1,
WebPublisher.ModelScale.SMALL));
So make sure your WebPublisher.ModelScale objects are
getting correctly built with valid internal model IDs.
As for the org.systemsbiology.chem.* classes, I would
just comment those imports out as well as the code
lines that depend on them. That command is for in-process
execution of the ISB Dizzy Simulator, and the command
is actually commented out from the menus. If you want
the classes, they are available from here:
http://magnet.systemsbiology.net/software/Dizzy/
Bill
zuo wrote:
> thanks Bill,
>
> The replacement does fix the previous bug after I changed the
> ImageGeneratorApplication class, buy another exception remains that
> sounds related to KeysToPublish class, please have a look of error
> message attached, also the example csv file.
>
> Another question, is it possible to provide with org.systemsbiology.chem
> class (or code) that is required in MainCommands class when I tried to
> compile the whole class files? Or maybe I can find somewhere.
>
> many thanks.
>
> Kind Regards
>
>
> ji� zuo
So make sure your WebPublisher.ModelScale objects are getting correctly built with valid internal model IDs. |
I am not sure about this, do you mean the example cvs file is not proper one? or some TestWrapper lines need to be modified? for example |
String mod1 = (String)modelIDMap.get("ENDOMESODERM"); |
'ENDOMESODERM' shall be changed to real model ID ? I assume the latter is my case. thanks for the link. |
--- On Thu, 9/22/11, William Longabaugh <wlong...@systemsbiology.org> wrote: |
|
|
To unsubscribe from this group, send email to biotapestry-us...@googlegroups.com.
many thanks. Now it makes sense. |
Kind Regards jié zuo Email: po_...@yahoo.com Tel: +44 (0)1865 222470 Fax: +44 (0)1865 222501 |
--- On Fri, 9/23/11, William Longabaugh <William.L...@systemsbiology.org> wrote: |
Hi, To aim to sort the regions in biotapestry when converting CSV file to BTP file by HEADLESS_IMPORT mode, I trace down the method generate() in ImageGeneratorApplication class. It sounds going by mainCommands.getOneshot (HEADLESS_IMPORT_FULL_HIERARCHY_FROM_CSV) >> importFullHierarchyFromCSVAction >> fullHierarchyCSVFormatFactory >> buildFromCSVForeground >> readCSV (stream) >> CSVImportRunner (xxx), then i don't want to go further as the application design is much more complicated than what I can cope.. One question is the method readCSV (line 590-668) in FullHierarchyCSVFormatFactory class (genome), before ValidateCSV method, will sorting the (Hash)Map regionDefs based on regions orders in csv files help my goal? More likely the process of sorting regions (& nodes) just before layout makes more sense, because model Map, Node Map and Intersection Map from ImageGeneratorAppTestWrapper class show these element IDs in the order appearing in the BTP file too. Is it possible to know which classes are related to assign values for the elements in <layouts> tag in btp files? many thanks |
If I recall correctly, the ordering is designed to be
consistent, but currently cannot be specified. The big question
depends on whether you have links between regions. If you
do, it does a topo sort on regions using the inter-regions
links to get a partial ordering. Feedback links are discarded
when building the DAG, so of course the order of evaluating
at the regions matters. I believe it is based on the internal
region ID. The sorting occurs here:
org.systemsbiology.biotapestry.ui.LayoutRubberStamper;
private Map sortRegions(Set allGroups,
Map linkTuples,
GenomeInstance gi);
With no inter-region links, I'm pretty sure it depends just
on internal ID order; I would really need to dig deep to
be able to say what drives that assignment.
The only solution I can suggest at the moment is to use
this mode:
ImageGeneratorApplication.BTP_PRE_INPUT_CSV_PRUNED
Where you feed it two files: a btp file and a csv file.
In that mode, the system will use the btp file as a guide
for doing the layout. You can create a btp file that
has JUST regions (and models) defined: no nodes or links.
The system will then use the region order in that file
to order the regions in the result. Give that a try to
see if it works for you.
I will add region order specification from CSV to the wish list.
Hope this helps.
Bill
> ji� zuo
>
> Email: po_...@yahoo.com
> Tel: +44 (0)1865 222470
> Fax: +44 (0)1865 222501
>
Many thanks, Bill. You are right, sorting regions is to show regions by some order, for example, in my case, to show networks in xenopus development stage 22, then stage 24, then stage 26... from top to down, or from left to right in one 'model'. In another 'model', the 'regions' are again shown in stage 22, stage 24, stage26.... so far, in most btp files converted from CSV files, the stage orders are interrupted rather than following the right orders showing in CSV files. If the networks are not simple, it is painful to reorganise the stage orders manually in BTP Editor. I'll try your idea. Kind Regards jié zuo |
--- On Thu, 9/29/11, William Longabaugh <wlong...@systemsbiology.org> wrote: |
|
|
|
|
|
|
Hi Bill, ImageGeneratorApplication.BTP_PRE_INPUT_CSV_PRUNED does not help me this time. I tried 2 ways to make btp files , one is HEADLESS mode by converting only 'model' and 'region' lines in a CSV file (deleting all nodes and intersections lines ), another one is manually deleting all nodes and intersections in btp Editor and move the 'regions' in order I want, then save as new btp file. Feeding ImageGeneratorApplication.BTP_PRE_INPUT_CSV_PRUNED with either btp and the CSV file could not generate the full btp file with right region order. Actually the 2 full BTP files are 99% same. I'll have a look at sortRegions () next. Kind Regards jié zuo |
--- On Thu, 9/29/11, William Longabaugh <wlong...@systemsbiology.org> wrote: |
|
|
|
|
|
|
The second method should work, though you should be sure to run
Tools->Drop All Interaction Tables Used to Build Networks
if it was built from a CSV. The .btp file you hand it should be
completely empty except for the model tree and the pre-arranged
regions.
I have attached an example btp and csv file. When run as follows:
$JAVAHOME/bin/java -Xmx512m \
-classpath "$PIPETESTDIR/sBioTapestry-J15-V5.0.2.jar" \
org.systemsbiology.biotapestry.app.ImageGeneratorAppTestWrapper \
test3InB.btp pruneTest2.csv $IMAGEOUTDIR
My test shows what I expect, that the two submodels use the
pre-arranged region order. I'm not sure why your approach is
not working.
-- Bill
>
> Feeding ImageGeneratorApplication.BTP_PRE_INPUT_CSV_PRUNED with either
> btp and the CSV file could not generate the full btp file with right
> region order. Actually the 2 full BTP files are 99% same.
>
> I'll have a look at sortRegions () next.
>
> Kind Regards
>
>
> ji� zuo
many thanks, bill. I'll try again and let you know. |
--- On Tue, 10/4/11, William Longabaugh <wlong...@systemsbiology.org> wrote: |
|
|
|
-----Inline Attachment Follows----- |
Hi, This method of ImageGeneratorApplication.BTP_PRE_INPUT_CSV_PRUNED works very well to produce 'sorted' btp files, although the original codes requires some modification. many thanks for the help. Another question, can the btp file be processed with pure XML tools like dom4j ? I tried dom4j 1.6.1 with full btp files but errors come up, are lines in files like "<gene name ="gata2" id ="0" / >" the problem as without close marker </ gene>? thanks . |
Kind Regards jié zuo Email: po_...@yahoo.com Tel: +44 (0)1865 222470 Fax: +44 (0)1865 222501 --- On Tue, 10/4/11, William Longabaugh <wlong...@systemsbiology.org> wrote: |
|
|
Another question, can the btp file be processed with pure XML tools like dom4j ? I tried dom4j 1.6.1 with full btp files but errors come up, are lines in files like "<gene name ="gata2" id ="0" / >" the problem as without close marker </ gene>?
Bill, apologises. it is my typo, when I generate btp files, leave a blank between '/' and '>'. I test it again, and surely dom4j can handle it. many thanks. |
--- On Thu, 10/13/11, William Longabaugh <William.L...@systemsbiology.org> wrote: |
|
|
|
|