ClineHelpR icon indicating copy to clipboard operation
ClineHelpR copied to clipboard

get_bgc_outliers error

Open madisonbullock opened this issue 3 years ago • 15 comments

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

madisonbullock avatar Jun 02 '22 20:06 madisonbullock

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 avatar Jun 08 '22 21:06 btmartin721

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

btmartin721 avatar Jun 08 '22 21:06 btmartin721

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!

madisonbullock avatar Jun 08 '22 22:06 madisonbullock

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.

btmartin721 avatar Jun 08 '22 22:06 btmartin721

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 avatar Jun 09 '22 22:06 madisonbullock

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!

madisonbullock avatar Jun 22 '22 21:06 madisonbullock

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 avatar Jun 23 '22 09:06 tkchafin

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

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)

tkchafin avatar Jun 23 '22 11:06 tkchafin

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 avatar Jun 23 '22 17:06 madisonbullock

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!

madisonbullock avatar Jun 23 '22 19:06 madisonbullock

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 avatar Jun 24 '22 09:06 tkchafin

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.

tkchafin avatar Jun 27 '22 12:06 tkchafin

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!

AllysonDekovich avatar Jan 24 '24 23:01 AllysonDekovich

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

btmartin721 avatar Jan 25 '24 19:01 btmartin721

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.

AllysonDekovich avatar Jan 28 '24 23:01 AllysonDekovich