
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
.. image:: https://badge.fury.io/py/goldilocks.png :target: http://badge.fury.io/py/goldilocks
.. image:: https://travis-ci.org/SamStudio8/goldilocks.png?branch=master :target: https://travis-ci.org/SamStudio8/goldilocks
.. image:: https://coveralls.io/repos/SamStudio8/goldilocks/badge.png?branch=master :target: https://coveralls.io/r/SamStudio8/goldilocks
.. image:: https://badges.gitter.im/Join%20Chat.svg :alt: Join the chat at https://gitter.im/SamStudio8/goldilocks :target: https://gitter.im/SamStudio8/goldilocks?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
Locating genomic regions that are "just right".
Goldilocks is a Python package providing functionality for locating 'interesting' genomic regions for some definition of 'interesting'. You can import it to your scripts, pass it sequence data and search for subsequences that match some criteria across one or more samples.
Goldilocks was developed to support our work in the investigation of quality control for genetic sequencing. It was used to quickly locate regions on the human genome that expressed a desired level of variability, which were "just right" for later variant calling and comparison.
The package has since been made more flexible and can be used to find regions of interest based on other criteria such as GC-content, density of target k-mers, defined confidence metrics and missing nucleotides.
Given some genetic sequences (from one or more samples, comprising of one or more chromosomes), Goldilocks will shard each chromosome in to subsequences of a desired size which may or may not overlap as required. For each chromosome from each sample, each subsequence or 'region' is passed to the user's chosen strategy.
The strategy simply defines what is of interest to the user in a language that Goldilocks can understand. Goldilocks is currently packaged with the following strategies:
============================ ================== Strategy Census Description ============================ ================== GCRatioStrategy Calculate GC-ratio for subregions across the genome. NucleotideCounterStrategy Count given nucleotides for subregions across the genome. MotifCounterStrategy Search for one or more particular motifs of interest of any and varying size in subregions across the genome. ReferenceConsensusStrategy Calculate the (dis)similarity to a given reference across the genome. PositionCounterStrategy Given a list of base locations, calculate density of those locations over subregions across the genome. ============================ ==================
Once all regions have been 'censused', the results may be sorted by one of four
mathematical operations: max
, min
, median
and mean
. So you may be interested
in subregions of your sequence(s) that feature the most missing nucleotides, or
subregions that contain the mean or median number of SNPs or the lowest GC-ratio.
Goldilocks is hardly the first tool capable of calculating GC-content across a genome, or to find k-mers of interest, or SNP density, so why should you use it as part of your bioinformatics pipeline?
Whilst not the first program to be able to conduct these tasks, it is the first to be capable of doing them all together, sharing the same interfaces. Every strategy can quickly be swapped with another by changing one line of your code. Every strategy returns regions in the same format and so you need not waste time munging data to fit the rest of your pipeline.
Strategies are also customisable and extendable, those even vaguely familiar with Python should be able to construct a strategy to meet their requirements.
Goldilocks is maintained, documented and tested, rather than that hacky perl script that you inherited years ago from somebody who has now left your lab.
To use;
To test;
For coverage;
::
$ pip install goldilocks
Please cite us so we can continue to make useful software! ::
Nicholls, S. M., Clare, A., & Randall, J. C. (2016). Goldilocks: a tool for identifying genomic regions that are "just right." Bioinformatics (2016) 32 (13): 2047-2049. doi:10.1093/bioinformatics/btw116
::
@article{Nicholls01072016,
author = {Nicholls, Samuel M. and Clare, Amanda and Randall, Joshua C.},
title = {Goldilocks: a tool for identifying genomic regions that are ‘just right’},
volume = {32},
number = {13},
pages = {2047-2049},
year = {2016},
doi = {10.1093/bioinformatics/btw116},
URL = {http://bioinformatics.oxfordjournals.org/content/32/13/2047.abstract},
eprint = {http://bioinformatics.oxfordjournals.org/content/32/13/2047.full.pdf+html},
journal = {Bioinformatics}
}
Goldilocks is distributed under the MIT license, see LICENSE.
-l
and -s
CLI arguments and corresponding length
and stride
parameters
to Goldilocks
constructor now support SI suffixes: K
, M
, G
, T
.
util
module contains parse_si_bp
used to parse option strings and return
the number of bases for length and stride.ignore_query
option to plot
to override new default behaviour of plot
that only plots points for regions remaining after a call to query
.profile
function, use plot
with bins=N
instead.plot
to reduce code duplication.chrom
kwarg to plot
to allow plotting of a single chromosome across
multiple input genomes.ignore_query
kwarg to plot
for ignoring the results of a query on
the Goldilocks
object when performing a plot afterwards.bins=N
, this will create
N+1 bins (a special 0 bin is reserved) between 0 and the largest observed
value unless bin_max
is also provided.bin_max
. This will override the
default of the largest observed value regardless of whether bin_max
is smaller.prop=True
.plot
.fmt
kwarg to export_meta
that permits one of:
print_melt
, use export_meta
with fmt=melt
.is_pos_file
kwarg to Goldilocks, allows user to specify position based
variants in the format CHR\tPOS
or CHR:POS
in a newline delimited file.idx
key to file
in sequence dictionaries.Goldilocks
class is now imported as from goldilocks import Goldilocks
.textwrap.wrap
function is used to write out FASTA more cleanly.tracks
keyword.reset_candidates
allows users to "reset" the Goldilocks object after a
query or sort has been performed on the regions.MotifCounterStrategy
over removed KMerCounterStrategy
.NameError
preventing PositionCounterStrategy
from executing correctly.NameError
preventing ReferenceConsensusStrategy
from executing correctly.count
track to PositionCounterStrategy
to prevent accidental
multiple counting issue encountered when couting with the default
track.end_pos
falls outside of
the region on that particular genome's chromosome/contig.KMerCounterStrategy
to MotifCounterStrategy
use_and
to not work as expected for chromosomes not
explicitly listed in the exceptions
dict when also using use_chrom
.samtools faidx
style index.buffer
and memoryview
.query
from deep copying itself on return. Note this means that a query
will alter the original Goldilocks object.StrategyValue
as these cannot be stored in shared memory. This makes
ratio-based strategies a bit of a hack currently (but still work...)_filter
.examples.py
.is_seq
argument to initialisation removed and replaced with is_pos
.is_pos
to indicate the expected input is positional, not sequence.PositionCounterStrategy
when is_pos
is True.VariantCounterStrategy
now PositionCounterStrategy
.PositionCounterStrategy
expects 1-indexed lists of positions;
prepare
populates the listed locations with 1 and then evaluate
returns the sum as before.test_regression2
updated to account for converting 1-index to 0-index when
manually handling the sequence for expected results.query
accepts gmax
and gmin
arguments to filter candidate regions by
the group-track value.CandidateList
removed and replaced with simply returning a new Goldilocks
.Goldilocks.sorted_regions
stores a list of region ids to represent the result
of a sorting operation following a call to query
.Goldilocks.regions
now always have a copy of their "id" as a key.__check_exclusions
now accepts a group
and track
for more complex
exclusion-based operations.region_group_lte
and region_group_gte
added to usable exclusion fields to
remove regions where the value of the desired group/track combination is
less/greater than or equal to the value of the group/track set by the
current query
.query
now returns a new Goldilocks
instance, rather than a CandidateList
.Goldilocks.candidates
property now allows access to regions, this property
will maintain the order of sorted_regions
if it has one.export_meta
now allows group=None
CandidateList
class deleted.test_gen/
directory.CandidateList
lists are no longer returned
by query
._filter
is to be deprecated in favour of query
by 0.0.7print
FAQs
Locating genomic regions that are "just right".
We found that goldilocks demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.