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

GetWTandMutCount #14

Open
rabiafidan opened this issue Aug 4, 2023 · 5 comments
Open

GetWTandMutCount #14

rabiafidan opened this issue Aug 4, 2023 · 5 comments

Comments

@rabiafidan
Copy link

Hi,

I am trying to run Battenberg but I get an error from this function runGetDirichletProcessInfo. Could you help me understand and solve the problem?

>runGetDirichletProcessInfo(loci_file="foo.txt", allele_frequencies_file="bar.txt", cellularity_file="c.txt",subclone_file="s.txt",output_file="o.txt",gender="male", SNP.phase.file=NA,mut.phase.file=NA)
Error in if (is.na(subs.data)) { : the condition has length > 1

I could trace it back to GetWTandMutCount here is the part of the code in this repo:

GetWTandMutCount <- function(loci_file, allele_frequencies_file) {
  subs.data = tryCatch(read.table(loci_file, sep='\t', header=F, stringsAsFactors=F), error=function(e) NA)
  if (is.na(subs.data)) {
    # Empty input
    return(NULL)
  }
  subs.data = subs.data[order(subs.data[,1], subs.data[,2]),]
  #...
  #...

When I try it:

>subs.data = tryCatch(read.table("foo_loci.txt", sep='\t', header=F, stringsAsFactors=F), error=function(e) NA)
#it is not empty
> head(subs.data)
  V1      V2 V3 V4
1  1  653452  T  C
2  1  653927  A  G
3  1  962261  C  T
4  1  996120  C  T
5  1 1131436  A  G
6  1 1131439  A  G


> if (is.na(subs.data)) {
    # Empty input
    return(NULL)
  }
Error in if (is.na(subs.data)) { : the condition has length > 1

> head(is.na(subs.data))
        V1    V2    V3    V4
[1,] FALSE FALSE FALSE FALSE
[2,] FALSE FALSE FALSE FALSE
[3,] FALSE FALSE FALSE FALSE
[4,] FALSE FALSE FALSE FALSE
[5,] FALSE FALSE FALSE FALSE
[6,] FALSE FALSE FALSE FALSE

Thank you!

R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
@rabiafidan
Copy link
Author

I have just noticed #10 is also the same issue.

@rabiafidan
Copy link
Author

I found empty_input_bugfix branch while browsing and it worked for me:

remove.packages("dpclust3p")
devtools::install_github("Wedge-Oxford/dpclust3p",ref="empty_input_bugfix")

@christopherwirth
Copy link

Hi Rabia,

Thanks for the comments and error messages. Apologies we weren't able to respond sooner; I was on annual leave.

Is the bugfix branch still working for you generally?

If so, I will coordinate with the team and see if we can merge it into the master branch before I close this issue.

@rabiafidan
Copy link
Author

Hi Chris,

Thank you for your reply. I haven't had the chance to test it further but it had worked on 1 sample. I would like to run it on a cohort soon. I can update here then but all seems fine.

@rabiafidan
Copy link
Author

Hi again,
The cohort run is also successful.

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