selex.revcomp: Create forward-reverse complement data pairs

Description Usage Arguments Details Value See Also Examples

Description

A function used to find and return the reverse complement of K-mers and the values associated with them. It is useful for calculating forward/reverse complement symmetrized values.

Usage

1
selex.revcomp(kmer,value)

Arguments

kmer

A string array representing K-mers.

value

An array of associated values.

Details

selex.revcomp finds and returns the reverse complement and associated value of every input K-mer, if it exists. If a reverse complement does not exist for a given K-mer, it is removed from the output. For example, consider the following K-mer and value arrays:

ACGT .34
GCTA .22
CGAC .98
TAGC .19

The output of selex.revcomp will be:

ACGT .34 ACGT .34
GCTA .22 TAGC .19
TAGC .19 GCTA .22

Value

selex.revcomp returns a data frame containing the original K-mers and values, along with their reverse complements and associated values.

See Also

selex.affinities, selex.counts

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Find round 2 affinities
r2Aff = selex.affinities(sample=r2, k=10, markovModel=mm)

# Find the reverse complement affinities and standard errors
Aff = selex.revcomp(kmer=r2Aff$Kmer, value=r2Aff$Affinity)
SE = selex.revcomp(kmer=r2Aff$Kmer, value=r2Aff$SE)

# Find the forward/reverse complement symmetrized Affinity and SE values
symAff = (Aff$Value+Aff$Reverse.Complement.Values)/2
symSE = sqrt((SE$Value^2+SE$Reverse.Complement.Values^2)/2)

# Final Result
final = data.frame(Kmer=Aff$Kmer, Affinity=Aff$Value, 
  SymmetrizedAffinity=symAff/max(symAff), SE=SE$Value, 
  SymmetrizedSE=symSE/max(symAff))
final = final[order(-final$SymmetrizedAffinity),]

SELEX documentation built on Nov. 8, 2020, 5:22 p.m.