pepkit / peppy

Project metadata manager for PEPs in Python
https://pep.databio.org/peppy
BSD 2-Clause "Simplified" License
37 stars 12 forks source link

Should appending sample modifiers override column values in sample.csv? #481

Open donaldcampbelljr opened 4 months ago

donaldcampbelljr commented 4 months ago

I noticed that appending a value via sample modifiers in the project config will not override a column value if it already exists in the sample.csv table, e.g.

name: looper_advanced_test
pep_version: 2.0.0
sample_table: annotation_sheet.csv
sample_modifiers:
  append:
    toggle: 0
sample_name,protocol,data_source,SRR,Sample_geo_accession,read1,read2,toggle
sample1,PROTO1,SRA,SRR5210416,GSM2471255,SRA_1,SRA_2,1
sample2,PROTO1,SRA,SRR5210450,GSM2471300,SRA_1,SRA_2,1
sample3,PROTO2,SRA,SRR5210398,GSM2471249,SRA_1,SRA_2,1

toggle will still be set to 1 for all the samples.

Should it override? Or should we at least warn the user that this sample modifier is being ignored?

nsheff commented 4 months ago

I think No, the value in the table should take precedence over an append modifier.

A warning would be fine with me, but to me this is the expected behavior.