- Open the command line
- Navigate to the galaxy directory
- Create a
galaxy/tools/moonshot/directory:mkdir tools/moonshot
- Clone this repository:
git clone https://github.com/Moonshot-SEP/Code-to-SPIF-Tool.git tools/moonshot/Code-to-SPIF-Tool
- Change the galaxy tool-configuration at
config/tool_conf.xml.sampleby adding:
<section name="Moonshot" id="moonshot">
<tool file="moonshot/Code-to-SPIF-Tool/zip_to_spif.xml" />
</section>before
<!--
<section id="interactivetools" name="Interactive tools">
<tool file="interactive/interactivetool_askomics.xml" />
<tool file="interactive/interactivetool_bam_iobio.xml" />
<tool file="interactive/interactivetool_cellxgene_0.16.2.xml" />
<tool file="interactive/interactivetool_cellxgene_1.1.1.xml" />
<tool file="interactive/interactivetool_ethercalc.xml" />
<tool file="interactive/interactivetool_guacamole_desktop.xml" />
<tool file="interactive/interactivetool_hicbrowser.xml" />
<tool file="interactive/interactivetool_jupyter_notebook_1.0.0.xml" />
<tool file="interactive/interactivetool_jupyter_notebook.xml" />
<tool file="interactive/interactivetool_neo4j.xml" />
<tool file="interactive/interactivetool_openrefine.xml" />
<tool file="interactive/interactivetool_phinch.xml" />
<tool file="interactive/interactivetool_rstudio.xml" />
</section>
-->- Open the command line
- Navigate to the galaxy directory
- Run galaxy:
sh run.sh
- Open galaxy in your browser
- Navigate to the Convert code to SPIF tool under the Moonshot header in the Tools column.
- Upload a zip file:
- Click on the "..."-button (Browse or Upload Datasets)
- Click on the "Upload"-button
- Click on the "Choose local file"-button
- Select the zip file you want to convert
- Click on the "Start"-button
- Wait until the file-row becomes green
- Click on the "Cancel"-button
- Select the zip file:
- Click on the "..."-button (Browse or Upload Datasets)
- Click on the zip file that you just uploaded
- Click on the "Ok"-button
- Pick a language:
- Click on the dropdown menu (Java by default)
- Click on the language you want the tool to convert files of from the zip file
- Click on "Run Tool"-button
Run the command:
python -m unittest discover -s tests
Add -v flag at the end for more detailed testing
Depending on how your python environment is set up the command can also be:
python3 -m unittest discover -s tests
Note: Strikethrough means that they don't have to be implemented directly as they just serve as parrent classes for other classes that must be implemented or are already all defined in java.owl.
[ ] Thing[ ] AccessModifier(Defined in java.owl)- AnnotationType
[ ] Artifact- ClassType
[ ] CodeEntity[ ] ComplexType- Constructor
[ ] Datatype- EnumerationType
- ExceptionType
- Field
- File
- InterfaceType
- Method
[ ] Namespace(It has JavaPackage which extends NameSpace)[ ] Nothing- Parameter
- PrimitiveTypes
[ ] SeonThing- Variable
- JavaPackage
- accessesField
- catchesException
- constructorIsInvokedBy
- containsCodeEntity
- declaresConstructor
- declaresField
- declaresMethod
[ ] dependsOn- expectsDatatype
- hasAccessModifier
[ ] hasChild- hasDatatype
- hasNamespaceMember
- hasParameter
[ ] hasParent- hasReturnType
- hasSubClass
- hasSubInterface
[ ] hasSubtype- hasSuperClass
- hasSuperInterface
[ ] hasSuperType- implementsInterface
- instantiatesClass
- invokesConstructor
- invokesMethod
- isAccessedBy
- isCaughtBy
- isDatatypeOf
- isDeclaredConstructorOf
- isDeclaredFieldOf
- isDeclaredMethodOf
- isExpectedDatatype
- isImplementedBy
- isInstantiatedBy
- isNamespaceMemberOf
- isParameterOf
- isReturnTypeOf
- isThrownBy
- methodIsInvokedBy
- throwsException
- usesComplexType
- hasCodeIdentifier
- hasDoc
- hasIdentifier
- hasLength
- hasPosition
- isAbstract
- isConstant
- isStatic
- startsAt
- hasJavaDoc
- isStaticComplexType (on ComplexType)
- isExternalImport (on ComplexType, on ExceptionType and on Datatype)
- isNestedNamespaceIn (namespeace -> namespace)
- hasNestedNamespaceMember (namespeace -> namespace)
- isNestedComplexTypeIn (complexType -> complexType)
- hasNestedComplexTypeMember (complexType -> complexType)
[ ] Thing[ ] AccessModifier[] AnnotationType[ ] Artifact- ClassType
[ ] CodeEntity[ ] ComplexType- Constructor
[ ] Datatype- EnumerationType
- ExceptionType
- Field
- File
- InterfaceType
- Method
- Namespace
[ ] Nothing- Parameter
- PrimitiveTypes
[ ] SeonThing- Variable
[ ] JavaPackage
- accessesField (Language Server)
- catchesException (Language Server)
- constructorIsInvokedBy (Language Server)
- containsCodeEntity
- declaresConstructor
- declaresField
- declaresMethod
[ ] dependsOn- expectsDatatype (partially Language Server)
- hasAccessModifier
[ ] hasChild- hasDatatype (partially Language Server)
- hasNamespaceMember (does not take into consideration nested complexTypes and nested namespaceTypes, for this separate edges were added)
- hasParameter
[ ] hasParent- hasReturnType (partially Language Server)
- hasSubClass (Language Server)
[ ] hasSubInterface(not applicable to CPP)[ ] hasSubtype- hasSuperClass (Language Server)
[ ] hasSuperInterface(not applicable to CPP)[ ] hasSuperType- implementsInterface (Language Server, header files are considered to be interfaces)
- instantiatesClass (Language Server)
- invokesConstructor (Language Server)
- invokesMethod (Language Server)
- isAccessedBy (Language Server)
- isCaughtBy (Language Server)
- isDatatypeOf (partially Language Server)
- isDeclaredConstructorOf
- isDeclaredFieldOf
- isDeclaredMethodOf
- isExpectedDatatype (partially Language Server)
- isImplementedBy (Language Server, header files are considered to be interfaces)
- isInstantiatedBy (Language Server)
- isNamespaceMemberOf (does not take into consideration nested complexTypes and nested namespaceTypes, for this separate edges were added)
- isParameterOf
- isReturnTypeOf (partially Language Server)
- isThrownBy (Language Server)
- methodIsInvokedBy (Language Server)
- throwsException (Language Server)
- usesComplexType
- hasCodeIdentifier
[ ]hasDoc (ANTRL does not check comments)[ ] hasIdentifier(Do not need as it serves as a superclass for hasCodeIdentifier and every node has the property hasCodeIdentifier)- hasLength
- hasPosition
- isAbstract
- isConstant
- isStatic
- startsAt
[ ]hasJavaDoc (this is CPP)
- isNestedNamespaceIn (namespeace -> namespace)
- hasNestedNamespaceMember (namespeace -> namespace)
- isNestedComplexTypeIn (complexType -> complexType)
- hasNestedComplexTypeMember (complexType -> complexType)
- isStaticVariable (on Variable)
In cpp, in order to to implement data from cpp file A.cpp into B.cpp, you have to create the A.h file, and include it into B.cpp to use the functionality of the "interface" of A.h implemented in A.cpp. Thus, edges like "invokesMethod", "invokesConstrucot", "accessesField", etc. that start in B.cpp can only reffer to nodes from the A.h file, due to lsp limitations. To fix this, we have added the implementsInterface edge and pair from the node of the A.cpp file to the node fo the A.h file and vice versa to add a sensible connection from the specification of nodes to their implementation. Also, due to lsp and antlr limitations, there is no context for #include clauses to see what .cpp file implements what .h file, so we can check either only the first lines before a context is encountered, or check all the lines for #include statements using lsp, for which we have found no way of computing. Thus, we assume the #inlcude statement is at the start of the file, before any contex of antlr can be found.
For automated installation of Galaxy and the Moonshot tools (including SPIF-to-SVIF-Tool), see the Andromeda Ansible playbooks: Software-Analytics-Visualisation-Team/andromeda-ansible.