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

Odd Spectra.asm plot generated #102

Closed
ap1438 opened this issue Mar 21, 2023 · 5 comments
Closed

Odd Spectra.asm plot generated #102

ap1438 opened this issue Mar 21, 2023 · 5 comments

Comments

@ap1438
Copy link

ap1438 commented Mar 21, 2023

Hi,

I ran merquery for assembly evaluation in trio mode and got this weird plot. I cannot understand what's wrong in the assembly.

image

I ran the same command for other 2 assemblies and the plots were perfect as shown in the example.

@arangrhie
Copy link
Contributor

Hi,
Try re-generating the plots with -m -n options. More in: #27.

@ap1438
Copy link
Author

ap1438 commented Mar 21, 2023

Thankyou for quick reply.

I generated the new plot. But it looks odd.
image

You can see there are peaks of both the assemblies from 0 -50 in the x axis with high frequency low coverage peaks (As far as my understanding these are sequencing errors). which is again not usual what I have seen in other two assemblies.
Can you please explain what this means. Does it mean contamination or sequencing error, or any other problem is there with the assemblies.

@arangrhie
Copy link
Contributor

It looks like some junk sequence that got into your assembly.
You could try fish out where the low-frequency kmers are present along your two assemblies.
For example,

meryl less-than 25 read-db.meryl output lowcov.meryl
meryl intersect lowcov.meryl asm1.meryl output asm1_lowcov.meryl
# in bed format
meryl-lookup -bed -sequence asm1.fasta -mers asm1_lowcov.meryl | bedtools merge -i - > asm1_lowcov.bed
# in wig format
meryl-lookup -wig-count asm1_lowcov.wig

And apply the same on asm2.
The .wig file will have values of the multiplicity seen in the low_cov.meryl.
See where most of the low-coverage kmers are present. Fish out some contigs with multiple hits, and try a BLAST search or so. It will show up if it was a contaminant.

@ap1438
Copy link
Author

ap1438 commented Mar 22, 2023

Thank you for your suggestion.
I was trying to change the y axis for this plot but it seems that i am not able to change the y axis with -n parameter.

check_hifi_33_asm fl

plot_spectra_cn.R -m 250 -n 500000 -f hifi_S33.spectra-asm.hist -o check_hifi_33_asm -z hifi_S33.dist_only.hist
Loading required package: argparse
Loading required package: ggplot2
Loading required package: scales
[1] "x_max: 250"
[1] "y_max: 92475499.6"
[1] "## Line graph"
[1] "## Area under the curve filled"
[1] "## Stacked"
Warning messages:
1: The size argument of element_rect() is deprecated as of ggplot2 3.4.0.
ℹ Please use the linewidth argument instead.
2: Using size aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use linewidth instead.

I get this . Am i doing someting wrong with the command.

@arangrhie
Copy link
Contributor

That is because Merqury tries to show the error (dist_only.hist) results by default.
If you aren't interested in it, try generate one without the -z hifi_S33.dist_only.hist.

Rscript  $MERQURY/plot/plot_spectra_cn.R -m 250 -n 500000 -f hifi_S33.spectra-asm.hist -o check_hifi_33_asm

Best,
Arang

@ap1438 ap1438 closed this as completed Mar 28, 2023
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