This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Data Import Issue detectRUNS R

I am running into an issue when importing data with detectRUNS in R.

The following commands to import PLINK files have not been successful, and result in blank data frames.

genotypeFilePath <- system.file("extdata", "genome.ped",package="detectRUNS")
mapFilePath <- system.file("extdata", "genome.map", package="detectRUNS")

head(genotypeFilePath)
[1] ""

The PLINK data are correctly formatted.

OR

I also attempted to import ROH data from bcftools, with the same result.

savedRunFile <- system.file("extdata", "ROH", package="detectRUNS")
runs <- readExternalRuns(inputFile = savedRunFile, program = "BCFtools")
head(runs)

The bcftools output seems to be correct as well:

# RG    [2]Sample       [3]Chromosome   [4]Start        [5]End  [6]Length (bp)  [7]Number of markers    [8]Quality (average fwd-bwd phred score)
# ST    [2]Sample       [3]Chromosome   [4]Position     [5]State (0:HW, 1:AZ)   [6]Quality (fwd-bwd phred score) 
ST      C_101 chr1    2527    1       3.0 
ST      C_101 chr1    2537    1       37.5

However I still end up with no data successfully imported

head(readExternalRuns) 
[1] ""

Any insight would be greatly appreciated. Thank you!

r detectruns roh

Where are your genome.ped/map files located? You need to provide path to your map and genotype types files like this-

genotypeFilePath <- "/pathToYourGenotype/genome.ped"
mapFilePath <- "/pathToYourGenotype/genome.map"

Thanks, they are actually within the working directory. But I also added the full path just in case, with the same result...

1 answer

You providing just path to your .ped and .map files and reading them. Therefore head(genotypeFilePath) will show you nothing.

Ah, I see! I was confused as I was following the workflow suggested in the vignette. Thank you.

I've moved bk11's comment to an answer. Please accept it to mark the post as solved.

Log in to answer this question.