Project Navigation
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 on the platform directly from the command-line.
Common commands include:
dx lsto list objectsdx cdto change foldersdx mvto move data objectsdx cpto copy objects
Listing Objects
Listing Objects in Your Current Project
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 dx ls.
$ dx ls
Developer Quickstart/
Developer Tutorials/
Quickstart/
RNA-seq Workflow Example/
SRR100022/
_README.1st.txtListing Object Details
To see more details, you can run the command with the option dx ls -l.
As in bash, you can list the contents of a path.
Listing Objects in a Different Project
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.
Listing Objects That Match a Pattern
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
dxwithout expanding it against local files.The
dxcommand correctly interprets any spaces in the path.
For more information about using wildcards with dx commands, see Quoting Wildcards in Shell Commands.
Switching Contexts
Changing Folders
To find out your present folder location, use the dx pwd command. You can switch contexts to a subfolder in a project using dx cd.
Moving or Renaming Data Objects
You can move and rename data objects and folders using the command dx mv.
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).
Copying Objects or Folders to Another Project
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", for which the user has ADMINISTER permission.
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 cloud regions through dx cp.
Changing Your Current Project
Changing to Another Project With a Project Prompt List
You can change to another project where you want to work by running the command dx select. It displays 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".
Changing to a Public Project
To view and select from all public projects, which are available to all DNAnexus users, you can run the command dx select --public:
Changing to a Project With VIEW Permission
By default, dx select prompts a list of projects for which you have at least CONTRIBUTE permission. If you want to switch to a project for which 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.
Changing Directly to a Specific Project
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]:
Last updated
Was this helpful?