magnusdv / forrel

Forensic pedigree analysis and relatedness inference
GNU General Public License v2.0
10 stars 0 forks source link

Single marker frequency database files do not work #21

Closed knifecake closed 5 years ago

knifecake commented 5 years ago

This is a strange error. When loading a tabular file as the frequency database, if that file happens to contain only frequency information for one marker, exclusionPower calculation fails.

This is an example of an offending file:

"","M1"
"1",0.5
"2",0.5

More specifically, what files is obtaining the allele denominations of that marker, which is done by computing

alleles = rownames(frequencyDB()[!is.na(frequencyDB()[markerName]),])

Where markerName is "M1" and frequencyDB() is a well-formed dataframe.

A file with two markers does not cause this warning.

magnusdv commented 5 years ago

Looks like a dimension-dropping thing, i.e. something that could be fixed by adding , drop = FALSE after the comma in your code.

knifecake commented 5 years ago

This has been apparently fixed spontaneously. Closing the issue but keeping it in mind so that it does not reappear.

knifecake commented 5 years ago

It reappeared and indeed adding , drop = FALSE after the comma fixed it. Thanks @magnusdv!