natir / yacrd

Yet Another Chimeric Read Detector
MIT License
72 stars 8 forks source link

yacrd parameters optimization #39

Closed SergeiF1987 closed 4 years ago

SergeiF1987 commented 4 years ago

Hi,

first of all, thank you for this tool. It's very helpful! but I still don't get how it really works. I used yacrd on my nanopore genomic reads applying recommended parameters: minimap2 -x ava-ont -g 500 reads.fasta reads.fasta > overlap.paf yacrd -i overlap.paf -o report.yacrd -c 4 -n 0.4

in the output, I get a number of chimeric reads. One of these looks realistic with quite large bad regions in the alignment such as: 1) Chimeric 940ba8e3-795c-4739-8263-06f9f97f2a21 62054 2,0,2;2728,41848,44576;27,62027,62054 2)Chimeric 58077747-4acf-434b-8218-d34afda38a33 35725 39,0,39;3744,25149,28893;1,35724,35725

but some looks weird with just a little misalignment: 1) Chimeric 691a7c43-65da-4253-8d24-e483218e856a 71017 26,0,26;40,37103,37143;6,71011,71017 2)Chimeric aead8c29-bb59-4557-823c-2cb264d50148 41193 2,0,2;20,3635,3655;13,41180,41193

zero-coverage regions are less than 40 nt which is less than 1% of the overall read length. Why yacrd thinks that these reads are chimeric? Could you explain how -c and -n parameters really work? Thanks in advance! Sergei

natir commented 4 years ago

Hi @SergeiF1987,

Thank for your issue.

First, yacrd perform two similar but different task, detection (and management of chimera) and scrubbing. If I understand you correctly you want detect chimera, but the parameter you use is designed for scrubbing not for chimera detection.

Second: If I understand you correctly, you think the -n parameter control the length of not covered region yacrd needs to mark a read as Chimeric, it's not the case.

So if you only want detect chimera I recommend you to use this parameter:

minimap2 -x ava-ont reads.fasta reads.fasta > overlap.paf
yacrd -i overlap.paf -o report.yacrd -c 0 -n 0.8

If a read have a drop of coverage to 0 it's probably a chimera, if read isn't covered more than 80 percent of length this read can't be trust.

To improve the readme can you please indicate to me what made you think that the -n parameter controlled the size of not covered region?

Thanks in advance

SergeiF1987 commented 4 years ago

Hi @natir,

Thanks for such a quick reply! Actually, -n parameter looks clear, a ratio of zero-covered to a total read length. But -c... Sorry for that, but I still don't get how a region with 0 coverage could be chimeric? Does it mean that a read has no coverage at all? In this case, a sequence is presented only once and could stem from a weird source (sequencing errors, etc.) and considered as chimeric.

natir commented 4 years ago

In yacrd we assume, if part of read have no coverage this part didn't exist in other reads and probably denote this read is chimeric (or this region have very high error rate).

We use minimap2 to search overlap between reads and use this overlap to evaluate coverage. minimap2 didn't perform exact alignment between reads, it perform overlap search, two reads share an overlap if they seem the same not exactly the same, so small sequencing errors are ignored.

SergeiF1987 commented 4 years ago

I get it! Thanks a lot! Perhaps you could add a more detailed explanation of this in the manual for slow minds like mine. Thanks again and good luck!