Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFM just accepts vectors? #310

Closed
felipe-mansoldo opened this issue Aug 9, 2024 · 2 comments
Closed

PFM just accepts vectors? #310

felipe-mansoldo opened this issue Aug 9, 2024 · 2 comments

Comments

@felipe-mansoldo
Copy link

Hi,

I am testing the PWM and PFM function. But when I tested just one DNA sequence I had problems, but 1 sequence within a vector does not present an error.
See:

dna1 = dna"TCA"
pfm = PFM(dna1)
ArgumentError: sequence element must be DNA or RNA

Stacktrace:
 [1] PFM(set::Vector{DNA})
   @ BioSequences C:\Users\Planck\.julia\packages\BioSequences\bYmYY\src\search\pwm.jl:50
 [2] PFM(set::LongSequence{DNAAlphabet{4}})
   @ BioSequences C:\Users\Planck\.julia\packages\BioSequences\bYmYY\src\search\pwm.jl:42
 [3] top-level scope
   @ In[22]:2

Now if I do:

dna1 = dna"TCA"
pfm = PFM([dna1])
4×3 PFM{DNA, Int64}:
 A  0  0  1 
 C  0  1  0 
 G  0  0  0 
 T  1  0  0 

Is there any reason?
thanks

@jakobnissen
Copy link
Member

Dear @felipe-mansoldo

PFMs and PWMs represent nucleotide frequencies at each position. E.g. if 7 out of 11 frequencies has a DNA_C at first position, its frequency is 7 / 11. Hence, they need a collection of symbols to construct.

@felipe-mansoldo
Copy link
Author

Dear @jakobnissen,
thanks for the explanation
my best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants