You can treat dx as an invocation command for navigating the data objects on the DNAnexus Platform. By adding dx in front of commonly used bash commands, you can manage objects in the platform directly from the command-line. Common commands include dx ls, dx cd, dx mv, and dx cp, which let you list objects, change folders, move data objects, and copy objects.
By default when you set your current project, you are placed in the root folder / of the project. You can list the objects and folders in your current folder with .
To see more details, you can run the command with the option dx ls -l.
As in bash, you can list the contents on a path.
You can also list the contents of a different project. To specify a path that points to a different project, start with the project-ID, followed by a :, then the path within the project where / is the root folder of the project.
Enclose the path in quotes (" ") so dx interprets the spaces as part of the folder name, not as a new command.
You can also list only the objects that match a pattern. In this example, an asterisk * acts as a wildcard to represent all objects with names containing .fasta. This returns only a subset of the objects from the original query.
Enclose the path in quotes for two reasons:
The shell passes the wildcard pattern to dx without expanding it against local files.
The dx command correctly interprets any spaces in the path.
For more information about using wildcards with dx commands, see .
To find out your present folder location, use the dx pwd command. You can switch contexts to a subfolder in a project using .
You can move and rename data objects and folders using the command .
To rename an object or a folder, "move" it to a new name in the same folder. Here, a file named ce10.fasta.gz is renamed to C.elegans10.fastq.gz.
If you want to move the renamed file into a folder, specify the path to the folder as the destination of the move command (dx mv).
You can copy data objects or folders to another project by running the command dx cp. The following example shows how to copy a human reference genome FASTA file (hs37d5.fa.gz) from a public project, "Reference Genome Files", to a project "Scratch Project" that the user has ADMINISTER permission to.
You can also copy folders between projects by running dx cp folder_name destination_path. Folders are automatically copied recursively.
The Platform prevents copying a data object within the same project, since each specific data object exists only once in a project. The system also prohibits copying any data object between projects that are located in different through dx cp.
You can change to another project where you wanted to work by running the command . It brings up a prompt with a list of projects for you to select from. In the following example, the user has entered option 2 to select the project named "Mouse".
To view and select between all public projects, projects available to all DNAnexus users, you can run the command dx select --public:
By default, dx select prompts a list of projects that you have at least CONTRIBUTE permission to. If you wanted to switch to a project that you have VIEW permission to view the data objects, you can run dx select --level VIEW to list all the projects in which you have at least VIEW permission to.
If you know the project ID or name, you can also give it directly to switch to the project as dx select [project-ID | project-name]:
$ dx ls
Developer Quickstart/
Developer Tutorials/
Quickstart/
RNA-seq Workflow Example/
SRR100022/
_README.1st.txt$ dx ls -l
Project: Demo Data (project-BQbJpBj0bvygyQxgQ1800Jkk)
Folder : /
Developer Quickstart/
Developer Tutorials/
Quickstart/
RNA-seq Workflow Example/
SRR100022/
State Last modified Size Name (ID)
closed 2015-09-01 17:55:33 712 bytes _README.1st.txt (file-BgY4VzQ0bvyg22pfZQpXfzgK)$ dx ls SRR100022/
SRR100022_1.filt.fastq.gz
SRR100022_2.filt.fastq.gz$ dx ls "project-BQpp3Y804Y0xbyG4GJPQ01xv:/C. Elegans - Ce10/"
ce10.bt2-index.tar.gz
ce10.bwa-index.tar.gz
ce10.cw2-index.tar.gz
ce10.fasta.fai
ce10.fasta.gz
ce10.tmap-index.tar.gz$ dx ls "project-BQpp3Y804Y0xbyG4GJPQ01xv:/C. Elegans - Ce10/*.fasta*"
ce10.fasta.fai
ce10.fasta.gz$ dx pwd
Demo Data:/
$ dx cd Quickstart/
$ dx ls
SRR100022_20_1.fq.gz
SRR100022_20_2.fq.gz$ dx ls
some_folder/
an_applet
ce10.fasta.gz
Variation Calling Workflow
$ dx mv ce10.fasta.gz C.elegans10.fasta.gz
$ dx ls
some_folder/
an_applet
C.elegans10.fasta.gz
Variation Calling Workflow$ dx mv C.elegans10.fasta.gz some_folder/
$ dx ls some_folder/
Hg19
C.elegans10.fasta.gz
...$ dx select project-BQpp3Y804Y0xbyG4GJPQ01xv
Selected project project-BQpp3Y804Y0xbyG4GJPQ01x
$ dx cd H.\ Sapiens\ -\ GRCh37\ -\ hs37d5\ (1000\ Genomes\ Phase\ II)/
$ dx ls
hs37d5.2bit
hs37d5.bt2-index.tar.gz
hs37d5.bwa-index.tar.gz
hs37d5.cw2-index.tar.gz
hs37d5.fa.fai
hs37d5.fa.gz
hs37d5.fa.sa
hs37d5.tmap-index.tar.gz
$ dx cp hs37d5.fa.gz project-9z94ZPZvbJ3qP0pyK1P0000p:/
$ dx select project-9z94ZPZvbJ3qP0pyK1P0000p
$ dx ls
some_folder/
an_applet
C.elegans10.fasta.gz
hs37d5.fa.gz
Variation Calling Workflow$ dx select
Note: Use "dx select --level VIEW" or "dx select --public" to select from
projects for which you only have VIEW permission to.
Available projects (CONTRIBUTE or higher):
0) SAM importer test (CONTRIBUTE)
1) Scratch Project (ADMINISTER)
2) Mouse (ADMINISTER)
Project # [1]: 2
Setting current project to: Mouse
$ dx ls -l
Project: Mouse (project-9zVfbG2y8x65kxKY7x20005G)
Folder : /$ dx select --public
Available public projects:
0) Example 1 (VIEW)
1) Apps Data (VIEW)
2) Parliament (VIEW)
3) CNVkit Tests (VIEW)
...
m) More options not shown...
Pick a numbered choice or "m" for more options: 1$ dx select --level VIEW
Available projects (VIEW or higher):
0) SAM importer test (CONTRIBUTE)
1) Scratch Project (ADMINISTER)
2) Shared Applets (VIEW)
3) Mouse (ADMINISTER)
Pick a numbered choice or "m" for more options: 2$ dx select project-9zVfbG2y8x65kxKY7x20005G
Selected project project-9zVfbG2y8x65kxKY7x20005G
$ dx ls -l
Project: Mouse (project-9zVfbG2y8x65kxKY7x20005G)
Folder : /