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

plotRuns produces an unreadble file.pdf #37

Open
matteomaster opened this issue Nov 29, 2022 · 2 comments
Open

plotRuns produces an unreadble file.pdf #37

matteomaster opened this issue Nov 29, 2022 · 2 comments

Comments

@matteomaster
Copy link

matteomaster commented Nov 29, 2022

Hi everyone,
I'm working on a project for my MSc Thesis in Population Genomics to produce RoH and RoHet with R package "detectRUNS".

I used "slidingRUNS.run()" function and it seems work, looking at the output;
then I used plotRuns() to save and see the graphics produces, but, like said in the title, plotRuns produces an unreadble file.pdf. Whenever I try to open it says "impossible to open file.pdf: it is possible that the file is damaged, or its format is unrecognized".

I am working on macOS Monterey 12.0.1, and Rstudio v. 4.2.2, and detectRUNS v. 0.9.6

the followed steps represent my code:

library(detectRUNS)

genotypeFilePath <- "dati/MMC1_notab.ped"
mapFilePath <- "dati/MMC1_fixed.map"

slidingRuns <- slidingRUNS.run(
genotypeFile = genotypeFilePath,
mapFile = mapFilePath,
windowSize = 15,
threshold = 0.01,
minSNP = 5,
ROHet = FALSE,
maxOppWindow = 1,
maxMissWindow = 1,
maxGap = 10^6,
minLengthBps = 250000,
minDensity = 1/1000, # SNP/kbps
maxOppRun = NULL,
maxMissRun = NULL
)

plot_Runs(runs = slidingRuns,
suppressInds = FALSE,
savePlots = TRUE,
outputName = "RoH")

the output of head(slidingRuns) looks like this:

group        id            chrom         nSNP     start           end              length

Wolf_11 | Wolf_11 | 994383.1 | 1112 | 6456102 | 6874518 | 412916
Wolf_11 | Wolf_11 | 994383.1 | 1162 | 12055005 | 124596395 | 404090
Wolf_11 | Wolf_11 | 994383.1 | 323 | 22510224 | 27845146 | 334522

Thank you for the answers!

@bunop
Copy link
Contributor

bunop commented Nov 30, 2022

Dear @matteomaster ,

thank you for your interest in detectRUNS. Regarding your question, I think that the problem are chromosome names, which are expected to be numerical as plink does without the option --extra-chrom, as you can see here.

Can you rename your chromosomes with integers from 0 to 99 and try to save a plot?

@bunop
Copy link
Contributor

bunop commented Nov 30, 2022

moreover, I'm not sure that this function can work as expected with the header like you put in your first comment, since it expect columns name like "group" "id" "chrom" "nSNP" "from" "to" "lengthBps", or at least from and to instead from start and stop, since these columns are required to make intervals

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

No branches or pull requests

2 participants