IOError: could not open file `/.../EMIRGE_output/iter.00/iter.00.cons.fasta`

140 views
Skip to first unread message

Galen Seilis

unread,
Oct 28, 2015, 3:39:40 AM10/28/15
to EMIRGE users
EMIRGE doesn't seem to be writing the first iteration. Any ideas what I could do to fix this?

Calculating likelihood (1778, 46628) for iteration 0 at Wed Oct 28 01:27:04 2015...
        Calculating Pr(N=n) for iteration 0 at Wed Oct 28 01:27:04 2015...
        DONE calculating Pr(N=n) for iteration 0 at Wed Oct 28 01:27:04 2015 [0:00:00.001231]...
DONE Calculating likelihood for iteration 0 at Wed Oct 28 01:27:04 2015 [0:00:00.002846]...
Calculating posteriors for iteration 0 at Wed Oct 28 01:27:04 2015...
DONE Calculating posteriors for iteration 0 at Wed Oct 28 01:27:04 2015 [0.001 seconds]...
/home/galen/bin/EMIRGE/EMIRGE-master/emirge_amplicon.py:508: RuntimeWarning: invalid value encountered in divide
  self.priors[-1] = numpy.asarray(self.posteriors[-1].sum(axis = 1)).flatten() / self.posteriors[-1].sum()
Writing consensus for iteration 0 at Wed Oct 28 01:27:04 2015...
        snp_minor_prob_thresh = 0.100
        snp_percentage_thresh = 0.040
        Split out 0 new minor strain sequences.
        Average time for non-split sequences: [0.000000 seconds]
DONE Writing consensus for iteration 0 at Wed Oct 28 01:27:04 2015 [0:00:00.014303]...
Clustering sequences for iteration 0 at Wed Oct 28 01:27:04 2015...
        cluster threshold = 0.970
[fai_load] build FASTA index.
[fai_load] fail to open FASTA index.
Traceback (most recent call last):
  File "/home/galen/bin/EMIRGE/EMIRGE-master/emirge_amplicon.py", line 1576, in <module>
    main()
  File "/home/galen/bin/EMIRGE/EMIRGE-master/emirge_amplicon.py", line 1568, in main
    do_iterations(em, max_iter = options.iterations, save_every = None)
  File "/home/galen/bin/EMIRGE/EMIRGE-master/emirge_amplicon.py", line 1184, in do_iterations
    em.do_iteration(em.current_bam_filename, em.current_reference_fasta_filename)
  File "/home/galen/bin/EMIRGE/EMIRGE-master/emirge_amplicon.py", line 435, in do_iteration
    self.cluster_sequences(consensus_filename)  # merges sequences that have evolved to be the same (USEARCH)
  File "/home/galen/bin/EMIRGE/EMIRGE-master/emirge_amplicon.py", line 759, in cluster_sequences
    return self.cluster_sequences_usearch(fastafilename)
  File "/home/galen/bin/EMIRGE/EMIRGE-master/emirge_amplicon.py", line 789, in cluster_sequences_usearch
    num_seqs = self.write_consensus_with_mask(fastafilename, tmp_fastafilename, mask="soft")
  File "/home/galen/bin/EMIRGE/EMIRGE-master/emirge_amplicon.py", line 725, in write_consensus_with_mask
    reference_fastafile = pysam.Fastafile(reference_fastafilename)
  File "pysam/cfaidx.pyx", line 81, in pysam.cfaidx.FastaFile.__cinit__ (pysam/cfaidx.c:1674)
  File "pysam/cfaidx.pyx", line 105, in pysam.cfaidx.FastaFile._open (pysam/cfaidx.c:2255)
IOError: could not open file `/home/galen/bin/EMIRGE/troubleshooting/miseq_test_data/sample_1_EMIRGE_output/iter.00/iter.00.cons.fasta`

Galen Seilis

unread,
Oct 28, 2015, 11:57:57 AM10/28/15
to EMIRGE users
To anyone who has a similar issue, I'd like to share what I found.

I was calling emirge_amplicon.py without sudo by a script that was called by sudo. This seems to have solved the problem of the program not being able to open the iteration files.

xulin...@gmail.com

unread,
Apr 13, 2016, 8:42:31 PM4/13/16
to EMIRGE users
Hi Galen,

I have this kind of problem too. I'm just wondering can you explain a little bit more about your solution?

Best,

Ling

Galen Seilis

unread,
Apr 14, 2016, 11:37:04 PM4/14/16
to EMIRGE users, xulin...@gmail.com
Hi Ling,

Sure, as best as I can recall, I didn't have permission to execute emirge_amplicon.py. As I am usually running Linux operating systems (at the time it was possibly either Ubuntu or Mint), I used sudo to overcome that permission restriction. At this time, I would recommend using something like the chmod command to set permissions, if you are running Linux, instead of using sudo to override them.

My mentioning above to multiple scripts isn't relevant . I had written a Python script to run my pipeline, which included calls to emirge_amplicon.py. Just make sure you have permissions setup to run all your code, and this shouldn't be an issue.

Best Regards,

Galen
Reply all
Reply to author
Forward
0 new messages