samstudio8 / goldilocks Goto Github PK
View Code? Open in Web Editor NEWLocating genetic regions that are "just right"
License: MIT License
Locating genetic regions that are "just right"
License: MIT License
Redundancy in the genetic code means that it is possible to represent 64 different amino acids even though there are only 21 used. This has resulted in many codons being used for each amino acid. Some species prefer to use one codon over another which results in a species specific codon usage profile.
Can Goldilocks be used to analyse the frequency that a particular codon is used in a genome?
nope.fa
>NO
>OP
nope.fa.idx
NO 0 4 -1 -1
OP 0 8 -1 -1
nope.py
from goldilocks.goldilocks import Goldilocks
from goldilocks.strategies import NucleotideCounterStrategy
data = {
"seq": {
"idx": "nope.fa.idx"
}
}
g = Goldilocks(NucleotideCounterStrategy(["A"]), data, length=3, stride=1, is_faidx=True)
g.query("mean", track="A", limit=5).export_meta(sep="\t")
File "/home/sam/Projects/Packages/goldilocks/goldilocks/goldilocks.py", line 525, in __apply_filter_func
mean_percentile = (len(track_scores[track_scores <= 0]) / float(len(track_scores))) * 100
ZeroDivisionError: float division by zero
A comment raised on a reddit post about Goldilocks points out that some of the operations performed by the tool might well serve as standalone tools to be used in UNIX fashion.
At the very least, supporting streamed input could be a nice idea.
I'd like to be able to supply individual files rather than one large FASTA file. For example:
sequence_data = { "mysample": {
"chr1": {"file": "./chr1.fna.fai"},
"chr2": {"file": "./chr2.fna.fai"},
"chr3": {"file": "./chr3.fna.fai"},
"chr4": {"file": "./chr4.fna.fai"},
"chr5": {"file": "./chr5.fna.fai"},
}}
g = Goldilocks(GCRatioStrategy(), sequence_data, length="500K", stride="100K", is_faidx=True)
g.plot(group="mysample", title="GC Content")
Goldilocks should output results in a more useful format than tabular, BED
seems a good bet.
The PositionCounterStrategy uses the default
track counter, which is then used later for calculating summary statistics. This has the side effect of reporting G times more variants than there actually are.
It could be worth investigating providing a mechanism for post-census functions to be called on the count matrix once a census has been completed. This could allow for a GCRatioStrategy to just be a wrapper of the NucleotideCounterStrategy that has a post-census callback to calculate and return the necessary ratios.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.