Saving files created with Rstudio

Hello, I am running some analyses using R on the platform. I don't seem to be able to save the files that I create. I checked here https://dnanexus.gitbook.io/uk-biobank-rap/working-on-the-research-analysis-platform/using-rstudio-on-the-research-analysis-platform, "If you'd like to save individual result files in a DNAnexus project, you can upload them from an Rstudio Terminal using the dx upload command, for example dx upload FILE ". I have done this, but I get the following error: FileNotFoundError: [Errno 2] No such file or directory. I also tried with R on Jupyter lab, but I wasn't any luckier.   Could you please advise on what to do?   Thank you

Comments

5 comments

  • Comment author
    Chai Fungtammasan DNAnexus Team

    We have a video that describe the process to upload/download files in detail. See this vide for the full demonstration which also include the trick to save installed packages, etc.

    https://youtu.be/hVDbE1EykXA?t=760

     

    Or you may visit this short video as well. https://www.youtube.com/watch?v=glIjnFxlw-I&list=PLRkZ0Fz-n3Z7Jg0Vz4vudLYnBza4EUGLM&index=10&t=1s

    0
  • Comment author
    Former User of DNAx Community_56

    Thanks for your quick reply.

    I have followed the video, but it still does not work.

    This is what I have done to save my file, and the error that was generated.

     

    write.csv(WGS_data, file = "WGS_data.csv")

    Error in file(file, ifelse(append, "a", "w")) :

    cannot open the connection

    In addition: Warning message:

    In file(file, ifelse(append, "a", "w")) :

    cannot open file 'WGS_data.csv': Read-only file system

     

    How to fix this?

     

    0
  • Have you checked that the directory you are trying to save into exists?

     

    0
  • I now see that if I work on the directory, on jupyter notebook ('/opt/notebooks'), and I create a file, I can then save it on my project by using 'dx upload FILE'. But this does not seem to work with files generated directly in one of my project's directory. This is not a big issue, since as long as I can save files on my project, one way or another, it is fine. But I am curious as to why this happens.

    0
  • Comment author
    Chai Fungtammasan DNAnexus Team

    yes, the general flow is to save file to worker first and then upload to project later on.

    https://www.youtube.com/watch?v=glIjnFxlw-I&list=PLRkZ0Fz-n3Z7Jg0Vz4vudLYnBza4EUGLM&index=11&t=1s

     

    There is a limitation of dxfuse in file writing back to project. In general, I recommend to use it in read only mode.

    0

Please sign in to leave a comment.