GithubHelp home page GithubHelp logo

Comments (4)

j-andrews7 avatar j-andrews7 commented on June 12, 2024 1

I feel ya. I'll keep an eye on the repo, good luck in your final year!

from pymemesuite.

j-andrews7 avatar j-andrews7 commented on June 12, 2024 1

Still a month off, plenty of time to spare! I will take a look. I also forgot that Biopython itself has motif scanning, which I may also give a try.

from pymemesuite.

althonos avatar althonos commented on June 12, 2024

Hi @j-andrews7,

To be fair the MEME suite code has been the most challenging for me to get working in the different projects I've worked on, so that's why I only made an alpha release to date. I'll try to have a look when I can, but I can't guarantee when (I'm on my final PhD year 😅 )!

from pymemesuite.

althonos avatar althonos commented on June 12, 2024

Hi @j-andrews7,

In case the hackathon is not passed already (:yum:) I have improved the way background sequences are generated so that you can pass it to FIMO. This is not a complete implementation of fasta-get-markov, but since FIMO only expects zero-order Markov frequencies that's all I added.

Now FIMO methods expect a Background object instead of a raw frequencies array to pass for background frequencies when building the PSSM and/or computing p-values. A Background object can be created from various constructors:

from pymemesuite.common import Alphabet, Background, Sequence, Array
alphabet = Alphabet.dna()

# explicit constructor from an array of frequencies
bg = Background(dna, Array([0.27, 0.22, 0.22, 0.27]))  

# uniform background
bg_uniform = Background.from_uniform(dna)  

 # frequencies from the nr database
bg_nrdb = Background.from_nrdb(dna) 

# load from a background file, e.g. obtained with `fasta-get-markov`
bg_file = Background.from_file(dna, "background.txt") 

# compute from given sequences 
# (control reverse-complement and pseudocounts with the `rc` and `pseudo` keyword arguments)
bg_seq = Background.from_sequences(dna, Sequence("ATGC"), Sequence("ATTA"))

The last one is what you want, but you'll have to manage the loading from a FASTA file yourself (e.g. with Biopython). Afterwards you can use that background in Motif.build_pssm or in FIMO.score_motif.

from pymemesuite.

Related Issues (1)

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.