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

get_bgc_outliers error #22

Open
madisonbullock opened this issue Jun 2, 2022 · 15 comments
Open

get_bgc_outliers error #22

madisonbullock opened this issue Jun 2, 2022 · 15 comments

Comments

@madisonbullock
Copy link

Hi there! Hope you are doing well. I'm fairly new to this and attempting to use the ClineHelpR functions on my bgc outputs, but keep running into the same error when I get to the get_bgc_ouliers step(see output below).

image

It fails my run each time at this step and never creates the gene.outliers object. I did make sure to include "loci.file=NULL" in my code and I'm only really interested in outputting the Phi Plots. So I'm not quite sure how to fix this issue. Any guidance would be fantastic. Thank you!

image

@btmartin721
Copy link
Owner

Hi Madison. Sorry for my delayed reply. It looks like something is wrong with the loci.file. Can you show me what the contents of the spoofed loci.file look like? Either by pasting it into a code block here, or sending me the file?

Also, are there supposed to be only 2 loci?

@btmartin721
Copy link
Owner

btmartin721 commented Jun 8, 2022

I should clarify that if you set loci.file=NULL then it should make a spoofed one. It should be called "loci_map.txt"

@madisonbullock
Copy link
Author

madisonbullock commented Jun 8, 2022

No worries, I appreciate your help. In my files, there are many more than 2 loci. But I'm only really wanting to output the Phi plots, so I thought the loci.file was optional. The spoofed loci.file the program creates the output below.

CHROM POS 0 0 -1 -1

(It doesn't really look like it in the code block here, but there are two columns in the file with three rows: the headers of CHROM and POS, the 0s, and the -1s.)

I have it running in a job script so that it continues on into the creation of the Phi plots, but it always fails at this step, and the loci.file error is the only one I get at that time. Thanks!

@btmartin721
Copy link
Owner

I think something might be wrong in a previous step. The spoofed loci.file gets made by looking at the df.list object, so something might be wrong with df.list. Can you show me what the contents of df.list looks like? Or if you want, you can send me your BGC output and I can try to see what is going wrong.

@madisonbullock
Copy link
Author

I output the contents of df.list (which I input as the object 'bgc.genes') into the text file below. I would send the bgc output, but those files are fairly large for the most part and stored on my HPCC. Thank you again for all your help!

bgc_genes.txt

@madisonbullock
Copy link
Author

Hi there, I hope you are doing well. I was just checking in to see if you've had a chance to look at the output I sent above as of yet. Thank you!

@tkchafin
Copy link
Collaborator

Hi Madison, Sorry for the slow responses -- Bradley and I both just started new positions, so have not had much time lately :)

I think I have identified the issue and have pushed a potential fix, just testing it now and will get back to you as soon as I have confirmed that it is working.

@tkchafin
Copy link
Collaborator

Ok, I was able to complete an analysis using the spoof loci file with ccd77e4

df.list<-combine_bgc_output("~/bgc_test/moch_bgc/",
                            prefix="moch", 
                            thin=50)


bgc.outliers <- get_bgc_outliers(df.list, 
                                 admix.pop="Sympatric", 
                                 popmap="~/bgc_test/moch.popmap",
                                 loci.file=NULL)

alphaBetaPlot(bgc.outliers, showPLOTS = TRUE, saveToFile = FALSE)

@madisonbullock
Copy link
Author

Congratulations on your new positions! No worries, thank you for responding. I really appreciate it. I'm going to try my run again, I'll let you know if it works. Thanks again!

@madisonbullock
Copy link
Author

madisonbullock commented Jun 23, 2022

Hi again! So I attempted to rerun the program, and am now getting a new error.

Error in 0:((nrow(df.list[[2]][, 1]) - 1)) : argument of length 0
Calls: get_bgc_outliers -> data.frame
Execution halted

Any ideas? Thanks!

@tkchafin
Copy link
Collaborator

Can you save your bgc.genes object with saveRDS() and send it to me? If you don't want to share the data publicly you can email it to [email protected] and I will look into it.

@tkchafin
Copy link
Collaborator

Hi, just saw your email. You can either reduce the file size by re-running combine_bgc_outputs with higher thinning/ burn-in (which might be good anyways so test plotting will run faster), or upload the big file to google drive and send me a link via email.

@AllysonDekovich
Copy link

Hi, I don't mean to open an old thread, but have you figured out the reason behind this error?

Error in 0:((nrow(df.list[[2]][, 1]) - 1)) : argument of length 0
Calls: get_bgc_outliers -> data.frame
Execution halted

Thanks!

@btmartin721
Copy link
Owner

Hi Allyson,

My collaborator @tkchafin was mostly working on this bug last time it seems. I don't know if he had fixed the bug or figured out what the cause was. Tyler, did you push an update or create a pull request for this?

Sorry for the issue. We will try to fix it ASAP. Per the comments above, we might need you to send us some files that we can debug it with.

-Bradley

@AllysonDekovich
Copy link

Thank you for the quick response! I will happily send over files for debugging - just let me know what files you need from me and where to send them.

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

4 participants