Giter Site home page Giter Site logo

Error in optim(init, fn = loglik_per_TF, gr = deriv_per_TF, lower = 10^(-16), : L-BFGS-B needs finite values of 'fn' about bifet HOT 6 CLOSED

rdbcasillas avatar rdbcasillas commented on June 6, 2024
Error in optim(init, fn = loglik_per_TF, gr = deriv_per_TF, lower = 10^(-16), : L-BFGS-B needs finite values of 'fn'

from bifet.

Comments (6)

rdbcasillas avatar rdbcasillas commented on June 6, 2024 1

Removing rows with GC content equal to zero worked! Thanks Nathan.

I'm not sure what species your peak data originated from

I am playing with mouse data. The peak file was generated by MACS2. I will have to check with other datasets if this low GC content is an anomaly or not.

from bifet.

nlawlor avatar nlawlor commented on June 6, 2024

Hi rdbcasillas,

Thanks for your question and for using BiFET! It looks like the input footprinting calls file that you provided are for only one transcription factor motif "KLF6". Currently, BiFET must be supplied with >1 unique transcription factor motifs/PWMs as the function calculate_enrich_p first calculates a "TF binding matrix M where i_th row represents i_th PWM and j_th column represetns j_th peak".

I hope this helps :)
Nathan

from bifet.

rdbcasillas avatar rdbcasillas commented on June 6, 2024

Hi Nathan,

Thanks for responding. I added another TF STAT3 but I am getting the same error. Here is what I get this time:

result <- calculate_enrich_p(input1_GR, input2_GR)
[1] "PWM 1 out of 2 PWMs"
Error in optim(init, fn = loglik_per_TF, gr = deriv_per_TF, lower = 10^(-16),  : 
  L-BFGS-B needs finite values of 'fn'

I have updated the dropbox link with new data.

from bifet.

nlawlor avatar nlawlor commented on June 6, 2024

Hmm, that's strange. I'm able to run the calculate_enrich_p function using the package test data with 2 and even 1 TF, so please disregard my previous comments about that.

Looks like this could be an issue with the parameters in the optimization function within calculate_enrich_p similar to what is shown here: Stack Overflow

@youna2 Can you please have a look at the provided data?

from bifet.

nlawlor avatar nlawlor commented on June 6, 2024

Hi rdbcasillas,

I revisited your input peak file and noticed that your GC content values seemed strange.

# range of GC content values in peaks
range(in1$GC)
[1] 0.000000 0.213918
# how many peaks have a GC content of 0
length(which(in1$GC == 0))
[1] 55433

I'm not sure what species your peak data originated from, but it seems strange that your max GC content is ~21% (seems low; I think the average GC content in human genomes is usually between 40-60%) and that there are 50k peaks with a GC content of exactly zero. Perhaps there were some issues in calculating GC content in your input peak file?

Either way, this is an issue the developers and I will address so that users do not encounter the same error.

For now, a quick fix can be to remove the peaks in your dataset with a GC content equal to zero:

# load input files
in1 <- readRDS("Downloads/BiFet files/input1.rds")
in2 <- readRDS("Downloads/BiFet files/input2.rds")
# identify and remove peaks in peak dataset with GC content equal to zero
id_high <- which(in1$GC > 0)
in1_sel <- in1[id_high]
res <- calculate_enrich_p(in1_sel, in2)

Please give this a try and let me know if you still get the same error!

from bifet.

nevelsk90 avatar nevelsk90 commented on June 6, 2024

Hi,

Thanks for making the tool,

Unfortunately I get the same error even when GC content is not equal zero.
Please download R object with input files using the link : https://drive.google.com/open?id=19HZIcR5CGBwDod-Ht0jSnHBsYynGPhJB

I should say that the file containing instances of motifs (GRmotif) is NOT a result of footprint calling but of motif scanning with FIMO. But if I understand correctly BiFET should be able to peocess these results as well.

Thank you in advance and regards
TIm

from bifet.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.