# Error related to step 3; reference genome

**URL:** https://forum.biobakery.org/t/error-related-to-step-3-reference-genome/1310
**Category:** StrainPhlAn
**Created:** [November 18, 2020, 10:57pm UTC](https://forum.biobakery.org/t/error-related-to-step-3-reference-genome/1310 "2020-11-18T22:57:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![MaryamTarazkar](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MaryamTarazkar](https://forum.biobakery.org/u/MaryamTarazkar)
#### Post date: [November 18, 2020, 10:57pm UTC](https://forum.biobakery.org/t/error-related-to-step-3-reference-genome/1310/1 "2020-11-18T22:57:48Z")

</div>

Hi,  
I am trying to do StrainPhlAn analysis on my samples. Here is the input I use:

strainphlan -s consensus\_markers/_.pkl -m clade\_markers/_.fna -r reference\_genome/\*.gbff -o output -c g\_\_Chlamydia --phylophlan\_mode fast

But I get following error;  
Wed Nov 18 17:42:55 2020: Start StrainPhlAn 3.0 execution  
Wed Nov 18 17:42:55 2020: Creating temporary directory…  
Wed Nov 18 17:42:55 2020: Done.  
Wed Nov 18 17:42:55 2020: Getting markers from main sample files…  
Wed Nov 18 17:42:55 2020: Done.  
Wed Nov 18 17:42:55 2020: Getting markers from main reference files…BLAST options error: reference\_genome/C.muridarum\_GCA\_000767405.1\_ASM76740v1\_genomic.gbff does not match input format type, default input type is FASTA

[e] An error was ocurred executing a external tool, exiting…  
Wed Nov 18 17:42:56 2020: Stop StrainPhlAn 3.0 execution.  
BLAST options error: reference\_genome/C.suis\_GCA\_900149625.2\_5-27b\_chromosome\_genomic.gbff does not match input format type, default input type is FASTA

[e] An error was ocurred executing a external tool, exiting…  
Wed Nov 18 17:42:56 2020: Stop StrainPhlAn 3.0 execution.

So I downloaded a reference genome from NCBI in fna format. and rerun the analysis;

strainphlan -s consensus\_markers/_.pkl -m clade\_markers/_.fna -r reference\_genome/\*.fna -o output -c g\_\_Chlamydia --phylophlan\_mode fast

But this time I get following error;

The main inputs samples + references are less than 4  
Wed Nov 18 17:49:09 2020: Stop StrainPhlAn 3.0 execution

Can you please help me how I can solve this issue? What is the best way to address the reference genome?

---

<div class="post-metadata">

### Author: ![aitor.blancomiguez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aitor.blancomiguez/32/86_2.png) [@aitor.blancomiguez](https://forum.biobakery.org/u/aitor.blancomiguez)
#### Post date: [November 19, 2020, 12:17pm UTC](https://forum.biobakery.org/t/error-related-to-step-3-reference-genome/1310/2 "2020-11-19T12:17:54Z")

</div>

Hi @MaryamTarazkar  
How many samples do you have in the` consensus_markers` folder and how many genomes (with fna extension) are in `reference_genome` folder? The error that is showing up is because StrainPhlAn needs, at least, 4 samples to perform the analysis (this could be a mix of reference genomes and metagenomic samples or only metagenomic samples)

---

<div class="post-metadata">

### Author: ![MaryamTarazkar](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MaryamTarazkar](https://forum.biobakery.org/u/MaryamTarazkar)
#### Post date: [November 19, 2020, 10:40pm UTC](https://forum.biobakery.org/t/error-related-to-step-3-reference-genome/1310/3 "2020-11-19T22:40:21Z")

</div>

Hi,  
Thank yo for getting back to me. Yes you are right: I had two samples in `consensus_markers` folder and one file ended with \*fna for reference genome. I added another file for reference genome and I do not get this error anymore. However I get a new type of error, as you see in the following;  
Thu Nov 19 17:26:44 2020: Start StrainPhlAn 3.0 execution  
Thu Nov 19 17:26:44 2020: Creating temporary directory…  
Thu Nov 19 17:26:44 2020: Done.  
Thu Nov 19 17:26:44 2020: Getting markers from main sample files…  
Thu Nov 19 17:26:44 2020: Done.  
Thu Nov 19 17:26:44 2020: Getting markers from main reference files…Warning: [blastn] Examining 5 or more matches is recommended  
Warning: [blastn] Examining 5 or more matches is recommended

Thu Nov 19 17:26:44 2020: Done.  
Thu Nov 19 17:26:44 2020: Removing bad markers / samples…  
[e] Phylogeny can not be inferred. Too many samples were discarded  
Thu Nov 19 17:26:44 2020: Stop StrainPhlAn 3.0 execution.

I appreciate if you help me resolve this issue.  
Thank you  
Maryam

---

<div class="post-metadata">

### Author: ![aitor.blancomiguez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aitor.blancomiguez/32/86_2.png) [@aitor.blancomiguez](https://forum.biobakery.org/u/aitor.blancomiguez)
#### Post date: [November 20, 2020, 10:24am UTC](https://forum.biobakery.org/t/error-related-to-step-3-reference-genome/1310/4 "2020-11-20T10:24:47Z")

</div>

Hi @MaryamTarazkar  
Since StrainPhlAn phylogenetic analysis is based on the MetaPhlAn species-specific markers, it is only possible to perform the analysis at the species level. The analysis you are trying is at the genus level (-c g\_\_Chlamydia) and therefore StrainPhlAn cannot find any marker in the samples.

Best,  
Aitor

---

<div class="post-metadata">

### Author: ![MaryamTarazkar](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MaryamTarazkar](https://forum.biobakery.org/u/MaryamTarazkar)
#### Post date: [November 20, 2020, 8:47pm UTC](https://forum.biobakery.org/t/error-related-to-step-3-reference-genome/1310/5 "2020-11-20T20:47:50Z")

</div>

Thank you for getting back to me. But I also tried at the species level and get the same error;  
Here is my input;  
strainphlan -s consensus\_markers/_.pkl -m clade\_markers/_.fna -r reference\_genome/\*.fasta -o output -c s\_\_Chlamydia\_trachomatis --phylophlan\_mode fast

and I get following error;  
Fri Nov 20 15:43:36 2020: Start StrainPhlAn 3.0 execution  
Fri Nov 20 15:43:36 2020: Creating temporary directory…  
Fri Nov 20 15:43:36 2020: Done.  
Fri Nov 20 15:43:36 2020: Getting markers from main sample files…  
Fri Nov 20 15:43:37 2020: Done.  
Fri Nov 20 15:43:37 2020: Getting markers from main reference files…Warning: [blastn] Examining 5 or more matches is recommended  
Warning: [blastn] Examining 5 or more matches is recommended

Fri Nov 20 15:43:37 2020: Done.  
Fri Nov 20 15:43:37 2020: Removing bad markers / samples…  
[e] Phylogeny can not be inferred. Too many samples were discarded  
Fri Nov 20 15:43:37 2020: Stop StrainPhlAn 3.0 execution.

Any recommendation would greatly be appreciated  
Best  
Maryam

---

<div class="post-metadata">

### Author: ![aitor.blancomiguez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aitor.blancomiguez/32/86_2.png) [@aitor.blancomiguez](https://forum.biobakery.org/u/aitor.blancomiguez)
#### Post date: [November 23, 2020, 1:36pm UTC](https://forum.biobakery.org/t/error-related-to-step-3-reference-genome/1310/6 "2020-11-23T13:36:14Z")

</div>

Hi @MaryamTarazkar  
For improving the quality of the phylogenetic reconstruction, StrainPhlAn performs a first screening and filtering step. By default, StrainPhlAn will discard samples with less than 20 markers (for the selected species, in your case _C. trachomatis_) and it will also discard markers present in less than 80% of the samples. These thresholds can modified using the paramenters `sample_with_n_markers` and `marker_in_n_samples` respectively. Even if you have enough samples, if your samples / reconstructed markers don’t pass these thresholds you will retrieve these kind of errors during execution.  
For discover which species you can reconstruct with an specific set of thresholds, you can run StrainPhlAn with the parameter `print_clades_only`

I hope this helps.  
Best,  
Aitor
