<pre class="lang-bash prettyprint-override"><code>./stats.sh in=notExistingFile.fa
Exception in thread &quot;main&quot; java.lang.RuntimeException: Input file does not appear to be valid: notExistingFile.fa
        at jgi.AssemblyStats2.process(AssemblyStats2.java:248)
        at jgi.AssemblyStats2.main(AssemblyStats2.java:40)

</code></pre>
<p>The error comes when the file does not exist. My best guess is that it is a typo on your side. Is the path really <code>/Home</code> with capital &quot;H&quot;? Most OS like Linux and macOS use lowercase. Anyway, make sure the file exists.</p>

CC BY-SA 4.0
2023-08-02T07:38:26.680Z
2023-08-02T07:38:26.680Z
ATpoint
<p>I am trying to calculate the N50 value from the assembled FASTA file. I used stats.sh from the BBmap package. I executed the following command</p>
<pre><code>./stats.sh  in=/Home/Downloads/BBMap_39.01/bbmap/resources/contig.fasta
</code></pre>
<p>I got the following error.</p>
<pre><code>Exception in thread &quot;main&quot; java.lang.RuntimeException: Input file does not appear to be valid: /Home/Downloads/BBMap_39.01/bbmap/resources/contig.fasta
    at jgi.AssemblyStats2.process(AssemblyStats2.java:248)
    at jgi.AssemblyStats2.main(AssemblyStats2.java:40)
</code></pre>
<p>How to resolve this error?</p>
<p>The sequences are shown below. My file also contains some lengthy sequences.</p>
<pre><code>&gt;NODE_1_length_3013_cov_4.540906
TGGGGGATCATGTAACTCGCCTTGATCGTTGGGAACCGGAGCTGAATGAAGCCATACCAA
ACGACGAGCGTGACACCACGATGCCTGTAGCAATGGCAACAACGTTGCGCAAACTATTAA
CTGGCGAACTACTTACTCTAGCTTCCCGGCAACAATTAATAGACTGGATGGAGGCGGATA
AAGTTGCAGGACCACTTCTGCGCTCGGCCCTTCCGGCTGGCTGGTTTATTGCTGATAAAT
CTGGAGCCGGTGAGCGTGGGTCTCGCGGTATCATTGCAGCACTGGGGCCAGATGGTAAGC
CCTCCCGTATCGTAGTTATCTACACGACGGGGAGTCAGGCAACTATGGATGAACGAAATA
GACAGATCGCTGAGATAGGTGCCTCACTGATTAAGCATTGGTAACTGTCAGACCAAGTTT
&gt;NODE_2_length_2292_cov_16.637908
CAAAGGAATAATAATTGACTGATGATTGGTTCATTAATTACTTCATTAGTTAATAGATTG
CAGTCTTTATAAATAAGTTTATAGTTGTATTCCACAGAATTTCTGATCCTGTCTCTGCCC
TACCCAATGTTTTATCATTAAACTTCATTTACATAAGATAGTATGTTCAACAAATATAAA
GATTTGCTGGAATGGAAGGCACAGTAAGATATTTCACAGGATAAAATTAAAGTAGATGTC
AACAGAGTAAATCAAAGTGAAATTTAATAGAGTTAAACAGTAAGTGTTTTAAATACCAGG
ATTAAATTCCATGAAGCTGCAGCTTTTAAAAAAAGGCACAAAGTGGAATAAGAAAAAATG
ACTTTCAGAAAGTTAATGTAAAGAAAGCTCACGGTTTTCATTGGCTGCCTGCTCAGTTTG
</code></pre>

CC BY-SA 4.0
2023-08-01T08:14:06.877Z
Also, why you run this on a file provided by bbmap rather than your own?
ATpoint
CC BY-SA 4.0
2023-08-02T01:49:11.667Z
@ATpoint Thank you for your comment. contig.fasta is my file. I just copied to the resources directory.
seq
CC BY-SA 4.0
2023-08-02T03:11:35.617Z
Hmmm. Is this a permissions error? Can you type `ls -l /Home/Downloads/BBMap_39.01/bbmap/resources/contig.fasta` and report the output?
M__
CC BY-SA 4.0
2023-08-02T05:16:59.513Z
@M_. Thanks for your comment. ls -l shows the list of files. The first two lines are shown. -rwxrwxrwx  1 user user  2674 Jun 12  2020 addadapters.sh
-rwxrwxrwx  1 user user  2674 Jun 12  2020 addadapters.sh
seq
CC BY-SA 4.0
2023-08-02T12:20:49.380Z
I agree with @atpoint as best guess. `ls /home/Downloads/BBMap_39.01/bbmap/resources/contig.fasta` , i.e. lower case `h`.  It could be other things. Can you try their test data?
M__
<fasta><sequence-analysis><linux>
stats.sh error in BBmap package
# stats.sh error in BBmap package

