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

Error in statistical_criteria #32

Open
chengwenxuan1997 opened this issue Jun 14, 2022 · 3 comments
Open

Error in statistical_criteria #32

chengwenxuan1997 opened this issue Jun 14, 2022 · 3 comments

Comments

@chengwenxuan1997
Copy link

Although I have used the code provided by Readme to merge adjacent regions with the same copy number value, it still reported an error in the function "statistical_criteria" that "error in evaluating the argument 'x' in selecting a method for function 'nrow': wrong sign in 'by' argument" .
When cand=7 and chr_inter=21, it reported this error.

This is the sample, Thanks
TRCC.zip

@isidroc
Copy link
Contributor

isidroc commented Jun 14, 2022

Hello, thanks for your comment. Can you please paste here the code you used?
Thanks

@chengwenxuan1997
Copy link
Author

chengwenxuan1997 commented Jun 15, 2022

The code is as follows:

SV_data <- readRDS("TRCC-1T-mix.SV.rds")  
CN_data <- readRDS("TRCC-1T-mix.CNV.rds")
chromothripsis <- shatterseek(SV.sample = SV_data, seg.sample = CN_data, genome = "hg38")

And the adjacent regions with the same copy number value in CN_data have been merged in advance. The code is as follows:

MergeSegment <- function(cnv){
  dd <- data.frame(chrom = as.character(cnv@chrom),
                   start = cnv@start,
                   end = cnv@end,
                   total_cn = cnv@total_cn)
  
  dd$total_cn[dd$total_cn == 0] <- 150000
  dd$total_cn[is.na(dd$total_cn)] <- 0
  dd <- as(dd,"GRanges")
  cov <- coverage(dd,weight = dd$total_cn)
  dd1 <- as(cov,"GRanges")
  dd1 <- as.data.frame(dd1)
  dd1 <- dd1[dd1$score !=0,]
  dd1 <- dd1[,c(1,2,3,6)]
  names(dd1) <- c("chrom", "start", "end", "total_cn")
  if (sum(dd1$total_cn == 150000) > 0){
    dd1$total_cn[dd1$total_cn == 150000] <- 0
  }

  CN_data <- CNVsegs(chrom = as.character(dd1$chrom),
                     start = as.numeric(dd1$start),
                     end = as.numeric(dd1$end),
                     total_cn = as.numeric(dd1$total_cn))
}
CN_data <- MergeSegment(CN_data)

@chengwenxuan1997
Copy link
Author

Could I get any suggestions to help solve this problem? Thanks.

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