ge11232002 / TFBSTools

Software Package for Transcription Factor Binding Site (TFBS) Analysis
25 stars 10 forks source link

TFBS #29

Closed rehan1988 closed 3 years ago

rehan1988 commented 3 years ago

HI

I use following to form position frequency matrix library(Biostrings) d1 = list("GATGGGGTGGGCAACTTAGAACTT" , "ATAACTGT" , "CAGAGGCGAACT" , "GGGCTAGGG" , "GGGGGGTGGCAGCACTAGC" , "GGGTAATATG" , "GTCGAGCGGT" , "GGCACGGAATATACGTACT" , "T" , "GGGC" , "GCGGGCTCCTTTAATATCATTGCA" , "GTGGGCAGGATTCATTCAAGA" , "GGGAC" , "GGCGC" , "GCGG" , "GCGGCAG" , "GT") d<-alphabetFrequency(DNAStringSet(unlist(d1)))[,1:4] 

it gives me output like this

      V1       V2       V3     V4     V5

A 6 3 4 1 3 T 3 1 3 1 4 G 9 1 4 6 10 C 6 3 1 1 2

after that toPWM library(TFBSTools)

pwm <- toPWM(d, type="log2probratio", pseudocounts=0.8)  #position weight matrix 

it generates a matrix from "d"

      V1                           V2                             V3                            V4                    V5

A 0.0000000 0.5405684 0.3923174 -1.029747 -0.6293566
T -0.9541963 -0.8744691 0.0000000 -1.029747 -0.2370392 G 0.5693656 -0.8744691 0.3923174 1.339486 1.0430687 C 0.0000000 0.5405684 -1.4150375 -1.029747 -1.1699250

NOw I want to generate seqLOGO from this pwm but it gives me error /warning

library(seqLogo) p3<-makePWM(pwm) it says

Warning message: In makePWM(pwm) : Columns of PWM must add up to 1.0

slotNames(p) [1] "pwm" "consensus" "ic" "width" "alphabet"

seqLogo(p) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘seqLogo’ for signature ‘"pwm"’

Please guide me, HOw I can generate the Sequence logo from pwm. THanks

ge11232002 commented 3 years ago

Please refer to ?seqLogo,ICMatrix-method. You will need to convert to ICMatrix object first.