HannahVMeyer / PhenotypeSimulator

Other
28 stars 7 forks source link

Delim genotype format #25

Closed BSchmidt1 closed 3 years ago

BSchmidt1 commented 4 years ago

From the manual: "delim: a [delimter]-delimited file of [NrSNPs x NrSamples] genotypes with the snpIDs in the first column and the sampleIDs in the first row".

This is a contradiction since it should be [(NrSNPs+1) x (NrSamples+1)]. This reflects in the function since it seems to read the first column as another SNP.

I realized this since I had one SNP named snpIDs with the first row: snpIDs,snp1,snp2.

When I removed snpIDs from the first row it seems to work, but there is a warning: In data.table::fread(filename, data.table = FALSE, sep = delimiter) : Detected 599 column names but the data has 600 columns (i.e. invalid file). Added 1 extra default column name for the first column which is guessed to be row names or an index. Use setnames() afterwards if this guess is not correct, or fix the file write command that created the file to create a valid file.

I think my workaround works, but I am sure it's going to save other people some time and confusion if you fix this.

Anyways, thanks for the great package :).

HannahVMeyer commented 3 years ago

Thank you for pointing this out Benjamin! Will have a look next week

HannahVMeyer commented 3 years ago

This is fixed now in 969280585b9f0d34529b762444e3f3ff3a6c8c44. Thanks for pointing it out. New version with this change on its way to CRAN.