> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cosmosid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Example: Running 16S Short-Read

This example requires the CLI to be fully set up and operational. Please refer to the [*"Install and Setup"*](/docs/api-reference/install-and-setup) page for details. You can test your installation by typing the following command:

```bash theme={null}
#To test installation

cosmosid
```

## 1. Uploading samples for 16S ASV analysis

1. In the command line, navigate to your directory containing paired-ended WGS samples in FASTQ format. CLI supports files of following extensions: 'fasta', 'fna', 'fasta.gz', 'fastq', 'fq', 'fastq.gz', 'bam', 'sra'
2. Create a cloud directory for your uploads and grab the folder key

   ```bash theme={null}
     cosmosid --api_key <YOUR_API_KEY> --base_url https://app.cosmosid.com mkdir --name 16S_project
   ```

   1. This command will produce a folder UUID that will be used for further commands.
   2. *Example output*: Folder 16S\_project: 0e8ac013-07db-4ccf-a4ef-c22477556185 has been created
3. Upload your data to your new parent directory using the folder UUID and workflow command using the upload command:

```bash theme={null}
cosmosid --api_key <YOUR_API_KEY> --base_url https://app.cosmosid.com upload \
  --file sample_R1.fastq.gz --file sample_R2.fastq.gz \
  --parent <FOLDER_UUID> \
  --type amplicon-16s \
  --wf ampliseq \
  --forward-primer <SEQUENCE> \
  --reverse-primer <SEQUENCE> \
  --dir $(pwd)
```

Allow \~24hours for analysis to complete.

## 2. Download results in .zip format

1. Check the list of samples and their statuses using the files command and grab the Sample UUID:

   ```
    cosmosid --api_key <YOUR_API_KEY> --base_url https://app.cosmosid.com files
      --parent <FOLDER_UUID>
   ```

   OR Use the following command to export all sample UUIDs within your parent directory

   ```
   cosmosid --api_key <YOUR_API_KEY> --base_url https://app.cosmosid.com files --parent <FOLDER_UUID> -f csv | tail -n +3 | cut -f3 -d ‘,’ > 16s_ids.tsv
   ```

<Frame>
  <img src="https://mintcdn.com/cmbio/1_URKzklO7hYjRsk/images/docs/a0ea52f12acc5e682301d824f8d9cad8af86bf20c9e31ac653f357512f835516-Screenshot_2024-11-26_at_1.47.44_PM.png?fit=max&auto=format&n=1_URKzklO7hYjRsk&q=85&s=f378e8c0d0a9ef41324c8378ff01655d" alt="CosmosID CLI" width="2400" height="416" data-path="images/docs/a0ea52f12acc5e682301d824f8d9cad8af86bf20c9e31ac653f357512f835516-Screenshot_2024-11-26_at_1.47.44_PM.png" />
</Frame>

1. Select the sample UUID(s) and use it in the reports command to download results.

   ```bash theme={null}
   cosmosid --api_key <YOUR_API_KEY --base_url https://app.cosmosid.com reports --id <SAMPLE_ID>
   ```

   OR Use the following command with the 16S\_ids.tsv file to download all of your samples within your parent directory:

```bash theme={null}
cat champ_ids.tsv | sed ‘s/”//g’ | while read line; do echo $line; cosmosid --api_key <YOUR_API_KEY> --base_url <https://app.cosmosid.com> reports --id $line; done
```