(Asked by: username_0 on 2023-08-01)

I am trying to calculate the N50 value from the assembled FASTA file. I used stats.sh from the BBmap package. I executed the following command
./stats.sh  in=/Home/Downloads/BBMap_39.01/bbmap/resources/contig.fasta

I got the following error.
Exception in thread "main" java.lang.RuntimeException: Input file does not appear to be valid: /Home/Downloads/BBMap_39.01/bbmap/resources/contig.fasta
    at jgi.AssemblyStats2.process(AssemblyStats2.java:248)
    at jgi.AssemblyStats2.main(AssemblyStats2.java:40)

How to resolve this error?
The sequences are shown below. My file also contains some lengthy sequences.
>NODE_1_length_3013_cov_4.540906
TGGGGGATCATGTAACTCGCCTTGATCGTTGGGAACCGGAGCTGAATGAAGCCATACCAA
ACGACGAGCGTGACACCACGATGCCTGTAGCAATGGCAACAACGTTGCGCAAACTATTAA
CTGGCGAACTACTTACTCTAGCTTCCCGGCAACAATTAATAGACTGGATGGAGGCGGATA
AAGTTGCAGGACCACTTCTGCGCTCGGCCCTTCCGGCTGGCTGGTTTATTGCTGATAAAT
CTGGAGCCGGTGAGCGTGGGTCTCGCGGTATCATTGCAGCACTGGGGCCAGATGGTAAGC
CCTCCCGTATCGTAGTTATCTACACGACGGGGAGTCAGGCAACTATGGATGAACGAAATA
GACAGATCGCTGAGATAGGTGCCTCACTGATTAAGCATTGGTAACTGTCAGACCAAGTTT
>NODE_2_length_2292_cov_16.637908
CAAAGGAATAATAATTGACTGATGATTGGTTCATTAATTACTTCATTAGTTAATAGATTG
CAGTCTTTATAAATAAGTTTATAGTTGTATTCCACAGAATTTCTGATCCTGTCTCTGCCC
TACCCAATGTTTTATCATTAAACTTCATTTACATAAGATAGTATGTTCAACAAATATAAA
GATTTGCTGGAATGGAAGGCACAGTAAGATATTTCACAGGATAAAATTAAAGTAGATGTC
AACAGAGTAAATCAAAGTGAAATTTAATAGAGTTAAACAGTAAGTGTTTTAAATACCAGG
ATTAAATTCCATGAAGCTGCAGCTTTTAAAAAAAGGCACAAAGTGGAATAAGAAAAAATG
ACTTTCAGAAAGTTAATGTAAAGAAAGCTCACGGTTTTCATTGGCTGCCTGCTCAGTTTG

**Tags:** fasta, sequence-analysis, linux
> **Comments:**
> **username_1**: Also, why you run this on a file provided by bbmap rather than your own?  
> **username_0**: @ATpoint Thank you for your comment. contig.fasta is my file. I just copied to the resources directory.  
> **username_2**: Hmmm. Is this a permissions error? Can you type `ls -l /Home/Downloads/BBMap_39.01/bbmap/resources/contig.fasta` and report the output?  
> **username_0**: @M_. Thanks for your comment. ls -l shows the list of files. The first two lines are shown. -rwxrwxrwx  1 user user  2674 Jun 12  2020 addadapters.sh -rwxrwxrwx  1 user user  2674 Jun 12  2020 addadapters.sh  
> **username_2**: I agree with @atpoint as best guess. `ls /home/Downloads/BBMap_39.01/bbmap/resources/contig.fasta` , i.e. lower case `h`.  It could be other things. Can you try their test data?  

---

## 1 answers

### Answer by username_1 on 2023-08-02. Score: 1

./stats.sh in=notExistingFile.fa
Exception in thread "main" java.lang.RuntimeException: Input file does not appear to be valid: notExistingFile.fa
        at jgi.AssemblyStats2.process(AssemblyStats2.java:248)
        at jgi.AssemblyStats2.main(AssemblyStats2.java:40)


The error comes when the file does not exist. My best guess is that it is a typo on your side. Is the path really /Home with capital "H"? Most OS like Linux and macOS use lowercase. Anyway, make sure the file exists.


---

