Question: TopHat error: IOError [errno 2] No such file or directory: '-o'
gravatar for lishen0709
7 weeks ago by
lishen07090 wrote:

Hello everyone.

I'm now running tophat in our server. First, I just simply tried "tophat -p 8 -G <gtf_file> <ref_genome> <fa1><fa2>" and it worked. Then I wrote a for loop scripts but It reported error:

[2019-04-03 10:49:16] Beginning TopHat run (v2.1.0)


[2019-04-03 10:49:16] Checking for Bowtie

                  Bowtie version:

[2019-04-03 10:49:16] Checking for Bowtie index files (genome)..

[2019-04-03 10:49:16] Checking for reference FASTA file

Warning: Could not find FASTA file mouse/bowtie2_index_mouse/mouse_ref.fa

[2019-04-03 10:49:16] Reconstituting reference FASTA file from Bowtie index

Executing: /opt/sw/packages/gcc-4.8/bowtie2/2.2.9/bin/bowtie2-inspect 
mouse/bowtie2_index_mouse/mouse_ref > ./tophat_out/tmp/mouse_ref.fa

[2019-04-03 10:51:05] Generating SAM header for mouse/bowtie2_index_mouse/mouse_ref

Traceback (most recent call last):

File "/opt/sw/packages/gcc-4.8.3/mvapich2-2.1/boost-1.59.0/tophat2/2.1.0/bin/tophat", line 4095, in <module>


File "/opt/sw/packages/gcc-4.8.3/mvapich2-2.1/boost-1.59.0/tophat2/2.1.0/bin/tophat", line 3949, in main
    params.read_params = check_reads_format(params, reads_list)

File "/opt/sw/packages/gcc-4.8.3/mvapich2-2.1/boost-1.59.0/tophat2/2.1.0/bin/tophat", line 1844, in check_reads_format
    zf = ZReader(f_name, params)

File "/opt/sw/packages/gcc-4.8.3/mvapich2-2.1/boost-1.59.0/tophat2/2.1.0/bin/tophat", line 1797, in __init__

IOError: [Errno 2] No such file or directory: '-o'

My for loop code is shown as below:

for name1 in R1/*_R1_001.fastq.trimmed_val.fq; 
name2="R2/$(basename "$name1" _R1_001.fastq.trimmed_val.fq)_R2_001.fastq.trimmed_val.fq"; 

if [ ! -f "$name2" ]; then printf 'Missing "%s"\n' "$name2"; 
tophat -p 8 mouse/bowtie2_index_mouse/mouse_ref -o tophat_out/ -G mouse/ensembl_gtf/Mus_musculus.GRCm38.95.chr_patch_hapl_scaff.gtf $name1 $name2; 

It looks like the directory path problem but I have changed the path several times it still report this error. I wonder if anyone could help me about this?

Thank you!

ADD COMMENTlink modified 6 weeks ago by kristoffer.vittingseerup1.8k • written 7 weeks ago by lishen07090

Does the tophat_out directory already exist before you run the program?

ADD REPLYlink written 7 weeks ago by jrj.healey12k

Can you share one file name belonging to the same sample from R1 and R2 directory?

ADD REPLYlink written 6 weeks ago by arup1.3k
gravatar for swbarnes2
7 weeks ago by
United States
swbarnes25.5k wrote:

Its probably safer to list your options like -o and -G before you give the path to the genome Notice how in your first working example, -G is before you specified the path to the genome.

Usage: tophat [options]* <genome_index_base> <reads1_1[,...,readsn_1]&gt; [reads1_2,...readsn_2]<="" p="">

I think the software thinks it's looking for a fastq file called -o when you put that right after the path to your genome.

ADD COMMENTlink modified 7 weeks ago • written 7 weeks ago by swbarnes25.5k
gravatar for kristoffer.vittingseerup
6 weeks ago by
European Union
kristoffer.vittingseerup1.8k wrote:

You should probably not be using tophat! See this tweet from Lior Pachter one of the inventors of tophat. Use HISAT or STAR instead.

ADD COMMENTlink written 6 weeks ago by kristoffer.vittingseerup1.8k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1144 users visited in the last hour