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

multithreaded or single thread? #7

Closed
sid5427 opened this issue Jul 4, 2020 · 6 comments
Closed

multithreaded or single thread? #7

sid5427 opened this issue Jul 4, 2020 · 6 comments
Labels
question Further information is requested

Comments

@sid5427
Copy link

sid5427 commented Jul 4, 2020

Hi,

I have a quick question - does RagTag support multiple threads to speed up the processing? or is it single-threaded?
If it does have support for multi-threaded ops - what is the flag to enable it? same as Ragoo?

Thanks!

@malonge
Copy link
Owner

malonge commented Jul 4, 2020

Hi there,

If you are using minimap2 as your aligner, -t allows users to specify the number of minimap2 threads. All other components of ragtag are single-threaded, but the minimap2 steps are the most expensive by far.

If one is using nucmer, that cannot be multithreaded.

Please reopen if you have any additional questions.

Thanks,
Mike

@malonge malonge closed this as completed Jul 4, 2020
@sid5427
Copy link
Author

sid5427 commented Jul 6, 2020

Hi Micheal,

I have a couple of follow up questions.

I tried to use multiple threads in my ragtag run - this is the command I used -
(python ragtag.py -t 16 scaffold Zea_mays.B73_RefGen_v4.dna.toplevel.fa ragtag_output/FR697_long-scaffs.corrected.fasta) >& scaffold_log.txt &
Unfortunately, it gave me an error - so I used the command without the -t flag. Is there a particular way to use this this flag?

I am trying to scaffold a maize assembly, but am constrained by low coverage. My assembly has a large number of small contigs, lot of them less than 1000bp and as noted in the reply to this question -malonge/RaGOO#53
Ragoo does not have a direct option to modify the minimum alignment size, but RagTag would have this feature. I wonder if the current version of RagTag has this feature available yet? And to do that, would I have to install nucmer as I am running RagTag with minimap2?

I have sections like this - 500bp contigs spaced out, but these are not considered during scaffolding in Ragoo. Example from the short read assembly aligned to B73 maize reference genome.

image


@malonge malonge reopened this Jul 6, 2020
@malonge
Copy link
Owner

malonge commented Jul 6, 2020

Hi there,

With regards to the -t option, I have two observations. First, don't run RagTag with python ragtag.py. Rather, install RagTag and just run with ragtag.py.

Second, the -t should go after the scaffold subcommand. So all RagTag commands must be ragtag.py {subcommand} {options}. (like samtools, for example)

ragtag.py scaffold -t 16 ...

With regards to the mapping of shorter contigs, this is substantially improved in RagTag relative to RaGOO. First of all, by default, all unique alignments are kept regardless of their length. Secondly, you can adjust the -f parameter to require shorter non-unique alignments. This should work well for minimap2 or nucmer, though you are free to try both.

Just to speculate, there may be a relatively small number of short unique alignments since it looks like you are scaffolding a maize genome, which is highly repetitive. Let me know if you have trouble and I can help you adjust parameters. In my experience, minimap2 works fine for most assemblies, though you may consider trying nucmer here just incase (though it will be quite slow).

Thanks

@malonge malonge added the question Further information is requested label Jul 6, 2020
@soungalo
Copy link

soungalo commented Aug 2, 2020

I am facing a similar task - scaffolding a plant assembly with low contiguity (~5k N50). I was wondering if there were any conclusions about how this should be done. Any tips other than decreasing -f? Maybe other RagTag / minimap2 parameters I should play with?

@malonge
Copy link
Owner

malonge commented Aug 2, 2020

Hi @soungalo,

If I really need to tune the alignments, I personally use Nucmer since I find it easier to interpret the results. Using the --nucmer-params flag, you can lower the seed (-l) and cluster (-c) size for more sensitivity. I set these to 100 and 500, respectively, by default in RagTag, but Nucmer's defaults are actually 20 and 65. You can also add the --maxmatch flag to turn off any unique alignment filtering within nucmer. Then, unique alignment filtering will be strictly controled by the -f RagTag parameter.

@malonge
Copy link
Owner

malonge commented Aug 15, 2020

I am going to close this for now but please reopen if anything comes up.

@malonge malonge closed this as completed Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants