singleDomainPlotting: Create architecure plot for a single protein

View source: R/createDomainPlot.R

singleDomainPlottingR Documentation

Create architecure plot for a single protein

Description

Create architecure plot for a single protein

Usage

singleDomainPlotting(df, geneID, sep, labelSize, titleSize, minStart,
    maxEnd, colorPalette, showScore, showWeight, namePosition, firstDist,
    nameType, nameSize, segmentSize, nameColor, labelPos, font)

Arguments

df

Domain dataframe for ploting containing the seed ID, ortholog ID, ortholog sequence length, feature names, start and end positions, feature weights (optional) and the status to determine if that feature is important for comparison the architecture between 2 proteins* (e.g. seed protein vs ortholog) (optional)

geneID

ID of seed or orthologous protein

sep

Separate indicator for title. Default = "|"

labelSize

Lable size. Default = 12

titleSize

Title size. Default = 12

minStart

The smallest start position of all domains

maxEnd

The highest stop position of all domains

colorPalette

Color pallete. Default = Paired"

showScore

Show/hide E-values and Bit-scores. Default = NULL (hide)

showWeight

Show/hide feature weights. Default = NULL (hide)

namePosition

List of positions for domain names, choose from "plot", "legend" or "axis". Default: "plot"

firstDist

Distance of the first domain to plot title. Default = 0.5

nameType

Type of domain names, either "Texts" or "Labels" (default)

nameSize

Size of domain names. Default = 3

segmentSize

Height of domain segment. Default = 5

nameColor

Color of domain names (for Texts only). Default = "black"

labelPos

Position of domain names (for Labels only). Choose from "Above" (default), "Below" or "Inside" the domain bar

font

font of text. Default = Arial"

Value

Domain plot of a single protein as a ggplot object.

Author(s)

Vinh Tran tran@bio.uni-frankfurt.de

See Also

parseDomainInput

Examples

seed <- "101621at6656"
ortho <- "101621at6656|AGRPL@224129@0|224129_0:001955|1"
ortho <- gsub("\\|", ":", ortho)
grepID <- paste(seed, "#", ortho, sep = "")
domainFile <- system.file(
    "extdata", "domainFiles/101621at6656.domains",
    package = "PhyloProfile", mustWork = TRUE
)
domainDf <- parseDomainInput(seed, domainFile, "file")
domainDf$feature_id_mod <- domainDf$feature_id
subdomainDf <- domainDf[grep(grepID, domainDf$seedID), ]
subdomainDf$feature <- as.character(subdomainDf$feature)
orthoDf <- subdomainDf[subdomainDf$orthoID == ortho,]
seedDf <- subdomainDf[subdomainDf$orthoID != ortho,]
minStart <- min(subdomainDf$start)
maxEnd <- max(c(subdomainDf$end, subdomainDf$length))
# resolve overlapping domains
seedDf <- PhyloProfile:::resolveOverlapFeatures(seedDf)
orthoDf <- PhyloProfile:::resolveOverlapFeatures(orthoDf)
# add feature colors
featureColorDf <- PhyloProfile:::addFeatureColors(seedDf, orthoDf)
seedDf <- featureColorDf[[1]]
orthoDf <- featureColorDf[[2]]
# do plot
g <- PhyloProfile:::singleDomainPlotting(
   seedDf, seed, minStart = minStart, maxEnd = maxEnd, font = "sans"
)
grid::grid.draw(g)

BIONF/PhyloProfile documentation built on Sept. 25, 2024, 4:46 p.m.