Learn R Programming

hpoPlot (version 1.0)

suggest.aspect.ratio.width.to.height: Suggest Aspect Ratio For Plot

Description

Suggests a width to height aspect ratio for an HPO term plot based on the number of terms which are to be plotted.

Usage

suggest.aspect.ratio.width.to.height(hpo.terms, list.of.patients.or.vector.of.terms)

Arguments

hpo.terms
An R-Object representing the HPO, as returned by get.hpo.terms.
list.of.patients.or.vector.of.terms
List of vectors of terms or vector of terms which are to be plotted.

Value

  • Scalar value of suggested aspect ratio.

Examples

Run this code
data(hpo)

	patients.character.vector <- c(
		A="HP:0001382,HP:0004272,HP:0007917,HP:0004912,HP:0001596",
		B="HP:0001382,HP:0004272,HP:0002165,HP:0004800,HP:0004912",
		C="HP:0004800,HP:0001382,HP:0004912,HP:0007917,HP:0008743",
		D="HP:0001257,HP:0001382,HP:0007917,HP:0012623,HP:0002165",
		E="HP:0007917,HP:0004800,HP:0004272,HP:0001596,HP:0002165" 
	)

	patients.of.interest <- term.set.list.from.character(hpo.terms, patients.character.vector)

	height=10 

#	pdf(
#		"test.pdf", 
#		height=height,
#		width=height * suggest.aspect.ratio.width.to.height(
#			hpo.terms,
#			patients.of.interest
#		)
#	)
#
#	hpo.graph(
#		hpo.terms=hpo.terms,
#		patients=patients.of.interest,
#		main.title="Simple Example",
#		filter.out.uninformative=TRUE
#	)
#
#	dev.off()

Run the code above in your browser using DataLab