This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Tophat-Fusion-Post Error

I ran tophat2 with the following command:

tophat-2.0.3.Linux_x86_64/tophat -p 6 --fusion-search -o outDir/ hg19 hg19.r1.fq hg19.r2.fq

I got all the usual tophat output files, including the fusions.out file. Next I want to run tophat-fusion-post.

I set up my folders as directed:

ls $
blast_human
ensGene.txt
mcl
refGene.txt
tophat_sim01
tophat_sim03

When I try and run my command I get a criptic error:

tophat-2.0.3.Linux_x86_64/tophat-fusion-post --output-dir tophatfusion_out ../tophat_fusion_refs/hg19
[Tue Jun 19 14:36:11 2012] Beginning TopHat-Fusion post-processing run (v2.0.3)
-----------------------------------------------
[Tue Jun 19 14:36:11 2012] Extracting 23-mer around fusions and mapping them using Bowtie
[Tue Jun 19 14:36:11 2012] Filtering fusions
        Processing: tophat_sim01/fusions.out
Traceback (most recent call last):
  File "/home/rcorbett/aligners/tophat2/tophat-2.0.3.Linux_x86_64/tophat-fusion-post", line 2083, in ?
    sys.exit(main())
  File "/home/rcorbett/aligners/tophat2/tophat-2.0.3.Linux_x86_64/tophat-fusion-post", line 2054, in main
    filter_fusion(bwt_idx_prefix, params)
  File "/home/rcorbett/aligners/tophat2/tophat-2.0.3.Linux_x86_64/tophat-fusion-post", line 695, in filter_fusion
    filter_fusion_impl(fusion_file, refGene_list, ensGene_list, seq_chr_dic, fusion_gene_list)
  File "/home/rcorbett/aligners/tophat2/tophat-2.0.3.Linux_x86_64/tophat-fusion-post", line 422, in filter_fusion_impl
    kmer_len = len(seq_chr_dic.keys()[0])
IndexError: list index out of range

In the output folder I have

ls $
fusion_seq.bwtout
fusion_seq.fa
fusion_seq.map
sample_list.txt

but only the sample_list.txt and fusion_seq.fa are non-empty files. Can anyone provide with with some help?

hi,Richard: I have got the exactly same error with you.I really need your help to solve it.Thank you!

@Andrew All I did to get around the error was download the bowtie1 reference and put it with my bowtie2 reference. good luck!

1 answer

So, tophat-fusion-post is a python wrapper. If you dig in to it you'll find

cmd = ['bowtie', '-p', '8', '-a', '-n', '3', '-m', '100', bwt_idx_prefix, '-f', '%sfusion_seq.fa' % output_dir]
subprocess.call(cmd, stdout=open(output_dir + 'fusion_seq.bwtout', 'w'), stderr=open('/dev/null', 'w'))

When looked in the stderr I found that tophat-fusion-post wanted to use the bowtie1 index for my genome, while I only had the bowtie 2 index, which I used to run tophat 2.

Hi Richard, I've got the same error when using tophat-fusion-post, but the command are not the same. I used the python /path/to/tophatfusion-0.1.0/src/tophat-fusion-post.py
(yes I used the oldest version of the tophat-fusion.) And the directory was arranged with the directions in tophat-fusion manual. I'm sure I used the bowtie 1 index but still occur the errors. Do you have any suggestions to solve it? Thank you.

Hey Richard, I really need your help because I stuck in this same problem using tophat 2.0.4 whatever I use the bowtie1 index or 2. Can you give me a hand?

@conan: To get around the problem I had, I just needed to index my reference fasta with both versions of bowtie (or download both sets of reference files from the website). Then I just put all the files in the same folder. You can put them all in the same folder because the extension are unique for bowtie1 and bowtie2 reference files. Then I just pointed tophat-fusion-post at this reference folder.

OK I'll have a try now, thank you. :)

hi,Conan: I have got the exactly same error with you.I really need your help to solve it.Thank you!

Hey Richard, it's embrassing to give you a feedback after so long time, since I successfully used deFuse 5.0 so I put tophat-fusion-post aside until recently I want to see the overlap between the two programs...

Unfortunately I still got the same error, using different index combination though: put 2 indices together which are both downloaded from bowtie/bowtie2 official website, and tried to point to the folder I put them.

You mentioned that you digged into the stderr then found that the problem is bowtie1 needs its reference, I'm not good at python so could you please tell me where the standard error file is so that I can deal with my specific problem? Thank you.

@Conan: Digging up some really old post...Just wondering if you managed to run deFuse sucessfully? I am trying to run deFuse 0.6.1 and encountered some errors. If you still can remember this post and have some spare time, maybe we can discuss this further? :) many thanks

Hi Zaki, sorry for delay. I've solved the problem of tophat-fusion-post, it's simply because in my tophat-fusion result there's no 'chr' in chromosome column but the file ensGene.txt, the one that is essential for tophat-fusion-post, has 'chr' symbol in the chromosome column so I've run tophat-fusion-post successfully after removed chr symbols. For deFuse yes I ran succesfully but I used version 0.50, please feel free to report your errors and maybe I could provide some help.

Log in to answer this question.