dxcommand-line client is included in the DNAnexus SDK (
dx-toolkit). You can use the
dxclient to log into the Platform; to upload, browse, and organize data; and to launch analyses.
dx helpto see a list of commands, broken down by category. To see a list of commands from a particular category, enter
dx help <category>.
dx help <command>,
dx <command> -h, or
dx <command> -helpFor example, enter
dx help lsto learn about the command
dx selectcommand and picking a project, you've now done the command-line equivalent of going to the project page for Reference Genome Files: AWS US (East) (platform login required to access this link) on the website. This is a DNAnexus-sponsored project containing popular genomes for you to use when running analyses with your own data.
dx selectcommand, please see the Changing Your Current Project page.
dx ls. You can also see the contents of a folder by running the command
dx ls <folder_name>.
dx ls Cand then pressing
<TAB>. The folder name will auto-complete from there.
:) and the folder path. Here, we list the contents of the publicly available project "Demo Data" using both its name and ID.
-lflag in conjunction with
dx lsto list more details about files, such as the time a file was last modified, its size (if applicable), and its full DNAnexus ID.
dx uploadcommand or the Upload Agent if you have installed it. For the purposes of this tutorial, you can also download the file small-celegans-sample.fastq, which represents the first 25000 C. elegans reads from SRR070372. We will use this file again later to run through a sample analysis.
small-celegans-sample.fastqfile into the current directory of the current project. The
dx uploadto wait until it has finished uploading the data before returning the prompt and describing the result.
dx headcommand. By default, it prints the first 10 lines of the given file.
-nflag to ask for the first 12 lines (the first 3 reads) of the FASTQ file.
dx downloadcommand. This command will use the name of the file for the filename unless you specify your own with the
--outputflag. In the example below, we download the same C. elegans file that we uploaded previously.
dx find apps. You will find the name of the app that you can use on the command line in the parentheses (underlined below).
dx installand check that it has been installed. While you do not always need to install an app to run it, you may find it useful as a bookmarking tool.
dx run. We will run it without any arguments; it will then prompt us for required and then optional arguments. Note that the reference file
genomeindex_targzfor the C. elegans sample we are using is in a
.tar.gzformat and can be found in the Reference Genome folder of the region your project is in.
dx watchto monitor jobs. The command will print out the log file of the job, including the STDOUT, STDERR, and INFO printouts.
dx describe job-xxxxto learn more about your job. If you don't know the job's ID, you can use the command
dx find jobsto list all the jobs run in the current project, along with the user who ran them, their status, and when they began.
.baiextension. You can refer to the output file by name or by the job that produced it using the syntax
job-xxxx:<output field>. Try it yourself with the job ID you got from calling the BWA-MEM app!
dx run freebayes -h.
) around the command-line syntax for each input. You'll notice that there are two required inputs that must be specified:
sorted_bams): A list of files with a
genome_fastagz): A reference genome in FASTA format that has been gzipped.
-iflag to specify inputs as suggested by the output of
dx run freebayes ‑h:
genome_fastagz: The ce10 genome in the Reference Genomes project.
job-xxxx:<output field>syntax we used earlier.
-yflag skips the input confirmation.
dx waitto wait for a job to finish. If we run the following command right after running the Freebayes app, it will show you the recent jobs only after the job has finished, as shown in the example below.
dx. As shown in some of the examples above, the
--briefflag can come in handy for scripting. A list of all
dxcommands and flags is on the Index of dx Commands page.