network.plot: Creates network structure of top elements

View source: R/network.plot.R

network.plotR Documentation

Creates network structure of top elements

Description

Given a top_pairs object (result of the top_pairs_analysis function), creates a network to visualize the elements involved in the top scoring pairs and their links

Usage

  network.plot(top_pairs, filepathroot=NULL)

Arguments

top_pairs

An object of class 'top_pairs' created by the top_pairs_analysis function

filepathroot

The root of the full path name for the output file. Default is NULL (a "NETWORK.pdf" file will be created). If not NULL, the filepathroot will have the "_NETWORK.pdf" extension.

Value

A network representing links between elements in the top scoring pairs

Author(s)

Antoine GARNIER

Examples

  #File path for output file
  wd <- tempdir()
  #wd <-getwd() 
  file <- file.path(wd,"test_omes") 

  #Importing MSA file
  msf <- system.file("msa/toy_align.msf", package = "Bios2cor")
  align <- import.msf(msf)

  #Creating OMES correlation object for positions with gap ratio < 0.2
  omes <- omes(align, gap_ratio= 0.2)
  
  #Selecting a correlation matrix
  omes <-omes$Zscore
   
  #Analyzing pairs with top scores and creating 'top_pairs' object
  top_pairs <- top_pairs_analysis(omes, top = 25, file)

  #Plotting the network structure of top pairs in pdf file 
  network.plot(top_pairs, file)

Bios2cor documentation built on July 8, 2022, 5:05 p.m.