# Curate data from the full GISAID database

**URL:** <https://nextstrain.discourse.group/t/curate-data-from-the-full-gisaid-database/611>\
**Category:** Help and Getting Started\
**Created:** [July 11, 2021, 6:49pm UTC](https://nextstrain.discourse.group/t/curate-data-from-the-full-gisaid-database/611 "2021-07-11T18:49:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiehuang001](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jiehuang001](https://nextstrain.discourse.group/u/jiehuang001)\
**Post date:** [July 11, 2021, 6:49pm UTC](https://nextstrain.discourse.group/t/curate-data-from-the-full-gisaid-database/611/1 "2021-07-11T18:49:26Z")

</div>

Hi, there:

For the tutorial on “Explore SARS-CoV-2 evolution”, under the section of “Preparing your data” and then “Curate data from the full GISAID database”, it says: F_ind the “Download packages” section and select the “FASTA” button._

 ![11](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/04be349198e5267459d6a1790a1b35d22b3fb180.png)

My question is: why don’t we download the **"MSA full XXXX**" file under the “ **alignment and proteins** ” section? I think the FASTA files under “Download packages” section is not aligned.

BTW, I found there are ambiguous sequences in the FASTA file, with letters such as “k”, “y”. Is there a way to **filter out sequences containing those letters**?

Thank you very much & Best regards,  
Jie

---

<div class="post-metadata">

**Author:** ![jlhudd](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/jlhudd/32/583_2.png) [@jlhudd](https://nextstrain.discourse.group/u/jlhudd)\
**Post date:** [July 16, 2021, 7:15pm UTC](https://nextstrain.discourse.group/t/curate-data-from-the-full-gisaid-database/611/2 "2021-07-16T19:15:46Z")

</div>

Hi @jiehuang001! You could potentially start with the full nucleotide MSA from GISAID instead of the unaligned sequences. We haven’t tested this approach, since we rely on features of nextalign’s alignments that are not guaranteed to be present in the GISAID alignments. If you wanted to use the pre-aligned sequences as input for your workflow, you could change the recommended builds.yaml section to look like this to skip the alignment step of the workflow:

```auto
# Define inputs for the workflow.
inputs:
  - name: subsampled-gisaid
    metadata: data/subsampled_metadata_gisaid.tsv.gz
    aligned: data/subsampled_sequences_gisaid.fasta.gz

```

You can filter strains whose sequences have invalid nucleotide characters with the `augur filter` flag `--non-nucleotide`. However, we do allow [valid IUPAC characters](http://www.bioinformatics.org/sms/iupac.html) (like “K” and “Y”) in our analyses. These will get inferred as the most likely nucleotide character by TreeTime during the `refine` step of the workflow.

---

<div class="post-metadata">

**Author:** ![jiehuang001](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jiehuang001](https://nextstrain.discourse.group/u/jiehuang001)\
**Post date:** [July 21, 2021, 12:59am UTC](https://nextstrain.discourse.group/t/curate-data-from-the-full-gisaid-database/611/3 "2021-07-21T00:59:47Z")

</div>

> [@jlhudd](#):
>
> These will get inferred as the most likely nucleotide character by TreeTime during the `refine` step of the workflow.

Thanks!

Exactly how do I user “augur filter --non-nucleotide”? I did not find an example code. I want to REMOVE those non-nucleotide sequences, not to EXTRACT them. What if I also want to exclude those sequences with missing genotype (denoted by “-” or “n”)?

I still could not figure out how to extract sequences with alpha, beta, gamma, and delta mutations. I assume that everybody downloaded the sequences and the metadata from GISAID. However, there is not a label for such mutations in the metadata.

Your help would be greatly appreciated.

Thank you very much & Best regards,  
Jie

---

<div class="post-metadata">

**Author:** ![jlhudd](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/jlhudd/32/583_2.png) [@jlhudd](https://nextstrain.discourse.group/u/jlhudd)\
**Post date:** [July 23, 2021, 10:12pm UTC](https://nextstrain.discourse.group/t/curate-data-from-the-full-gisaid-database/611/4 "2021-07-23T22:12:21Z")

</div>

You can filter (i.e., exclude or remove) sequences with invalid nucleotide characters like so:

```bash
augur filter --sequences input.fasta --non-nucleotide --output filtered.fasta

```

This will not filter out sequences with valid IUPAC characters, gaps ("-"), or “N” characters. We allow these characters in our analyses because they can be inferred later on. If you want to exclude these, you’ll need to use a different tool or write a script to filter in this way.

Regarding the different WHO lineages, you can search for these in the GISAID interface by selecting from the “Variants” search interface:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/16293229fbe1ab367a4e808ce749f60998c86c98.png)

This dropdown provides a list like this:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/399caaddebd5b42e81fcceedfd443d766ae62a92.png)

You can also query the GISAID metadata with Augur for specific Pangolin lineages. Note that a single WHO variant can correspond to multiple Pangolin lineages. The following example shows how to query for all Lambda records from the metadata and output the corresponding sequences.

```bash
augur filter \
    --sequences sequences.fasta \
    --metadata metadata.tsv\
    --query "pangolin_lineage == 'C.37'"
    --output-metadata lambda_metadata.tsv \
    --output-sequences lambda_sequences.fasta

```
