How to edit and run a script on DNAnexus dx?

Hi.

I am quite new to nexus.

I am trying to run Saige using WGS data.

As Stage 2 requires indexing and aiming to analyse several vcf, I wanted to pack everything on a long script and simply run altogether.

1) Which command can I use to edit a script?

2) I assume the script does not need to be a bash one?

3) Which command I use to run the script? dx run?

4) Do I need to install any specific package for dx?

 

Thanks

Federica 

Comments

6 comments

  • Comment author
    Can Hou

    Try with:

    dx run app-saige_gwas_svat \

    -iin="Your project:/files/to/upload/to/instance" \

    -iin="Your project:/files/to/upload/to/instance" \

    -icmd="your cmd to perform the analysis" \

    --instance-type "type of instance to request, e.g., mem3_ssd1_v2_x4" \

    --destination="Your project:/path/to/save/results" \

    --cost-limit "useful if you don't want to be broken" \

    --priority "high or normal or low, low is much more cheaper"

     

    First install the app-saige_gwas_svat application in DNAnexus. Then, use the provided command to request a specific instance with the app installed, and execute your command on the designated files in your project.

     

    2
  • Comment author
    Federica Merella

    Thank you for your generosity in replying to me.

    I have used docker to pull Saige image and then run the script and then run the script inputting line by line.

    My issue is mainly understanding an efficient way to edit a script using/on dx which I believe a I can launch with the dx run command.

    I can edit a script using ttyd but I am unable to save it on my project where Saige image and .rda and .variance.Ratio.txt files are.

    Thanks

    Federica Merella

    0
  • Comment author
    Can Hou

    Hi,

    I normally don't open ttyd to use the “dx run” command. You can install the dx command on your own computer (Windows or Linux) as long as you have an appropriate Python environment: dxpy on PyPI

    Then, you can go to your command-line shell and directly use the “dx” command as you would in ttyd. However, unlike in ttyd, where you are automatically logged in, you'll need to run “dx login” to log in to your account and project first. In this case, you can write your lengthy “dx run” commands in a script (for example, a .bash or .bat file) and execute them directly from your command-line shell. Since you are using your own computer, I assume it will be very easy for you to write and edit this script file.

    1
  • Comment author
    Federica Merella

    Hi Can.

    This is how I am working, on a virtual environment where I logged in (after having installed pything and dxpy).

    I have not understood how do I edit a .bash or .bat file in the first place on dx?

    which command do I call  (in few words which command in replacement for instance of “nano” on a linux bash CLI?) in order to open an editor and write my script to save in .bash or .bat?

    Thanks

    Federica

    0
  • Comment author
    Can Hou

    Hi Federica,

    DNAnexus doesn't provide an integrated text editor like nano for editing scripts directly on the platform. Typically, you would edit your scripts locally on your computer using any text editor (like Notepad++, Sublime, or Visual Studio Code) and then upload the script to DNAnexus. 

    Maybe you are looking for dx command like “dx upload” and “dx download”? (https://documentation.dnanexus.com/user/helpstrings-of-sdk-command-line-utilities#logout)

    2
  • Comment author
    Federica Merella

    Many thanks for the comprehensive explanation. You are confirming I am following the right process as I am editing my script separately and then uploading with dx upload.

    Thank you for your time.

    BW

    Federica

    0

Please sign in to leave a comment.