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

samtools-1.3 sort bug #23

Closed
sidiropoulos opened this issue Jan 20, 2016 · 5 comments
Closed

samtools-1.3 sort bug #23

sidiropoulos opened this issue Jan 20, 2016 · 5 comments

Comments

@sidiropoulos
Copy link

Hi,

I had an error while running the pipeline during the bamfile pairing step. More specifically got the "Forward and reverse reads not paired. Check that BAM files are sorted." error from mergeSam.py file.

Tracking it down I realised that the 'samtools sort' output was never stored. In bowtie_combine.sh samtools sort is called by:

cmd="${SAMTOOLS_PATH}/samtools sort -@ ${N_CPU} -n ${BOWTIE2_FINAL_OUTPUT_DIR}/${prefix}.bwt2merged.bam ${BOWTIE2_FINAL_OUTPUT_DIR}/${prefix}.bwt2merged.sorted"

In samtools 1.3, "The obsolete samtools sort in.bam out.prefix usage has been removed. If you are still using ‑f, ‑o, or out.prefix, convert to use -T PREFIX and/or -o FILE instead."

Consider switching the sort call by specifying the output name with the -o flag.

Thank you for a great pipeline. :-)

Regards,
Nikos

@nservant
Copy link
Owner

Hi Nikos,
Thank you for reporting this. If I understand correctly, using the -o option should work will all versions ?
I will fix that as soon as possible.
N

@sidiropoulos
Copy link
Author

Hi Nicolas,

Yes that would work, but make sure you don't just specify the output suffix but use the full output file name. It will work with all samtools >1.0 versions which is already a prerequisite for HiC-Pro.

Bests,
Nikos

@nservant
Copy link
Owner

Hi Nikos,
I made a few tests. It seems that -o option cannot be used without -T option.
Can you confirm this ? Thanks. N

@sidiropoulos
Copy link
Author

Hi Nicolas,

Sorry for the delay.

You are right. In samtools-1.2 (also 1.0 and 1.1) the option -T or -O has to be supplied if -o is used.
In samtools-1.3 the -T or -O requirement is removed.

I would suggest to keep both -o and -T to cover all cases.

Bests,
Nikos

@nservant
Copy link
Owner

Fixed in current master (v2.7.3b). Thank you again Nikos !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants