Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimal example in groovy #4

Open
reality opened this issue Nov 11, 2019 · 0 comments
Open

minimal example in groovy #4

reality opened this issue Nov 11, 2019 · 0 comments

Comments

@reality
Copy link

reality commented Nov 11, 2019

Hello,

Thanks for the software - it was a bit difficult to get running, though. I thought I'd post this minimal Groovy example here, in case you'd like to include it in the README, or in case anyone else tries to run it and could use a hand. Also fixes a couple of issues/omissions from the Java version.

@Grapes([
  @GrabResolver(name='compbio', root='https://compbio.charite.de/tl_files/maven'),
  @Grab(group='annotation-simulation', module='annotation-simulation', version='0.0.1-SNAPSHOT'),
  @Grab(group='phenologizer', module='phenologizer', version='0.0.4-SNAPSHOT'),
  @GrabConfig(systemClassLoader=true)
])

import drseb.*
import ontologizer.ontology.*
import hpo.ItemId.ItemDatabase;
import groovy.json.*                                                                                                                          

// Parameters 
def ontologyFile = './hp.obo'
def annotationFile = './phenotype_annotation.tab'
def id = "114030";

// Generate patients
def simulator = new AnnotationSimulator(ontologyFile, annotationFile, OntologyProjectType.HPO);
def patients = simulator.simulatePatients(ItemDatabase.OMIM, id, 1000, 0.2, 0.4, 2, 10);

// Output
def json = JsonOutput.toJson(patients)
new File('patients.json').write(json)

println 'done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant