top_pairs_analysis {Bios2cor} | R Documentation |
Calculates the number of contacts for each element of the top pairs
Description
Given a correlation object, calculates the number of pairs (contacts) each element in the top X pairs are involved in
Usage
top_pairs_analysis(corr_matrix, filepathroot, top=25, entropy=NULL, filter=NULL)
Arguments
corr_matrix |
One of the matrices created by a correlation/covariation function ( |
filepathroot |
The root of the full path names of the output files for top_pairs_analysis. If NULL, two csv files are created in tempdir(): TOPn_CONTACTS.csv and TOPn_SCORES.csv, where n is the number of top pairs). If not NULL, extentions "_TOPn_CONTACTS.csv" and "_TOPn_SCORES.csv" are added to the filepathroot. |
top |
A integer indicating the number of top pairs used for this analysis. Default is 25. |
entropy |
An object created by the entropy or dynamic_entropy function. Default is NULL. |
filter |
A vector created by the |
Details
This function sorts element pairs by correlation/covariation scores and analyzes the top X pairs to determine the number of pairs (contacts) each element of the top X pairs is involved in. If filter is TRUE, only the scores of elements in the delta filter defined entropy range are taken into account. Results are written as .csv files.
Value
returns an object of class 'top_pairs' which is a named list of four elements for subsequent network representation with the network.plot
function:
pair_i |
a vector containing the name of element i in the ordered top pairs |
pair_j |
a vector containing the name of element j in the ordered top pairs |
positions |
a vector containing the positions in the top n pairs |
contacts |
a vector containing the number of contacts of the positions in the top n pairs |
returns also two .csv files containing scores and contacts of the top n pairs for subsequent network representation with Cytoscape.
Author(s)
Antoine GARNIER and Marie CHABBERT
Examples
#File path for output files
out <- tempdir()
file <- file.path(out,"test_seq")
#Importing MSA file
msf <- system.file("msa/toy_align.msf", package = "Bios2cor")
align <- import.msf(msf)
#Creating entropy object
entropy <- entropy(align)
#Creating OMES correlation object
omes <- omes(align, gap_ratio = 0.2)
#Selecting correlation matrix
omes <-omes$Zscore
#Creating top_pairs object and writing scores and contacts to csv files
top_pairs <- top_pairs_analysis(omes, file, top = 25, entropy=entropy)