Skip to content

Columns of PWM must add up to 1.0 #30

@laurapspector

Description

@laurapspector

I call getPwmFromFastaFile() to create a pwm from a FASTA file. The pwm has 8 columns. Then I call diffLogoFromPwm() and get the following error:

Error in preconditionPWM(pwm1) : Columns of PWM must add up to 1.0.

However, the sum of the columns is indeed 1 (see below).

> pwm1 <- getPwmFromFastaFile(<fasta_file1>, alphabet=FULL ALPHABET)
> pwm2 <- getPwmFromFastaFile(<fasta_file2>, alphabet=FULL ALPHABET)
> diffLogoFromPwm(pwm1 = pwm1, pwm2 = pwm2)
[1] "pwm must be of class matrix or data.frame. Trying to convert"
[1] "pwm must be of class matrix or data.frame. Trying to convert"
Error in preconditionPWM(pwm1) : Columns of PWM must add up to 1.0
> apply(pwm1, 2, sum)
1 2 3 4 5 6 7 8 
1 1 1 1 1 1 1 1 
> any(abs(1 - apply(pwm1, 2, sum)) > 0.01)
[1] FALSE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions