Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 plot_Distribution report wrong labels with classes based mean graphs #41

Open
bunop opened this issue May 25, 2023 · 0 comments
Open
Assignees
Labels

Comments

@bunop
Copy link
Contributor

bunop commented May 25, 2023

Describe the bug
plot_Distribution report wrong label when plotting MeanClasses graph with no data in the first class. The same problem affects summaryRuns for summary_ROH_mean_class (which more or less does the same thing)

To Reproduce

# getting map and ped paths
genotypeFile <- system.file("extdata", "Kijas2016_Sheep_subset.ped", package = "detectRUNS")
mapFile <- system.file("extdata", "Kijas2016_Sheep_subset.map", package = "detectRUNS")

# loading pre-calculated data
runsFile <- system.file("extdata", "Kijas2016_Sheep_subset.sliding.csv", package="detectRUNS")
runsDF <- readExternalRuns(inputFile = runsFile, program = 'detectRUNS')

# simulate the bug with a low interval (there are no ROH smaller than 0.2Mb
plot_DistributionRuns(runs = runsDF, mapFile = mapFile, style = "MeanClass", Class = .2)

# same problem with summaryRuns
summary <- summaryRuns(runs = runsDF, mapFile = mapFile, genotypeFile = genotypeFile, Class = .2, snpInRuns = FALSE)
summary$summary_ROH_mean_class
#     CLASS    Jacobs Navajo-Churro
# 1   0-0.2 0.6989317      0.703102
# 2 0.2-0.4 1.1626177      1.133931
# 3 0.4-0.8 5.1566202      8.146518

Expected behavior
plot_DistributionRuns and summaryRuns must start from 0.4-0.8 when working with class

detectRUNS version
v0.9.6

platform

platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          3.0                         
year           2023                        
month          04                          
day            21                          
svn rev        84292                       
language       R                           
version.string R version 4.3.0 (2023-04-21)
nickname       Already Tomorrow 

Additional context
Code used to classify runs appears in multiple places. Try to define an internal helper function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant