jianhong / motifStack

Plot stacked logos for single or multiple DNA, RNA and amino acid sequence
https://jianhong.github.io/motifStack/articles/motifStack_HTML.html
13 stars 7 forks source link

Orientation of motifs in motif stack and reorder function #17

Open sneumann1979 opened 8 months ago

sneumann1979 commented 8 months ago

Hi. This is a really nice program that is very helpful! I encountered a problem when plotting motif stacks. I am plotting a stack of four motifs and it appears that two of the motifs are aligned in reverse complement (X45.CCATGGWAAC.STREME.45(RC) and X46.GTYTCCARGCAAC.STREME.46(RC)). Is there any way to control this behavior?

Also, I was trying the reorder=FALSE option, but it seems to be ignored. If I understand correctly, also the example in the vignette is not reordered.

Thank you very much for your help! Sylvia

Here is the code I was running: stack <- importMatrix(file, format = "meme", to = "auto")

pdf(filepdf)
motifStack(stack, layout="stack", ncex=1.0)
dev.off()

file: MEME version 5 ALPHABET= ACGT strands: + - Background letter frequencies A 0.29 C 0.21 G 0.21 T 0.29 MOTIF 4-GTTGCCATGGWRACH STREME-4 letter-probability matrix: alength= 4 w= 15 nsites= 659 P= 2.7e-026 0.082198 0.001786 0.907603 0.008413 0.015933 0.053041 0.000019 0.931008 0.086979 0.000019 0.012391 0.900612 0.196402 0.019460 0.722892 0.061245 0.001793 0.804956 0.017135 0.176115 0.000026 0.728050 0.000019 0.271905 0.924867 0.003554 0.005972 0.065606 0.115558 0.000019 0.040669 0.843754 0.107723 0.000019 0.892232 0.000026 0.010630 0.000019 0.976953 0.012398 0.386124 0.173752 0.080460 0.359664 0.581881 0.009567 0.309282 0.099270 0.869282 0.058436 0.050715 0.021566 0.046630 0.713959 0.022437 0.216974 0.386819 0.281182 0.084277 0.247722 MOTIF 7-GTTGCCAAG STREME-7 letter-probability matrix: alength= 4 w= 9 nsites= 543 P= 1.1e-013 0.010812 0.044045 0.847239 0.097904 0.002233 0.000114 0.030790 0.966863 0.003935 0.000114 0.008779 0.987172 0.018448 0.000114 0.981280 0.000158 0.005615 0.964675 0.007337 0.022373 0.007216 0.742456 0.000114 0.250214 0.799901 0.004931 0.000114 0.195054 0.787863 0.000114 0.075139 0.136884 0.013519 0.003264 0.979083 0.004134 MOTIF 45-CCATGGWAAC STREME-45 letter-probability matrix: alength= 4 w= 10 nsites= 81 P= 4.0e-002 0.000616 0.998321 0.000446 0.000616 0.014952 0.700160 0.000446 0.284442 0.970726 0.000446 0.000446 0.028382 0.000616 0.000446 0.000446 0.998491 0.055628 0.000446 0.943309 0.000616 0.000616 0.000446 0.998321 0.000616 0.430116 0.000446 0.000446 0.568991 0.836743 0.000446 0.000446 0.162365 0.998491 0.000446 0.000446 0.000616 0.000616 0.998321 0.000446 0.000616 MOTIF 46-GTYTCCARGCAAC STREME-46 letter-probability matrix: alength= 4 w= 13 nsites= 28 P= 3.6e-001 0.256751 0.050844 0.691913 0.000492 0.135646 0.000356 0.000356 0.863641 0.023311 0.575655 0.000356 0.400677 0.100537 0.133751 0.000356 0.765356 0.000492 0.998660 0.000356 0.000492 0.023311 0.975840 0.000356 0.000492 0.998795 0.000356 0.000356 0.000492 0.340588 0.000356 0.658564 0.000492 0.000492 0.000356 0.931963 0.067189 0.000492 0.998660 0.000356 0.000492 0.942628 0.000356 0.000356 0.056660 0.965447 0.000356 0.000356 0.033840 0.000492 0.998660 0.000356 0.000492 Issue.pdf

jianhong commented 8 months ago

Thank you for trying motifStack. I am sorry I forget the update this. Could you please try the following

BiocManager::install('jianhong/motifStack')
motifStack(stack, layout="stack", revcomp=FALSE)

Let me know if there is any issue.

sneumann1979 commented 8 months ago

Perfect, that solved the reverse complement issue! Thank you! Sylvia