# GISAID nextfasta QC criteria

**URL:** <https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79>\
**Category:** General\
**Created:** [July 20, 2020, 10:32am UTC](https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79 "2020-07-20T10:32:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nadeaus](https://avatars.discourse-cdn.com/v4/letter/n/c2a13f/32.png) [@nadeaus](https://nextstrain.discourse.group/u/nadeaus)\
**Post date:** [July 20, 2020, 10:32am UTC](https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79/1 "2020-07-20T10:32:04Z")

</div>

Hi nextstrain folks,

Thanks for the nextmeta and nextfasta download resources on GISAID. Could you point me towards what QC criteria were applied to generate these files? I am reading the QC section on [https://clades.nextstrain.org/](https://clades.nextstrain.org/) and am wondering if either the ‘Nextclade’ or ‘Nextstrain’ criteria apply, or if a third set of criteria were used.

---

<div class="post-metadata">

**Author:** ![trvrb](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/trvrb/32/2_2.png) [@trvrb](https://nextstrain.discourse.group/u/trvrb)\
**Post date:** [July 20, 2020, 10:59pm UTC](https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79/2 "2020-07-20T22:59:31Z")

</div>

These files were generated from the GISAID EpiCoV database using this [https://github.com/nextstrain/ncov-ingest](https://github.com/nextstrain/ncov-ingest) pipeline. Most of the cleaning happens in this script: [https://github.com/nextstrain/ncov-ingest/blob/master/bin/transform-gisaid](https://github.com/nextstrain/ncov-ingest/blob/master/bin/transform-gisaid). We have an extensive “annotations” file to further curate metadata: [https://github.com/nextstrain/ncov-ingest/blob/master/source-data/gisaid\_annotations.tsv](https://github.com/nextstrain/ncov-ingest/blob/master/source-data/gisaid_annotations.tsv).

---

<div class="post-metadata">

**Author:** ![rneher](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/rneher/32/20_2.png) [@rneher](https://nextstrain.discourse.group/u/rneher)\
**Post date:** [July 21, 2020, 6:45am UTC](https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79/3 "2020-07-21T06:45:27Z")

</div>

As Trevor notes, the QC criteria are applied later in our pipeline. nextstrain filters sequences with clustered SNPs (6 in 100 base pairs), too high or too low divergence given a date, and more than 3000 Ns. Nextclade flags sequences with similar criteria (doesn’t have a date, so can only do a rough divergence check) and flags starting at 1000 Ns. We are working on harmonizing these.

---

<div class="post-metadata">

**Author:** ![emmahodcroft](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/emmahodcroft/32/14_2.png) [@emmahodcroft](https://nextstrain.discourse.group/u/emmahodcroft)\
**Post date:** [July 21, 2020, 10:26am UTC](https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79/4 "2020-07-21T10:26:59Z")

</div>

Just to add one more bit of clarification, almost all of the QC applies later in the script, but we do only grab ‘long’ sequences from GISAID for the initial `ncov-ingest` ingest. So, short SARS-CoV-2 sequences will never appear in the `metadata.tsv` or `sequences.fasta` file. I believe we also only take sequences that are \>29,000bp here, but it could be slightly shorter - and we take ‘GISAID’s word’ on the length - so if there are lots of gaps or N’s, this isn’t recognised at this point (but they may be kicked out later).

---

<div class="post-metadata">

**Author:** ![nadeaus](https://avatars.discourse-cdn.com/v4/letter/n/c2a13f/32.png) [@nadeaus](https://nextstrain.discourse.group/u/nadeaus)\
**Post date:** [July 22, 2020, 7:29am UTC](https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79/5 "2020-07-22T07:29:46Z")

</div>

Thanks all for the information! @Emma I think the length criteria is \>15,000bp (looking at the script Trevor linked: [https://github.com/nextstrain/ncov-ingest/blob/fd67f26312bfc218d471fb8f38df62032d2d7f1c/bin/transform-gisaid](https://github.com/nextstrain/ncov-ingest/blob/fd67f26312bfc218d471fb8f38df62032d2d7f1c/bin/transform-gisaid)).

For downstream QC, is there a way to run the nextclade tool programatically or is the drag-and-drop always necessary?

---

<div class="post-metadata">

**Author:** ![nadeaus](https://avatars.discourse-cdn.com/v4/letter/n/c2a13f/32.png) [@nadeaus](https://nextstrain.discourse.group/u/nadeaus)\
**Post date:** [July 22, 2020, 7:44am UTC](https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79/6 "2020-07-22T07:44:05Z")

</div>

Aha, looks like the “diagnostic.py” script in the ncov repo is exactly what I was looking for. In case it helps anyone else: [https://github.com/nextstrain/ncov/blob/master/scripts/diagnostic.py](https://github.com/nextstrain/ncov/blob/master/scripts/diagnostic.py)

---

<div class="post-metadata">

**Author:** ![rneher](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/rneher/32/20_2.png) [@rneher](https://nextstrain.discourse.group/u/rneher)\
**Post date:** [July 22, 2020, 11:41am UTC](https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79/7 "2020-07-22T11:41:21Z")

</div>

Great. Glad you found it. the diagnostic tool runs over the complete alignment and produces three output files. One with info on every sequence, another with only the sequenced with issues, and a third file that is meant to be added to the `exclude.txt`. Let us know if you have additional questions!

---

<div class="post-metadata">

**Author:** ![guslac](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@guslac](https://nextstrain.discourse.group/u/guslac)\
**Post date:** [December 15, 2020, 7:05am UTC](https://nextstrain.discourse.group/t/gisaid-nextfasta-qc-criteria/79/8 "2020-12-15T07:05:06Z")

</div>

> [@nadeaus](#):
>
> nextmeta

nextmeta seems to no longer be available for download, as of a few weeks ago. Did it go away, or did it move to a different location?
