Searching Data Objects
You can use the dx ls
command to list the objects in your current project. You can learn which project and folder you are currently in by using the command dx pwd
. Using glob patterns, you can broaden your search for objects by specifying filenames with wildcard characters such as *
and ?
. An asterisk (*
) is used to represent zero or more characters in a string, and a question mark (?
) represents exactly one character.
Searching Objects with Glob Patterns
Searching Objects in Your Current Folder
By listing objects in your current directory with the wildcard characters *
and ?
, you can search for objects with a filename using a glob pattern. Here we take folder "C. Elegans - Ce10/" in the public project "Reference Genome Files" (platform login required to access this link) and walk through these examples:
Printing the Current Working Directory
Listing Folders and/or Objects in a Folder
Listing Objects Named Using a Pattern
Searching Across Objects in the Current Project
If you wish to search the entire project with a filename pattern, you can utilize the command dx find data --name
with the wildcard characters. Unless --path
or --all-projects
is specified, dx find data
searches data under the current project. Below, we use the command dx find data
in the public project "Reference Genome Files" (platform login required to access this link) using the --name
option to specify the filename of objects that we're searching for.
Escaping Special Characters
As described above, if your file contains special characters in their filename, the special characters should be escaped when searching. Additionally, as a colon (:
) is used to denote project names and a slash (/
) is used to separate folder names on the platform, they are also special characters, so we will also need to escape these two characters when they appear in a data object's name. To escape any special characters, you will use a preceding backslash \
.
Please note that while dx-toolkit itself requires a single \ to escape a colon or a slash, the syntax conventions in some shells may require you to escape the \ character itself by an extra backslash or by enclosing the argument in single quotes.
Searching Objects with Other Criteria
dx find data
also allows you to search data using metadata fields, such as when the data was created, the data's tags, or the project the data exists in.
Searching Objects Created Within a Certain Period of Time
You can utilize the flags --created-after
and --created-before
to search for data objects created within a period of time.
Searching Objects by Their Metadata
You can search for objects based on their metadata. An object's metadata can be set by performing the command dx tag
or dx set_properties
to respectively tag or setup key-value pairs to describe your data object. You can also set metadata while uploading data to the platform. To search by object tags, use the option --tag
. This option can be repeated if the search requires multiple tags.
To search by object properties, use the option --property
. This option can be repeated if the search requires multiple properties.
Searching Objects in Another Project
You can search for an object living in a different project than your current working project by specifying a project and folder path with the flag --path
. Below, we specify the project ID (project-BQfgzV80bZ46kf6pBGy00J38) of the public project "Exome Analysis Demo" (platform login required to access this link) as an example.
Searching Objects Across Projects with VIEW and Above Permissions
If you would like to search for data objects live in all projects in which you have VIEW and above permissions, you can use the --all-projects
flag. Public projects are not shown in this search.
Scoping Within Projects
To describe data for small amounts of files (typically below 100), scope findDataObjects
to only a project level.
The below is an example of code used to scope a project:
See the API method system/findDataObjects
for more information about usage.
Last updated