Question: error opening file after QIIME script: add_qiime_labels.py
0
gravatar for aester
4.2 years ago by
aester0
United States
aester0 wrote:

So i am trying to add qiime labels. when i run the script 

add_qiime_labels.py -i . -m mouse_ForwardMap.txt -c SampleID  -o combined_fasta

it says that it can't read one of my files. But when i open the file with the less command its perfectly fine. Is there any thing that i should double check?

I already validated the mapping file, no errors detected. 

MacQIIME ford132-r05216:~ $ validate_mapping_file.py -m /Users/aester/Desktop/qiime_generated/ae_ForwardMap.txt -o mapping_output

No errors or warnings were found in mapping file.

but when i run the script like i said it gives back: 

Traceback (most recent call last):

  File "/macqiime/bin/add_qiime_labels.py", line 4, in <module>

    __import__('pkg_resources').run_script('qiime==1.9.0', 'add_qiime_labels.py')

  File "build/bdist.macosx-10.4-x86_64/egg/pkg_resources/__init__.py", line 698, in run_script

  File "build/bdist.macosx-10.4-x86_64/egg/pkg_resources/__init__.py", line 1616, in run_script

  File "/macqiime/lib/python2.7/site-packages/qiime-1.9.0-py2.7.egg/EGG-INFO/scripts/add_qiime_labels.py", line 111, in <module>

    main()

  File "/macqiime/lib/python2.7/site-packages/qiime-1.9.0-py2.7.egg/EGG-INFO/scripts/add_qiime_labels.py", line 107, in main

    output_dir, count_start)

  File "/macqiime/lib/python2.7/site-packages/qiime-1.9.0-py2.7.egg/qiime/add_qiime_labels.py", line 44, in add_qiime_labels

    fasta_files = get_fasta_fps(fasta_dir, fasta_name_to_sample_id.keys())

  File "/macqiime/lib/python2.7/site-packages/qiime-1.9.0-py2.7.egg/qiime/add_qiime_labels.py", line 123, in get_fasta_fps

    raise IOError("Unable to open %s" % curr_fp)

IOError: Unable to open ./F2.all.fa

Less F2.all.fa

>M01205:41:000000000-AF9F7:1:1101:14308:1960 1:N:0:6

TACGGAGGATCCGAGTGTTATCCGGATTTATTGGGTTTAAAGGGTGCGTAGGCGGAGGATCAAGTCAGTGGTGAAATGGTGCGGCTCAACCGTAGCATTGCCGTTGAAACTGGTTTTCTAGAGTGCGAATGAGGTGGGCGGAATGTGTCATGTAGCGGTGAAATGCATAGATATGACAAAGAACACCGATGGCGAAGGCAGCTGACTGGGACGAAACTGACGCTGAGGCACGAAAGTGCGGGGATCGAACA

>M01205:41:000000000-AF9F7:1:1101:15221:1970 1:N:0:6

TACGTAGGTGGCGAGCGTTATCCGGAATTATTGGGCGTAAAGAGTGAGCAGGCGGCATGGTAAGTTTGGAGTGAAAGCGTTGGGCTCAACCCCATACAGCTTCGAAAACTGCCAGGCTAGAGTACGGGAGAGGTAAACGGAACTCCATGTGTAGCGGTGAAATGCGTAGATATTAGGAGGAACACCAGTGGCGAAGGCGGCTTACTGGACTGTAACTGACGTTGAGGCACGAAAGCGTGGGGAGCAAACA

Please help!!

qiime amplicon • 2.5k views
ADD COMMENTlink modified 5 months ago by Payal40 • written 4.2 years ago by aester0
0
gravatar for Josh Herr
4.2 years ago by
Josh Herr5.6k
University of Nebraska
Josh Herr5.6k wrote:

It doesn't look like you have added any sample information to your fasta output sequences -- QIIME will merge all the fasta files and then edit the sequence headers to have sample, treatment, etc. data in the fasta header.  This is not happening here.  

You should actually set your input fasta file (i.e. -i . is not acceptable for an input, you should use the respective file names and path for all of your input files)  -- the python script does not know which files to act upon given your input.

When you are running a script it is a good idea to know what type of input you need to provide and what the expected output should be.  You're not getting the expected output and the input fasta file is not being modified.

Just a personal note -- I don't actually use this python script in QIIME as it's easy to change fasta headers from the command line with other tools and I have found that sometimes errors arise from this first script.

I co-teach a course which focuses heavily on QIIME -- you should check out our tutorial materials along with the QIIME manual source

ADD COMMENTlink written 4.2 years ago by Josh Herr5.6k
0
gravatar for Payal
5 months ago by
Payal40
Payal40 wrote:

I had the same problem.

Two things figured: 1. The file should be fasta files. So convert your fastq files to fastq file using qiime scipts - convert_fastqual_fastq.py That will create .fna files 2. Now while you are running the add_qiime_labels.py, the mapping file name should be exactly similar to whats in your folder. So make sure to change your .fna files to just the name of th efile given. Eg. if your fasta filename is sample1.fa/sample1.fasta/sample1.fna, just change them to sample1 in the folder and then the script will recognize the filename.

It may work other way round, where you change the name of the files in the mapping file, but i used the previous method and it worked for me

ADD COMMENTlink written 5 months ago by Payal40
Please log in to add an answer.

Help
Access

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