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

Ignore the secondary alignment #116

Open
lilinzhou opened this issue Jul 21, 2023 · 2 comments
Open

Ignore the secondary alignment #116

lilinzhou opened this issue Jul 21, 2023 · 2 comments

Comments

@lilinzhou
Copy link

Hi, Jiang
I modified the parameters of the minimap2 (add --secondary=no to prevent possible wrong alignments). But there was an error in nextpolish step which showed "python3: ctg_cns.c:2787: find_sup_alns: Assertion `i != sup_aln->i' failed.". The strange thing is that nextpolish doesn't stop running, but it doesn't produce new results either. How can I avoid this?

The version I used is NextPolish v1.4.1, Python 3.9.6.

Best
Charlie

@moold
Copy link
Member

moold commented Jul 21, 2023

Did you successfully complete NextPolish without setting --secondary=no?

@lilinzhou
Copy link
Author

lilinzhou commented Jul 25, 2023

I am sorry, I forgot to mention that I also modified the main script nextPolish to filter out some alignments with low mapping quality and supplementary alignments ( the FLAG for this kind of alignments is "2048") (detailed changed see below) apart from adding secondary=no in the config file.
I reran nextpolish without making any changes to the main script by adding secondary=no to the config file only, and it ran successfully. This indicates the error may happen during the alignment filtering step. I was wondering whether these changes will cause the above errors.

This is what I changed.

diff nextPolish nextPolish_filter_bam
203c203
before SCRIPT_PATH + '/bin/samtools view --threads 5 -F 0x4 -b - |'
after SCRIPT_PATH + '/bin/samtools view -q 30 --threads 5 -F 0x4 -b - |'
210,211c210,211
before genomefile + ' ' + LGS_READS + '|' + SCRIPT_PATH + '/bin/samtools view --threads 5 -F 0x4 -b - |' + SCRIPT_PATH +
'/bin/samtools sort - -m 2g --threads ' + THREADS + ' -o lgs.part%03d.sort.bam\n'

after genomefile + ' ' + LGS_READS + '|' + SCRIPT_PATH + '/bin/samtools view --threads 5 -q 30 -F 2052 -b - |' + SCRIPT_PATH +
'/bin/samtools sort - -m 2g --threads ' + THREADS + ' -o lgs.part%03d.sort.bam\n'

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