NameError: global name '...' is not defined
0
0
Entering edit mode
5.2 years ago
mdgn ▴ 10

Hello, I am trying to use a script for the software Transdecoder. But I am getting this error. I created a new conda environment with all necessary prerequisites.

$ python transdecoder_wrapper.py Trinity_lactea.largest_cluster_transcripts.fa 2 stranded ./
TransDecoder.LongOrfs -t /home/papaya/anaconda2/envs/transdecoder/Trinity_lactea.largest_cluster_transcripts.fa -S
* Running CMD: /home/papaya/anaconda2/envs/transdecoder/opt/transdecoder/util/compute_base_probs.pl /home/papaya/anaconda2/envs/transdecoder/Trinity_lactea.largest_cluster_transcripts.fa 1 > /home/papaya/anaconda2/envs/transdecoder/Trinity_lactea.largest_cluster_transcripts.fa.transdecoder_dir/base_freqs.dat


-first extracting base frequencies, we'll need them later.


- extracting ORFs from transcripts.
-total transcripts to examine: 1849
[1800/1849] = 97.35% done    CMD: touch /home/papaya/anaconda2/envs/transdecoder/Trinity_lactea.largest_cluster_transcripts.fa.transdecoder_dir.__checkpoints_longorfs/TD.longorfs.ok


#################################
### Done preparing long ORFs.  ###
##################################

    Use file: /home/papaya/anaconda2/envs/transdecoder/Trinity_lactea.largest_cluster_transcripts.fa.transdecoder_dir/longest_orfs.pep  for Pfam and/or BlastP searches to enable homology-based coding region identification.

    Then, run TransDecoder.Predict for your final coding region predictions.


Traceback (most recent call last):
  File "transdecoder_wrapper.py", line 250, in <module>
    run_transdecoder_blastp(transcripts,num_cores,strand,DIR)
  File "transdecoder_wrapper.py", line 106, in run_transdecoder_blastp
    assert fasta_ok(DIR+allpep), DIR+allpep+" small in size"    
  File "transdecoder_wrapper.py", line 30, in fasta_ok
    for i in seq.read_fasta_file(fasta):
NameError: global name 'seq' is not defined

I couldn't find the attachment link so the pipeline I am using is this . Transdecoder_wrapper.py step is where my problem is happening. Thank you in advance.

Mert

RNA-Seq software error gene python • 2.8k views
ADD COMMENT
0
Entering edit mode

What does the output of python transcoder_wrapper.py look like?

It seems its not finding your fasta/sequences. I'm not familiar with the tool, but I'm guessing you could be missing some -f or -i like flags, since you're currently providing them as positionals, which typically come at the end of a command.

ADD REPLY
0
Entering edit mode

You are trying to use a third-party wrapper to run TransDecoder, honestly I think it is better to just run TransDecoder directly. It has good documentation.

ADD REPLY
0
Entering edit mode

The output should contain pep and cds files for downstream analyses with some descriptive outputs as well.

@Joe, I will look into this, from my search it might be a problem about Biopython.

@h.mon, Yes I used it before, but since I was following this pipeline this time I tried to stick with it. But if i can't find a solution I will do as you suggest.

Thank you for answers.

ADD REPLY
0
Entering edit mode

Sorry, typo on my part, I meant what does the output of python transcoder_wrapper.py --help look like? (not the result output)

It does seem strange to me to use a python wrapper around a perl script...

ADD REPLY
0
Entering edit mode

Usage: python transdecoder_wrapper.py transcripts num_cores strand(stranded or non-stranded) output_dir

This is the --help output.

To be honest the pipeline is outdated despite of an update on the scripts. The softwares have compatibility issues with outdated versions and so on. I thought giving a last shot asking here hoping someone had an idea.

ADD REPLY

Login before adding your answer.

Traffic: 1809 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6