transformToVector: Transform A Vector Of Gene Names Into A Vector Of 0 And 1

View source: R/overallSimilarity.R

transformToVectorR Documentation

Transform A Vector Of Gene Names Into A Vector Of 0 And 1

Description

Given a vector of genes that represents a genome, transform it into a simple sugar degradation enzyme profile as a vector of 0 and 1. A 0 indicates the gene represented by element name is absent in the genome, and a 1 indicates its presence.

Usage

transformToVector(geneVec, allGenes)

Arguments

geneVec

A vector of gene names, represented by 3-5 characters, such as "eno", this vector includes all simple sugar degradation enzymes present in a microbial genome of interest.

allGenes

A vector containing all (unique) sugar degradation genes of interest.

Value

A named vector of 0 and 1, indicating whether each sugar degradation enzyme, represented by the element's name, is presetn in the geneVec.

Examples

## Not run: 
 ED <- microCompet::EnzymeDistribution
 allGenes <- ED$Gene
 geneVec <- ED$Gene[4:25]
 genomeVec <- transformToVector(geneVec, allGenes)
 genomeVec

## End(Not run)


MolyWang/microCompet documentation built on Feb. 26, 2023, 9:29 p.m.