core_diversity_analyses.py not running with mapping file

234 views
Skip to first unread message

Sofia P

unread,
May 25, 2016, 5:04:23 AM5/25/16
to Qiime 1 Forum


Hello, 


I am running core_div_analyses as such


core_diversity_analyses.py -i fruit.biom -o core_div_analyses_fruita/ -m mapping_fruita.txt -c Description -t gg_13_8_otus/trees/97_otus.tree -e 50234 


But am getting this error: 


*** ERROR RAISED DURING STEP: Make emperor plots, weighted_unifrac)

Command run was:

 make_emperor.py -i core_div_analyses_fruita//bdiv_even50234//weighted_unifrac_pc.txt -o core_div_analyses_fruita//bdiv_even50234//weighted_unifrac_emperor_pcoa_plot/ -m mapping_fruita.txt 

Command returned exit status: 2

Stdout:


Stderr

Error in make_emperor.py: The metadata mapping file has fewer sample identifiers than the coordinates file. Verify you are using a mapping file that contains at least all the samples contained in the coordinates file(s). You can force the script to ignore these samples by passing the '--ignore_missing_samples' flag. 


I have double-checked my mapping file and it has the 123 samples, whilst the I expect I have run 122. Hence, I am not sure why it is saying it is missing files since it appears to have one extra. Is there a script to automatically cross-ref both files? Otherwise, I have tried the --ignore_missing_files flag but its tells me Error in core_diversity_analyses.py: no such option: --ignore_missing_samples


Can someone please offer any help as to how to get the core_div_analyses to run? 


Best, 

Sofia 

Greg Caporaso

unread,
May 25, 2016, 11:48:38 AM5/25/16
to Qiime 1 Forum
Hi Sofia,
This will happen if there are sample identifiers in your biom file that are not in your mapping file. We don't have a script that will let you identify the differences unfortunately, but you can see which samples are in each by comparing the sample ids in your mapping file with the ids that are listed when you run:

biom summarize-table -i fruit.biom

If you compare those and can't figure out the difference, you can post the output of that command here with your mapping file and I can take a look.

I don't recommend using the --ignore_missing_samples parameter here as it sounds like there is some discrepancy between your mapping file and biom table, so I don't think you'll get the results you want. However if you did want to run that, you'd need to pass a parameters file to core_diversity_analyses.py that contains the following line:

make_emperor:ignore_missing_samples True

Greg

Sofia P

unread,
May 27, 2016, 3:21:07 AM5/27/16
to Qiime 1 Forum
Thanks for your response Greg!!! 

I imported the mapping and the summary into Excel, but am not sure of an easier way to cross-check the two apart from manually... If you have any suggestions please let me know :) 

Best, 
Sofia
fruit_summarized
mapping_fruita.txt

Sofia P

unread,
May 27, 2016, 4:29:27 AM5/27/16
to Qiime 1 Forum
Hi, 

I ended up correcting the mapping file (see attached) by removing four of the samples not in the biom file. However, I am still getting the same error when I try to run core_div_analyses again.. can you perhaps see where I'm going wrong? 

BR, 
Sofia
mapping_fruit_complete.txt

Greg Caporaso

unread,
May 27, 2016, 7:08:42 PM5/27/16
to Qiime 1 Forum
Hi Sofia,
When I load these files I see the following ids present in your biom file but not your mapping file:

{'00042106',
 '00201101',
 '00851101',
 '03142104',
 '03631101',
 '04621101',
 '04921103',
 '05691202',
 '06551102',
 '06992203',
 '07292203',
 '07351101',
 '07661102',
 '07692103',
 '07932105',
 '08601102',
 '09482104'}

Notice that all of these start with one or more zeros - it looks like you're a victim of Excel here. What's happening is Excel is removing leading zeros from your sample ids because it's interpreting them as integers (where leading zeros aren't meaningful). However, the sample ids in your biom table have those leading zeros. 

I updated your mapping file to contain those leading zeros, so this should work for you in QIIME now. However, if you open the attached mapping file in Excel again, you'll probably encounter the same issue.

Greg
mapping_fruit_complete.txt

Gu Min

unread,
Apr 4, 2017, 11:26:16 PM4/4/17
to Qiime 1 Forum
Hi Grey,

I met the same problem when running the core_dive_analysis.

But I checked the making file and my biom_table. They had the same sample names. 

Both the mapping file and the biom were uploaded. Could you help me to check it? 

Due to the uploading file size limitation, I share the link of biom with you.


Thanks very much.

Best,
Min
testmap.txt

Greg Caporaso

unread,
Apr 5, 2017, 6:33:00 PM4/5/17
to Qiime 1 Forum
Hi Min, Can you please run print_qiime_config.py and post the output, and additionally send the command that you're running and the error message that you're receiving.

Thanks!
Greg
Reply all
Reply to author
Forward
0 new messages