Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

motus profile can't output the bam file [Issue with samtools 1.10] #52

Closed
Shinexy99 opened this issue Jun 11, 2020 · 8 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Shinexy99
Copy link

I have tested the code by execute as :
motus profile -s test1_single.fastq -o xx -I xx.bam -t 11
no right bam file out put.
it reported the error as :
[E::sam_hrecs_error] Missing tab at line 2: "@co min_len_alignment 75"
samtools view: failed to add PG line to the header
[W::map_db] Warning: failed to save intermediate bam file
[W::map_db] Warning: failed to save intermediate bam file

@AlessioMilanese
Copy link
Member

Hi @Shinexy99,

Works all good for me, call:

motus profile -s db_mOTU_test/test1_single.fastq -o ~/Desktop/xx -I ~/Desktop/xx.bam

Print:

[main]  MAP_TAX -----------
[main] Number of detected lanes: 1
[main] Run bwa on lane 1
 [map_db](map single reads) 6.04 sec
[main] (Save bam file produced by bwa) 1.47 sec
[main] Total time map_tax: 7.65 sec
[main]  CALC_MGC -----------
[main] Minimum alignment length: 75 (average read length: 165)
 [calc_mgc](parse 1 sam/bam file) 3.48 sec
 [calc_mgc](get mgc abundances) 0.01 sec
[main] Total time calc_mgc: 3.75 sec
[main]  CALC_MOTU -----------
 [calc_motu] (Create taxonomy profile) 0.49 sec
[main]  TOTAL TIME (map_tax+calc_mgc+calc_motu): 11.89 sec

@AlessioMilanese
Copy link
Member

Can I ask you to run:

samtools --version

and:

motus profile --test

@AlessioMilanese AlessioMilanese self-assigned this Jun 11, 2020
@AlessioMilanese AlessioMilanese added the help wanted Extra attention is needed label Jun 11, 2020
@Shinexy99
Copy link
Author

Shinexy99 commented Jun 12, 2020

This is the result when running the test of motus profile --test:

 ------------------------------------------------------------------------------
|                               TEST MOTUS TOOL                                |
 ------------------------------------------------------------------------------

1-- ran setup.py: done

2-- Tools and versions:
- python:    correct
- bwa:       correct
- samtools:  correct
- metaSNV:   WARNING. metaSNV is not in the path


3-- Taxonomy profiling test:
- Run motus (-v 1, only error messages):
- end motus call

Check resulting profile: correct

@Shinexy99
Copy link
Author

my samtools version details:
samtools 1.10
Using htslib 1.10
Copyright (C) 2019 Genome Research Ltd.

@AlessioMilanese
Copy link
Member

There is an issue with the header of the BAM file:

@PG	ID:bwa	PN:map_tax 2.5.1 | gene database: nr2.5.1 | 165
@CO min_len_alignment 75
@CO min_perc_id 97
@CO min_perc_query 45
@SQ	SN:metaMG0000000.COG0012	LN:1694
@SQ	SN:metaMG0000001.COG0012	LN:1646

After @PG and @SQ there is a tab ("\t"), while after @CO there is space (" ").
For samtools 1.9 this was not an issue. But, this changed for samtools 1.10.

@AlessioMilanese
Copy link
Member

AlessioMilanese commented Jun 12, 2020

You have 2 possibilities for now, to solve the issue:

  1. Replace the file mOTUs_v2/motus with this: motus.zip. Note that you have to unzip it first.
  2. remove samtools 1.10, and install samtools 1.9

I will solve the issue, test it and update the code next week.

@AlessioMilanese AlessioMilanese added bug Something isn't working and removed help wanted Extra attention is needed labels Jun 12, 2020
@AlessioMilanese AlessioMilanese changed the title motus profile can't output the bam file motus profile can't output the bam file [Issue with samtools 1.10] Jun 12, 2020
@Shinexy99
Copy link
Author

Shinexy99 commented Jun 12, 2020

The bug removed! Thanks!

I want to check if the test reads count result is right. but when compared with the test1.motus
the counts of motus (more than 0) were different in most of species. I will attach my result.

xx.txt

@AlessioMilanese
Copy link
Member

Hi @Shinexy99,

Sorry I didn't see your answer. I was not notified that you edited the answer, I think I am notified only when there is a new message.

Try to run:

motus profile --test

If you get Check resulting profile: correct, then it's all good.

AlessioMilanese added a commit that referenced this issue Jan 27, 2021
AlessioMilanese added a commit that referenced this issue Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants