Fasta文件上传和pdf下载

时间:2018-11-19 15:17:09

标签: file-upload shiny alignment fasta

我必须将代码转换为另一个代码,您可以在其中上传您选择的fasta文件并以pdf格式下载对齐方式。我已经尝试了很长时间,但无法实现。 代码(您必须上传特定文件)为:

   library(shiny)      
   library(msa) 

   runApp(list(

   mySequences <- readDNAStringSet("/Users/-----/dna3.fas", format = "fasta"),
   myFirstAlignment <- msa(mySequences),


   ui = fluidPage(downloadButton('downloadPDF')),   
   server = function(input, output) {  
   output$downloadPDF = downloadHandler(  
  filename = 'myreport.pdf',  
  content = function(file) {  
    msaPrettyPrint(  
      myFirstAlignment  
      , file = 'myreport.pdf'  
      , output="pdf"  
      , showNames="none"  
      , showLogo="top"  
      , consensusColor="BlueRed"  
      , logoColors="accessible area"  
      , askForOverwrite=FALSE)   
    file.rename("myreport.pdf", file) 

  },
  contentType = 'application/pdf'
   )
   }
   ))

II将不胜感激。谢谢

0 个答案:

没有答案