polio-nanopore / piranha

GNU General Public License v3.0
17 stars 4 forks source link

Allow multiple negatives/positives (including with same name) #138

Closed rambaut closed 1 year ago

rambaut commented 1 year ago

Sometimes multiple negative controls are given. Currently they can't have the same name i.e., be called negative and if they have different names only one is used. Should allow multiple negatives either with the same name or with different names. Same for positives.

aineniamh commented 1 year ago

also issue #88

rambaut commented 1 year ago

In general, multiple rows with the same sample IDs should be accepted (perhaps with a warning).

aineniamh commented 1 year ago

Re: In general, multiple rows with the same sample IDs should be accepted (perhaps with a warning).

I really don't think we should let multiple samples have the same name as that rings of someone putting in the wrong sample name as a typo (which i've definitely seen people do as copy & paste errors). If multiple barcodes have the sample sample, the user should append a number (we could in theory do that, but i think better for the user to have control over the sample name and not have us modify it internally).

An exception could be for negative/ positive controls, but i don't see why the user couldn't also just append a number themselves so that you can distinguish between negative controls 1, 2 and 3 (say).

My thoughts are that we should encourage unique sample names always because even if we handle it okay, other software might not.

Anyway, I've implemented the multiple negative and positive samples- by default still it'll look for one called 'negative' or 'positive' but if you specify multiples on the command line/ in a config file as a comma-separated string it'll allow multiples of both and will report them in the control table.

Following table comes from a run generated with the command

piranha -i demultiplexed/ -b barcodes.csv  --negative-control negative1,negative2

and the barcodes.csv

barcode,sample,date,well
barcode30,negative1,,C04
barcode01,negative2,,C05
barcode02,PureTest,2022-03-01,E05
barcode06,positive,,D07

Two of the controls fail (positive and negative2) and 1 passes (negative1)

Screenshot 2023-08-18 at 14 06 42