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

Why the result of Froh_genome be the same as the result of Froh_Class_0 for each individual? #44

Open
ChaoXu1997 opened this issue Apr 4, 2024 · 3 comments
Labels

Comments

@ChaoXu1997
Copy link

image
In result_Froh_genome_wide and result_Froh_class, why should the result of Froh_genome be the same as the result of Froh_Class_0 for each individual?

@bunop
Copy link
Contributor

bunop commented Apr 4, 2024

dear @ChaoXu1997 can you provide some contextual information to your issue? can you reproduce the same behavior using test data?

@bunop bunop added the question label Apr 4, 2024
@ChaoXu1997
Copy link
Author

image
I encountered the same issue in the test data provided by the detectRUNS package.
R.version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 2.2
year 2022
month 10
day 31
svn rev 83211
language R
version.string R version 4.2.2 (2022-10-31 ucrt)
nickname Innocent and Trusting

@bunop
Copy link
Contributor

bunop commented Apr 4, 2024

for what I understand, it seems to be related to this line in Froh_inbreedingClass function:

  Froh_Class=unique(runs[c('group','id')])
  for (i in range_mb[1:5]){
    print(paste("Class used: >",i,sep=''))

    # subset ROHom/ROHet
    subset_roh <- runs[runs$MB >= i,]

    #if subset is empty (no runs for that class) skip/continue
    if(nrow(subset_roh)<1) next

    Froh_temp <- ddply(subset_roh,.(id),summarize,sum=sum(lengthBps))
    Froh_temp[[paste("Froh_Class_",i,sep="")]] =  Froh_temp$sum/sum(LengthGenome$CHR_LENGTH)
    colnames(Froh_temp)[2]<- paste("Sum_Class_",i,sep="")
    Froh_Class=merge(Froh_Class,Froh_temp,by="id",all=TRUE)
  }

when i = 0 the subset_roh <- runs[runs$MB >= i,] will select the entire table, so the class 0 column will be equal to the total genome. Honestly, I can't tell you if this is a bug or not, and the code changed a lot from the version which is now uploaded in CRAN repository. @filippob , can you check this behavior please?

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

2 participants