andersen-lab / Freyja

Depth-weighted De-Mixing
BSD 2-Clause "Simplified" License
100 stars 29 forks source link

Minimum Depth Question #194

Closed whottel closed 6 months ago

whottel commented 7 months ago

Hello,

Occasionally when running Freyja we see that for our non-template controls that not all Freyja files are generated and no row is generated in the aggregate file. These typically have very low coverage, but despite this a result can be generated on some runs. For example, attached are two depths files from two different controls on the same run. Both appear to have very sparse depths files and the samtools mean depth for the “controls-spike…” sample is 0.119 and for “NTC1…” is 0.012. Is there a rough cutoff where Freyja typically “fails” for a sample? This mostly matters for post-processing scripts in that occasionally there is a missing row for the controls. controls-spike-SC2WW-IA-VH01284-231205_S67_depths.txt NTC1-IA-VH01284-231205_S1_depths.txt

Thanks, Wes

joshuailevy commented 7 months ago

Hey Wes,

There isn't a set cutoff where Freyja fails to return a result, but I've been meaning to add something like this in. For files like the ones you attached that have a 10x coverage of <<.1%, freyja doesn't have much to work with... and I have refrained from setting an minimum coverage threshold since a lot of groups are using freyja for sequencing with only a small number of amplicons. Some of the plot functionality will not include low coverage samples by default though.

I'd be happy to couch the demix function in a try/except clause, so that something still gets returned, if that sounds good? Or might you have another suggestion?

Best, Josh

whottel commented 7 months ago

I think that sounds fine as long as something is there to indicate that lineages could not be calculated for a givn low quality samples for downstream aggregation.

joshuailevy commented 6 months ago

Should be sorted out by recent push (the returned error will be -1, will be described in README) and will be included in next release.