UBod / msa

R package for multiple sequence alignment
https://github.com/UBod/msa
17 stars 11 forks source link

Can not view multiple sequence aligment using MSA #8

Closed kagningemma closed 3 years ago

kagningemma commented 3 years ago

I ran the demo script supplied together with the msa package

library(msa)
filepath <- system.file("examples", "exampleAA.fasta", package="msa")
mySeqs <- readAAStringSet(filepath)
myAlignment <- msa(mySeqs)
msaPrettyPrint(myAlignment, output="asis", askForOverwrite=FALSE)

The output is below

\begin{texshade}{C:/Users/kagni/AppData/Local/Temp/RtmpYRvbZL/seq1eb89e011a.fasta}
\seqtype{P}
\shadingmode{identical}
\threshold{50}
\showconsensus[ColdHot]{bottom}
\shadingcolors{blues}
\showsequencelogo[chemical]{top}
\hidelogoscale
\shownames{left}
\nameseq{1}{PH4H Rattus norvegicus}
\nameseq{2}{PH4H Mus musculus}
\nameseq{3}{PH4H Homo sapiens}
\nameseq{4}{PH4H Bos taurus}
\nameseq{5}{PH4H Chromobacterium violaceum}
\nameseq{6}{PH4H Ralstonia solanacearum}
\nameseq{7}{PH4H Caulobacter crescentus}
\nameseq{8}{PH4H Pseudomonas aeruginosa}
\nameseq{9}{PH4H Rhizobium loti}
\shownumbering{right}
\showlegend
\end{texshade}

sessionInfo()

R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=Japanese_Japan.932  LC_CTYPE=Japanese_Japan.932   
[3] LC_MONETARY=Japanese_Japan.932 LC_NUMERIC=C                  
[5] LC_TIME=Japanese_Japan.932    

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils    
[7] datasets  methods   base     

other attached packages:
[1] msa_1.22.0          Biostrings_2.58.0   XVector_0.30.0     
[4] IRanges_2.24.0      S4Vectors_0.28.0    BiocGenerics_0.36.0

loaded via a namespace (and not attached):
[1] zlibbioc_1.36.0 compiler_4.0.3  tools_4.0.3     rstudioapi_0.13
[5] yaml_2.2.1      Rcpp_1.0.5      crayon_1.3.4    knitr_1.30     
[9] xfun_0.19   
UBod commented 3 years ago

What is the actual problem? Can you post the error message please?

UBod commented 3 years ago

If the problem is the fact that LaTeX code is displayed, then you should replace output="asis" by something else (see ?msaPrettyPrint).

kagningemma commented 3 years ago

Thank you for your feedback. I am not familiar with latex, I tried different output options :

msaPrettyPrint(myAlignment, output="dvi", askForOverwrite=FALSE)
Error in texi2dvi(texfile, quiet = !verbose, pdf = identical(output, "pdf"),  : 
  latex is not available
> msaPrettyPrint(myAlignment, output="pdf", askForOverwrite=FALSE)
Error in texi2dvi(texfile, quiet = !verbose, pdf = identical(output, "pdf"),  : 
  pdflatex is not available

However, I could obtain a .tex file as output, when I used output="tex". How do I view the multiple sequence alignment using the .tex file? I could not find any R package named "pdflatex", "latex" in CRAN.

UBod commented 3 years ago

LaTeX is a typesetting system that is independent of R. If you want to make full use of msaPrettyPrint(), you need to install LaTeX system separately. For Windows, there is MikTeX. For Mac OS, there is MacTeX. If you use Ubuntu or some other Linux distribution, you can use texlive (sudo apt-get install texlive-full). If you don't want any of these options, you may want to try the R package tinytex. It installs a minimal LaTeX system inside R that will hopefully work along msaPrettyPrint().

kagningemma commented 3 years ago

Thank you @UBod. I used tinytex package and it worked.