> ## 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.

# Raw Data Download

> The Cosmos-Hub allows you to store and download your raw fastqs/sequencing data from the dashboard.

<Warning>
  Raw FASTQ files are only accessible for 30 days after upload, after which the files are moved to archives for 1 year. When archived, the data is unavailable for direct download or workflow use. To unarchive, please email your sample list to [help@cosmos-hub.com](mailto:help@cosmos-hub.com); a \$500 fee applies.
</Warning>

<Frame>
  <iframe width="550" height="315" src="https://www.youtube.com/embed/VomAmmmAFDs?si=DWZwoRX-HMdVy49w" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen />
</Frame>

<Steps>
  <Step title="Get Download URLs">
    Start by selecting your samples in the "Cohorts and Metadata" menu, and select the "Export Samples" → "Get Download URLs" to generate download links in either CSV or TSV format.
  </Step>

  <Step title="Open the file in a spreadsheet or text app (i.e., Excel)">
    Open it in a spreadsheet or text app to get the links. The URL column contains the download link for that particular sample (paired-end files will have 2 files with 2 unique URLs).

    <Frame>
      <img src="https://mintcdn.com/cmbio/lcZSyRQBKqTakyjh/images/downloadlinks.png?fit=max&auto=format&n=lcZSyRQBKqTakyjh&q=85&s=974608a6444a83595c5075f831c5b29e" alt="Downloadlinks Pn" width="1510" height="612" data-path="images/downloadlinks.png" />
    </Frame>
  </Step>

  <Step title="Use the generated URLs or preformatted commands (CURL, POWERSHELL, or WGET) to download raw fastqs">
    **Browser Method:**\
    Paste URLs from the "URL" column directly into your web browser to initiate the download to your default Downloads folder.

    **Terminal Method:**\
    Use the provided preformatted commands (CURL, POWERSHELL, or WGET) from the spreadsheet. Simply navigate to your target directory in the terminal and paste the commands.
  </Step>
</Steps>

#### How can you download raw fastqs for multiple samples all at once using UNIX terminal or PowerShell from the download URL CSV/TSV file?

The bash/PowerShell commands can be used for downloading multiple files using the download URL CSV/TSV

<CodeGroup>
  ```shell MacOS - wget theme={null}
  ## Downloading multiple files using download URL CSV
  tail -n +2 samples_download_urls_2023_03_23_21_58.csv | cut -d',' -f6 | while read url; do
      wget "$url"
  done

  ## Downloading multiple files using download URL TSV
  tail -n +2 samples_download_urls_2023_03_23_21_58.tsv | cut -f6 | while read url; do
      wget "$url"
  done
  ```

  ```powershell Windows 11 - PowerShell theme={null}
  ## Downloading multiple files using download URL CSV
  Import-Csv -Path ".\<csv_filename>.csv" -Delimiter ',' |
  ForEach-Object {
      $url = $_.URL.Trim()

      if (-not [string]::IsNullOrWhiteSpace($url)) {
          $filename = [System.IO.Path]::GetFileName(([Uri]$url).AbsolutePath)

          if (-not (Test-Path -LiteralPath $filename)) {
              Invoke-WebRequest -Uri $url -OutFile $filename
          }
      }
  }

  ## Downloading multiple files using download URL TSV
  Import-Csv -Path ".\<tsv_filename>.tsv" -Delimiter "`t" |
  ForEach-Object {
      $filename = [System.IO.Path]::GetFileName(($_.URL -split '\?')[0])

      if (-not (Test-Path $filename)) {
          Invoke-WebRequest -Uri $_.URL -OutFile $filename
      }
  }
  ```
</CodeGroup>

# Downloading WGET on MacOS

<Note>
  **macOS users:** wget is not installed by default on macOS. You'll need to install it first using Homebrew:

  1. Install Homebrew (if not already installed):
     ```bash theme={null}
     /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
     ```
  2. Install wget:
     ```bash theme={null}
     brew install wget
     ```
</Note>

# Downloading on Windows 11

<Note>
  **Windows 11 users:**

  1. **Download the CSV file from Cosmos Hub**\
     Download the CSV/TSV file that contains your sample download links. You can follow steps 1 and 2 here at [https://docs.cosmosid.com/docs/download-your-raw-fastqs](https://docs.cosmosid.com/docs/download-your-raw-fastqs)
  2. **Create a new empty folder**\
     Create an empty folder on your computer and move the CSV/TSV file into it.
  3. **Open PowerShell in that folder**\
     Open the folder, right click on an empty space, and select **Open in Terminal**. If you do not see it, click **Show more options** first.
  4. **Copy and paste this command into the PowerShell terminal** \
     <Icon icon="brake-warning" /> **Note**: Make sure to replace `"./<csv_filename>.csv" `  with the exact name of your downloaded CSV/TSV file (e.g:`"./samples_download_urls_2026-05-08_18_46.csv"`).
     \
     **For CSV file**
     ```powershell theme={null}
     Import-Csv -Path ".\<csv_filename>.csv" | ForEach-Object { $filename = [System.IO.Path]::GetFileName(($_.URL -split '\?')[0]); if (-not (Test-Path $filename)) { Invoke-WebRequest -Uri $_.URL -OutFile $filename } }
     ```
     **For TSV file**
     ```powershell theme={null}
     Import-Csv -Path ".\<tsv_filename>.tsv" -Delimiter "`t" | ForEach-Object { $filename = [System.IO.Path]::GetFileName(($_.URL -split '\?')[0]); if (-not (Test-Path $filename)) { Invoke-WebRequest -Uri $_.URL -OutFile $filename } }
     ```
     <Icon icon="brake-warning" /> Note: Opening or editing the CSV or TSV file in spreadsheet software such as Microsoft Excel may change the delimiter used to separate the columns, depending on your local settings. If this happens, you may need to update the `-Delimiter` value in the PowerShell command accordingly.
  5. **Press Enter**\
     The downloads will start automatically. Keep the PowerShell window open until all files finish downloading. \
     \
     <Icon icon="brake-warning" /> **Note**: depending on the number of files and their size, the download may take some time. Make sure your computer has enough available storage space before starting.
</Note>
