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

Error for single base plotting #30

Open
kaufm202 opened this issue Mar 14, 2023 · 0 comments
Open

Error for single base plotting #30

kaufm202 opened this issue Mar 14, 2023 · 0 comments

Comments

@kaufm202
Copy link

I am attempting to plot a single base to represent overall nucleotide frequency is a group of sequences. I already have the program setup to get the frequency values into a matrix as shown below:

test
[,1]
A 9765608
C 6271383
G 5865611
U 12051811

When I attempt to plot this, I get this error:

ggseqlogo(test, method='p', ncol=1, seq_type="rna")
Error in apply(pwm, 2, function(col) sum(col * log2(col), na.rm = T)) :
dim(X) must have a positive length

It seems to be an issue with the matrix only having one column, since if I add a column of arbitrary values, I am able to plot it. For example, using the matrix shown below:

test2
[,1] [,2]
A 9765608 1
C 6271383 2
G 5865611 3
U 12051811 4

ggseqlogo_plot

Is there any way around this to be able to plot a single base from a frequency matrix? Thank you!

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

1 participant