import math
import os
import shutil
from pathlib import Path
from tempfile import mkdtemp
from typing import Any, List, Optional, Tuple, Union
import numpy as np
from numpy import asarray, stack
from ._bgen_file import bgen_file
from ._bgen_metafile import bgen_metafile
from ._ffi import ffi, lib
from ._file import (
assert_file_exist,
assert_file_readable,
)
from ._helper import _log_in_place
from ._helper import genotypes_to_allele_counts, get_genotypes
from ._reader import _get_samples
# https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard
[docs]class open_bgen(object):
"""
A NumPy-inspired class for fast opening and reading of BGEN files.
Parameters
----------
filepath
BGEN file path.
samples_filepath
Path to a `sample format`_ file or ``None`` to read samples from the BGEN file itself.
Defaults to ``None``.
verbose
``True`` (default) to show progress; ``False`` otherwise.
Returns
-------
an open_bgen object : :class:`open_bgen`
.. _open_examples:
Examples
--------
With the `with <https://docs.python.org/3/reference/compound_stmts.html#grammar-token-with-stmt>`__ statement, list :attr:`samples` and variant :attr:`ids`, then :meth:`read` the whole file.
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.ids)
... print(bgen.samples)
... print(bgen.read())
['SNP1' 'SNP2' 'SNP3' 'SNP4']
['sample_0' 'sample_1' 'sample_2' 'sample_3']
[[[1. 0. 1. 0.]
[0. 1. 1. 0.]
[1. 0. 0. 1.]
[0. 1. 0. 1.]]
<BLANKLINE>
[[0. 1. 1. 0.]
[1. 0. 0. 1.]
[0. 1. 0. 1.]
[1. 0. 1. 0.]]
<BLANKLINE>
[[1. 0. 0. 1.]
[0. 1. 0. 1.]
[1. 0. 1. 0.]
[0. 1. 1. 0.]]
<BLANKLINE>
[[0. 1. 0. 1.]
[1. 0. 1. 0.]
[0. 1. 1. 0.]
[1. 0. 0. 1.]]]
Open the file (without `with`) and read probabilities for one variant.
.. doctest::
>>> bgen = open_bgen(file, verbose=False)
>>> print(bgen.read(2))
[[[1. 0. 0. 1.]]
<BLANKLINE>
[[0. 1. 0. 1.]]
<BLANKLINE>
[[1. 0. 1. 0.]]
<BLANKLINE>
[[0. 1. 1. 0.]]]
>>> del bgen # close and delete object
Open the file and then first read for a :class:`slice` of samples and variants, and then for a single sample and variant.
.. doctest::
>>> bgen = open_bgen(file, verbose=False)
>>> print(bgen.read((slice(1,3),slice(2,4))))
[[[0. 1. 0. 1.]
[1. 0. 1. 0.]]
<BLANKLINE>
[[1. 0. 1. 0.]
[0. 1. 1. 0.]]]
>>> print(bgen.read((0,1)))
[[[0. 1. 1. 0.]]]
>>> del bgen # close and delete object
.. _sample format: https://www.well.ox.ac.uk/~gav/qctool/documentation/sample_file_formats.html
"""
def __init__(
self,
filepath: Union[str, Path],
samples_filepath: Optional[Union[str, Path]] = None,
verbose: bool = True,
):
filepath = Path(filepath)
assert_file_exist(filepath)
assert_file_readable(filepath)
self._verbose = verbose
self._filepath = filepath
self._bgen_context_manager = bgen_file(filepath)
self._bgen = self._bgen_context_manager.__enter__()
self._samples = np.array(
_get_samples(self._bgen, samples_filepath, self._verbose), dtype="str"
)
self._sample_range = np.arange(len(self._samples), dtype=np.int)
metadata2 = self._metadatapath_from_filename(
filepath
) # LATER could make a version of this method public
if metadata2.exists() and os.path.getmtime(metadata2) < os.path.getmtime(
filepath
):
metadata2.unlink()
if metadata2.exists():
d = np.load(str(metadata2))
self._ids = d["ids"]
self._rsids = d["rsids"]
self._vaddr = d["vaddr"]
self._chromosomes = d["chromosomes"]
self._positions = d["positions"]
self._nalleles = d["nalleles"]
self._allele_ids = d["allele_ids"]
self._ncombinations = d["ncombinations"]
self._phased = d["phased"]
else:
tempdir = None
try:
tempdir = Path(mkdtemp(prefix="pysnptools"))
metafile_filepath = tempdir / "bgen.metadata"
self._bgen.create_metafile(metafile_filepath, verbose=self._verbose)
self._map_metadata(metafile_filepath)
np.savez(
metadata2,
ids=self._ids,
rsids=self._rsids,
vaddr=self._vaddr,
chromosomes=self._chromosomes,
positions=self._positions,
nalleles=self._nalleles,
allele_ids=self._allele_ids,
ncombinations=self._ncombinations,
phased=self._phased,
)
finally:
if tempdir is not None:
shutil.rmtree(tempdir)
self._max_combinations = max(self._ncombinations)
[docs] def read(
self,
index: Optional[Any] = None,
dtype: Optional[Union[type, str]] = np.float64,
order: Optional[str] = "F",
max_combinations: Optional[int] = None,
return_probabilities: Optional[bool] = True,
return_missings: Optional[bool] = False,
return_ploidies: Optional[bool] = False,
) -> Union[
None,
np.ndarray,
Tuple[np.ndarray, np.ndarray],
Tuple[np.ndarray, np.ndarray, np.ndarray],
]:
"""
Read genotype information from an :class:`open_bgen` object.
Parameters
----------
index
An expression specifying the samples and variants to read. (See :ref:`read_examples`, below).
Defaults to ``None``, meaning read all.
dtype : data-type
The desired data-type for the returned probability array.
Defaults to :class:`numpy.float64`. Use :class:`numpy.float32` or :class:`numpy.float16`, when appropriate,
to save 50% or 75% of memory. (See :ref:`read_notes`, below).
order : {'F','C'}
The desired memory layout for the returned probability array.
Defaults to ``F`` (Fortran order, which is variant-major)
max_combinations : int or ``None``.
The number of values to allocate for each probability distribution.
Defaults to a number just large enough for any data in the file.
For unphased, diploid, biallelic data, it will default to 3. For phased, diploid, biallelic data, it will
default to 4. Any overallocated space is filled with :const:`numpy.nan`.
return_probabilities: bool
Read and return the probabilities for samples and variants specified.
Defaults to ``True``.
return_missings: bool
Return a boolean array telling which probabilities are missing.
Defaults to ``False``.
return_ploidies: bool
Read and return the ploidy for the samples and variants specified.
Defaults to ``False``.
Returns
-------
zero to three :class:`numpy.ndarray`
always in this order:
* a :class:`numpy.ndarray` of probabilities with ``dtype`` and shape `(nsamples_out,nvariants_out,max_combinations)`,
if ``return_probabilities`` is ``True`` (the default). Missing data is filled with :const:`numpy.nan`.
* a :class:`numpy.ndarray` of ``bool`` of shape `(nsamples_out,nvariants_out)`, if ``return_missings`` is ``True``
* a :class:`numpy.ndarray` of ``int`` of shape `(nsamples_out,nvariants_out)`, if ``return_ploidies`` is ``True``
.. _read_notes:
Notes
------
* About ``dtype``
If you know the compression level of your BGEN file, you can sometimes save 50% or 75% on memory with ``dtype``.
T(est with your data to confirm you are not losing any precision.) The approximate relationship is:
* BGEN compression 1 to 10 bits: ``dtype`` ='float16'
* BGEN compression 11 to 23 bits: ``dtype`` ='float32'
* BGEN compression 24 to 32 bits: ``dtype`` ='float64' (default)
.. _read_examples:
Examples
--------
* Index Examples
To read all data in a BGEN file, set ``index`` to ``None``. This is the default.
.. doctest::
>>> import numpy as np
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> with open_bgen(example_filepath("haplotypes.bgen"), verbose=False) as bgen_h:
... print(bgen_h.read()) #real all
[[[1. 0. 1. 0.]
[0. 1. 1. 0.]
[1. 0. 0. 1.]
[0. 1. 0. 1.]]
<BLANKLINE>
[[0. 1. 1. 0.]
[1. 0. 0. 1.]
[0. 1. 0. 1.]
[1. 0. 1. 0.]]
<BLANKLINE>
[[1. 0. 0. 1.]
[0. 1. 0. 1.]
[1. 0. 1. 0.]
[0. 1. 1. 0.]]
<BLANKLINE>
[[0. 1. 0. 1.]
[1. 0. 1. 0.]
[0. 1. 1. 0.]
[1. 0. 0. 1.]]]
To read selected variants, set ``index`` to an ``int``, a list of ``int``, a :class:`slice`, or a list of ``bool``.
Negative integers count from the end of the data.
.. doctest::
>>> bgen_e = open_bgen(example_filepath("example.bgen"), verbose=False)
>>> probs = bgen_e.read(5) # read the variant indexed by 5.
>>> print(probs.shape) # print the dimensions of the returned numpy array.
(500, 1, 3)
>>> probs = bgen_e.read([5,6,1]) # read the variant indexed by 5, 6, and 1
>>> print(probs.shape)
(500, 3, 3)
>>> probs = bgen_e.read(slice(5)) #read the first 5 variants
>>> print(probs.shape)
(500, 5, 3)
>>> probs = bgen_e.read(slice(2,5)) #read variants from 2 (inclusive) to 5 (exclusive)
>>> print(probs.shape)
(500, 3, 3)
>>> probs = bgen_e.read(slice(2,None)) # read variants starting at index 2.
>>> print(probs.shape)
(500, 197, 3)
>>> probs = bgen_e.read(slice(None,None,10)) #read every 10th variant
>>> print(probs.shape)
(500, 20, 3)
>>> print(np.unique(bgen_e.chromosomes)) # print unique chrom values
['01']
>>> probs = bgen_e.read(bgen_e.chromosomes=='01') # read all variants in chrom 1
>>> print(probs.shape)
(500, 199, 3)
>>> probs = bgen_e.read(-1) # read the last variant
>>> print(probs.shape)
(500, 1, 3)
To read selected samples, set ``index`` to a tuple of the form ``(sample_index,None)``, where ``sample index`` follows the form
of ``variant index``, above.
.. doctest::
>>> probs = bgen_e.read((0,None)) # Read 1st sample (across all variants)
>>> print(probs.shape)
(1, 199, 3)
>>> probs = bgen_e.read((slice(None,None,10),None)) # Read every 10th sample
>>> print(probs.shape)
(50, 199, 3)
To read selected samples and selected variants, set ``index`` to a tuple of the form ``(sample_index,variant_index)``,
where ``sample index`` and ``variant_index`` follow the forms above.
.. doctest::
>>> # Read samples 10 (inclusive) to 20 (exclusive) and the first 15 variants.
>>> probs = bgen_e.read((slice(10,20),slice(15)))
>>> print(probs.shape)
(10, 15, 3)
>>> #read last and 2nd-to-last sample and the last variant
>>> probs = bgen_e.read(([-1,-2],-1))
>>> print(probs.shape)
(2, 1, 3)
* Multiple Return Example
Read probabilities, missingness, and ploidy. Print all unique ploidies values.
.. doctest::
>>> probs,missing,ploidy = bgen_e.read(return_missings=True,return_ploidies=True)
>>> print(np.unique(ploidy))
[2]
"""
# LATER could allow strings (variant names) and lists of strings
if not hasattr(self, "_bgen_context_manager"):
raise ValueError("I/O operation on a closed file")
max_combinations = (
max_combinations if max_combinations is not None else self.max_combinations
) # Can't use 'or' because it treats 0 as False
samples_index, variants_index = self._split_index(index)
samples_index = self._sample_range[
samples_index
] # converts slice(), etc to a list of numbers
vaddr = self._vaddr[variants_index]
ncombinations = self._ncombinations[variants_index]
if len(ncombinations) > 0 and max(ncombinations) > max_combinations:
raise ValueError(
"Need at least {0} max_combinations, but only {1} given".format(
max(ncombinations), max_combinations
)
)
# allocating prob_buffer only when its size changes makes reading
# 10x5M data 30% faster
if return_probabilities:
val = np.full(
(len(samples_index), len(vaddr), max_combinations),
np.nan,
dtype=dtype,
order=order,
)
prob_buffer = None
if return_missings:
missing_val = np.full(
(len(samples_index), len(vaddr)), False, dtype="bool", order=order
)
if return_ploidies:
ploidy_val = np.full(
(len(samples_index), len(vaddr)), 0, dtype="int", order=order
)
# LATER multithread?
approx_read_seconds = len(vaddr) / 20000.0 + len(vaddr) * self.nsamples / (
2 * 1000 * 1000.0
)
vaddr_per_second = max(1, len(vaddr) // int(max(1, approx_read_seconds)))
vaddr_per_second = 10 ** (
int(math.log10(vaddr_per_second) + 0.5)
) # Do "logarithmic rounding" to make numbers look nicer, e.g. 999 -> 1000
with _log_in_place("reading", self._verbose) as updater:
for out_index, vaddr0 in enumerate(vaddr):
if out_index % vaddr_per_second == 0:
updater("part {0:,} of {1:,}".format(out_index, len(vaddr)))
genotype = lib.bgen_file_open_genotype(self._bgen._bgen_file, vaddr0)
if return_probabilities:
if (
prob_buffer is None
or ncombinations[out_index] != prob_buffer.shape[-1]
):
prob_buffer = np.full(
(len(self._samples), ncombinations[out_index]),
np.nan,
order="C",
dtype="float64",
)
lib.bgen_genotype_read(
genotype, ffi.cast("double *", prob_buffer.ctypes.data)
)
val[:, out_index, : ncombinations[out_index]] = (
prob_buffer
if (samples_index is self._sample_range)
else prob_buffer[samples_index, :]
)
if return_missings:
missing_val[:, out_index] = [
lib.bgen_genotype_missing(genotype, i) for i in samples_index
]
if return_ploidies:
ploidy_val[:, out_index] = [
lib.bgen_genotype_ploidy(genotype, i) for i in samples_index
]
lib.bgen_genotype_close(genotype)
result_array = (
([val] if return_probabilities else [])
+ ([missing_val] if return_missings else [])
+ ([ploidy_val] if return_ploidies else [])
)
if len(result_array) == 1:
return result_array[0]
else:
return tuple(result_array)
@property
def nsamples(self) -> int:
"""
The number of samples in the data (``int``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.nsamples)
4
"""
return len(self._samples)
@property
def nvariants(self) -> int:
"""
The number of variants in the data (``int``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.nvariants)
4
"""
return len(self.ids)
@property
def max_combinations(self) -> int:
"""
The maximum number of values in any variant's probability distribution (``int``).
For unphased, diploidy, biallelic data, it will be 3. For phased, diploidy, biallelic data it will be 4. In general,
it is the maximum value in :attr:`~bgen_reader.open_bgen.ncombinations`.
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.max_combinations)
4
"""
return self._max_combinations
@property
def shape(self) -> (int, int, int):
"""
The tuple (:attr:`~bgen_reader.open_bgen.nsamples`, :attr:`~bgen_reader.open_bgen.nvariants`,
:attr:`~bgen_reader.open_bgen.max_combinations`)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.shape)
(4, 4, 4)
"""
return (self.nsamples, self.nvariants, self.max_combinations)
# This is static so that test code can use it easily.
@staticmethod
def _metadatapath_from_filename(filename):
return Path(filename).with_suffix(".metadata2.npz")
@property
def samples(self) -> List[str]:
"""
The sample identifiers (a :class:`numpy.ndarray` of ``str``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.samples)
['sample_0' 'sample_1' 'sample_2' 'sample_3']
"""
return self._samples
@property
def ids(self) -> List[str]:
"""
The variant identifiers (a :class:`numpy.ndarray` of ``str``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.ids)
['SNP1' 'SNP2' 'SNP3' 'SNP4']
"""
return self._ids
@property
def rsids(self) -> List[str]:
"""
The variant RS numbers (a :class:`numpy.ndarray` of ``str``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.rsids)
['RS1' 'RS2' 'RS3' 'RS4']
"""
return self._rsids
@property
def chromosomes(self) -> List[str]:
"""
The chromosome of each variant (a :class:`numpy.ndarray` of ``str``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.chromosomes)
['1' '1' '1' '1']
"""
return self._chromosomes
@property
def positions(self) -> List[int]:
"""
The genetic position of each variant (a :class:`numpy.ndarray` of ``int``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.positions)
[1 2 3 4]
"""
return self._positions
@property
def nalleles(self) -> List[int]:
"""
The number of alleles for each variant (a :class:`numpy.ndarray` of ``int``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.nalleles)
[2 2 2 2]
"""
return self._nalleles
@property
def allele_ids(self) -> List[str]:
"""
The comma-delimited list of alleles for each variant (a :class:`numpy.ndarray` of ``str``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.allele_ids)
['A,G' 'A,G' 'A,G' 'A,G']
"""
return self._allele_ids
@property
def ncombinations(self) -> List[int]:
"""
The number of values needed for each variant's probability distribution (a :class:`numpy.ndarray` of ``int``)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.ncombinations)
[4 4 4 4]
"""
return self._ncombinations
@property
def phased(self) -> List[bool]:
"""
For each variant, ``True`` if and only the variant is phased (a :class:`numpy.ndarray` of bool)
Example
--------
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> file = example_filepath("haplotypes.bgen")
>>> with open_bgen(file, verbose=False) as bgen:
... print(bgen.phased)
[ True True True True]
"""
return self._phased
@staticmethod
def _split_index(index):
if not isinstance(index, tuple):
index = (None, index)
samples_index = open_bgen._fix_up_index(index[0])
variants_index = open_bgen._fix_up_index(index[1])
return samples_index, variants_index
@staticmethod
def _fix_up_index(index):
if index is None: # make a shortcut for None
return slice(None)
try: # If index is an int, return it in an array
index = index.__index__() # (see
# https://stackoverflow.com/questions/3501382/checking-whether-a-variable-is-an-integer-or-not)
return [index]
except Exception:
pass
return index
def _map_metadata(self, metafile_filepath):
with _log_in_place("metadata", self._verbose) as updater:
with bgen_metafile(Path(metafile_filepath)) as mf:
nparts = mf.npartitions
(
id_list,
rsid_list,
chrom_list,
position_list,
vaddr_list,
nalleles_list,
allele_ids_list,
ncombinations_list,
phased_list,
) = ([], [], [], [], [], [], [], [], [])
for ipart2 in range(nparts): # LATER multithread?
# LATER in notebook this message doesn't appear on one line
updater("step 2: part {0:,} of {1:,}".format(ipart2, nparts))
(
nvariants,
vid,
rsid,
chrom,
position,
nalleles,
allele_ids,
offset,
) = mf._inner_read_partition(ipart2)
id_list.append(vid)
rsid_list.append(rsid)
chrom_list.append(chrom)
position_list.append(position)
nalleles_list.append(nalleles)
allele_ids_list.append(allele_ids)
vaddr_list.append(offset)
# LATER use concatenate(...out=) instead
self._ids = np.array(
np.concatenate(id_list), dtype="str"
) # dtype needed to make unicode
self._rsids = np.array(np.concatenate(rsid_list), dtype="str")
self._vaddr = np.concatenate(vaddr_list)
self._chromosomes = np.array(np.concatenate(chrom_list), dtype="str")
self._positions = np.concatenate(position_list)
self._nalleles = np.concatenate(nalleles_list)
self._allele_ids = np.array(np.concatenate(allele_ids_list), dtype="str")
for i, vaddr0 in enumerate(self._vaddr):
if i % 1000 == 0:
updater("step 3: part {0:,} of {1:,}".format(i, self.nvariants))
genotype = lib.bgen_file_open_genotype(self._bgen._bgen_file, vaddr0)
ncombinations_list.append(lib.bgen_genotype_ncombs(genotype))
phased_list.append(lib.bgen_genotype_phased(genotype))
lib.bgen_genotype_close(genotype)
self._ncombinations = np.array(ncombinations_list, dtype="int")
self._phased = np.array(phased_list, dtype="bool")
def __str__(self):
return "{0}('{1}')".format(self.__class__.__name__, self._filepath.name)
[docs] def close(self):
"""Close a :class:`open_bgen` object that was opened for reading.
Notes
-----
Better alternatives to :meth:`close` include the
`with <https://docs.python.org/3/reference/compound_stmts.html#grammar-token-with-stmt>`__
statement (closes the file automatically) and the `del
<https://docs.python.org/3/reference/simple_stmts.html#grammar-token-del-stmt>`__
statement (which closes the file and *deletes* the object).
Doing nothing, while not better, is usually fine.
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>> file = example_filepath("haplotypes.bgen")
>>> bgen = open_bgen(file, verbose=False)
>>> print(bgen.read(2))
[[[1. 0. 0. 1.]]
<BLANKLINE>
[[0. 1. 0. 1.]]
<BLANKLINE>
[[1. 0. 1. 0.]]
<BLANKLINE>
[[0. 1. 1. 0.]]]
>>> bgen.close() #'del bgen' is better.
"""
self.__exit__()
def __enter__(self):
return self
def __exit__(self, *_):
if (
hasattr(self, "_bgen_context_manager")
and self._bgen_context_manager is not None
): # we need to test this because Python doesn't guarantee that __init__ was
# fully run
self._bgen_context_manager.__exit__(None, None, None)
del (
self._bgen_context_manager
) # This allows __del__ and __exit__ to be called twice on the same object with
# no bad effect.
[docs] def allele_expectation(
self, index: Optional[Any] = None, return_frequencies: bool = False
) -> Union[np.ndarray, Tuple[np.ndarray, np.ndarray]]:
""" Allele expectation, frequency, and dosage.
Parameters
----------
index
An expression specifying the samples and variants of interest. (See :ref:`read_examples` in :meth:`.read` for details.)
Defaults to ``None``, meaning compute for all samples and variants.
return_frequencies: bool
Return an array telling the allele frequencies.
Defaults to ``False``
Returns
-------
one or two :class:`numpy.ndarray`:
always in this order
* Samples-by-variants-by-alleles matrix of allele expectations,
* Samples-by-variants-by-alleles matrix of frequencies, if ``return_frequencies`` is ``True``
Note
----
This method supports unphased genotypes only.
.. _allele_expectation_examples:
Examples
--------
.. doctest::
>>> from bgen_reader import allele_expectation, example_filepath, read_bgen
>>> from texttable import Texttable
>>>
>>> filepath = example_filepath("example.32bits.bgen")
>>>
>>> # Read the example.
>>> bgen = open_bgen(filepath, verbose=False)
>>> sample_index = bgen.samples=="sample_005" # will be only 1 sample
>>> variant_index = bgen.rsids=="RSID_6" # will be only 1 variant
>>> p = bgen.read((sample_index,variant_index))
>>> # Allele expectation makes sense for unphased genotypes only,
>>> # which is the case here.
>>> e = bgen.allele_expectation((sample_index,variant_index))
>>> alleles_per_variant = [allele_ids.split(',') for allele_ids in bgen.allele_ids[variant_index]]
>>>
>>> # Print what we have got in a nice format.
>>> table = Texttable()
>>> table = table.add_rows(
... [
... ["", "AA", "AG", "GG", "E[.]"],
... ["p"] + list(p[0,0,:]) + ["na"],
... ["#" + alleles_per_variant[0][0], 2, 1, 0, e[0,0,0]],
... ["#" + alleles_per_variant[0][1], 0, 1, 2, e[0,0,1]],
... ]
... )
>>> print(table.draw())
+----+-------+-------+-------+-------+
| | AA | AG | GG | E[.] |
+====+=======+=======+=======+=======+
| p | 0.012 | 0.987 | 0.001 | na |
+----+-------+-------+-------+-------+
| #A | 2 | 1 | 0 | 1.011 |
+----+-------+-------+-------+-------+
| #G | 0 | 1 | 2 | 0.989 |
+----+-------+-------+-------+-------+
If ``return_frequencies`` is true, this method will also return the allele frequency.
.. doctest::
>>> from bgen_reader import open_bgen, example_filepath
>>>
>>> filepath = example_filepath("example.32bits.bgen")
>>> bgen = open_bgen(filepath, verbose=False)
>>>
>>> variant_index = (bgen.rsids=="RSID_6") # will be only 1 variant
>>> e,f = bgen.allele_expectation(variant_index, return_frequencies=True)
>>> alleles_per_variant = [allele_ids.split(',') for allele_ids in bgen.allele_ids[variant_index]]
>>> print(alleles_per_variant[0][0] + ": {}".format(f[0,0]))
A:<PHONE_NUMBER>8810434
>>> print(alleles_per_variant[0][1] + ": {}".format(f[0,1]))
G:<PHONE_NUMBER>118956
>>> print(bgen.ids[variant_index][0],bgen.rsids[variant_index][0])
SNPID_6 RSID_6
To find dosage, just select the column of interest from the expectation.
.. doctest::
>>> from bgen_reader import example_filepath, open_bgen
>>>
>>> filepath = example_filepath("example.32bits.bgen")
>>>
>>> # Read the example.
>>> bgen = open_bgen(filepath, verbose=False)
>>>
>>> # Extract the allele expectations of the fourth variant.
>>> variant_index = 3
>>> e = bgen.allele_expectation(variant_index)
>>>
>>> # Compute the dosage when considering the allele
>>> # in position 1 as the reference/alternative one.
>>> alt_allele_index = 1
>>> dosage = e[...,1]
>>>
>>> # Print the dosage for only the first five samples
>>> # and the one (and only) variant
>>> print(dosage[:5,0])
[1.96185308 0.00982666 0.01745552 1.00347899 1.01153563]
>>> del bgen
>>>
>>> import pandas as pd
>>> from bgen_reader import open_bgen
>>> filepath = example_filepath("example.32bits.bgen")
>>> bgen = open_bgen(filepath, verbose=False)
>>>
>>> variant_index = [3]
>>> # Print the metadata of the fourth variant.
>>> print(bgen.ids[variant_index],bgen.rsids[variant_index])
['SNPID_5'] ['RSID_5']
>>> probs, missing, ploidy = bgen.read(variant_index,return_missings=True,return_ploidies=True)
>>> print(np.unique(missing),np.unique(ploidy))
[False] [2]
>>> df1 = pd.DataFrame({'sample':bgen.samples,'0':probs[:,0,0],'1':probs[:,0,1],'2':probs[:,0,2]})
>>> print(df1) # doctest: +NORMALIZE_WHITESPACE
sample 0 1 2
0 sample_001 0.00488 0.02838 0.96674
1 sample_002 0.99045 0.00928 0.00027
2 sample_003 0.98932 0.00391 0.00677
3 sample_004 0.00662 0.98328 0.01010
.. ... ... ... ...
496 sample_497 0.00137 0.01312 0.98550
497 sample_498 0.00552 0.99423 0.00024
498 sample_499 0.01266 0.01154 0.97580
499 sample_500 0.00021 0.98431 0.01547
<BLANKLINE>
[500 rows x 4 columns]
>>> alleles_per_variant = [allele_ids.split(',') for allele_ids in bgen.allele_ids[variant_index]]
>>> e,f = bgen.allele_expectation(variant_index,return_frequencies=True)
>>> df2 = pd.DataFrame({'sample':bgen.samples,alleles_per_variant[0][0]:e[:,0,0],alleles_per_variant[0][1]:e[:,0,1]})
>>> print(df2) # doctest: +NORMALIZE_WHITESPACE
sample A G
0 sample_001 0.03815 1.96185
1 sample_002 1.99017 0.00983
2 sample_003 1.98254 0.01746
3 sample_004 0.99652 1.00348
.. ... ... ...
496 sample_497 0.01587 1.98413
497 sample_498 1.00528 0.99472
498 sample_499 0.03687 1.96313
499 sample_500 0.98474 1.01526
<BLANKLINE>
[500 rows x 3 columns]
>>> df3 = pd.DataFrame({'allele':alleles_per_variant[0],bgen.rsids[variant_index][0]:f[0,:]})
>>> print(df3)
allele RSID_5
0 A 305.97218
1 G 194.02782
>>> alt_index = f[0,:].argmin()
>>> alt = alleles_per_variant[0][alt_index]
>>> dosage = e[:,0,alt_index]
>>> df4 = pd.DataFrame({'sample':bgen.samples,f"alt={alt}":dosage})
>>> # Dosages when considering G as the alternative allele.
>>> print(df4) # doctest: +NORMALIZE_WHITESPACE
sample alt=G
0 sample_001 1.96185
1 sample_002 0.00983
2 sample_003 0.01746
3 sample_004 1.00348
.. ... ...
496 sample_497 1.98413
497 sample_498 0.99472
498 sample_499 1.96313
499 sample_500 1.01526
<BLANKLINE>
[500 rows x 2 columns]
"""
samples_index, variants_index = self._split_index(index)
phased_list = self.phased[variants_index]
nalleles = self.nalleles[variants_index]
if any(phased_list):
raise ValueError(
"Allele expectation is define for unphased genotypes only."
)
if len(np.unique(nalleles)) != 1:
raise ValueError(
"Current code requires that all selected variants have the same number of alleles"
)
probs, ploidy = self.read(index, return_ploidies=True)
outer_expec = []
for vi in range(probs.shape[1]):
genotypes = get_genotypes(ploidy[:, vi], nalleles[vi])
probsvi = probs[:, vi, :]
expec = []
for i, genotype in enumerate(genotypes):
count = asarray(genotypes_to_allele_counts(genotype), float)
n = count.shape[0]
expec.append((count.T * probsvi[i, :n]).sum(1))
outer_expec.append(stack(expec, axis=0))
expec = stack(outer_expec, axis=1)
if return_frequencies:
ploidy0 = expec.shape[-1]
freq = expec.sum(0) / ploidy0
return expec, freq
else:
return expec
def __del__(self):
self.__exit__()


public
class
ParticleEmitter
extends Object
| java.lang.Object | |
| ↳ | com.viro.core.ParticleEmitter |
ParticleEmitter enables developers to create and configure quad emitters for building complex and intricate particle effects. Some examples are smoke, rain, confetti, and fireworks.
ParticleEmitters are particle factories that create, contain and recycle a pool of particles. Groups of particle systems can be used in conjunction with one another to create a composite effect. For example, a campfire may include a flame emitter, a smoke emitter, and an ember or sparks emitter.
For an extended discussion of particle systems in Viro, refer to the Particle Effects Guide.
Nested classes | |
|---|---|
class |
ParticleEmitter.EmissionBurst
EmissionBurst defines moments of instantaneous particle creation. |
enum |
ParticleEmitter.Factor
Factor is used to distinguish between various particle emission properties that can either be set as a rate per second or per meter. |
class |
ParticleEmitter.ParticleEmitterBuilder
Builder for creating |
interface |
ParticleEmitter.ParticleModifier
ParticleModifier is used by various |
class |
ParticleEmitter.ParticleModifierColor
ParticleModifier for color properties. |
class |
ParticleEmitter.ParticleModifierFloat
ParticleModifier for floating point properties. |
class |
ParticleEmitter.ParticleModifierVector
ParticleModifier for |
interface |
ParticleEmitter.SpawnVolume
Interface for volumes that can be defined for spawning particles. |
class |
ParticleEmitter.SpawnVolumeBox
For spawning particles across or within a box. |
class |
ParticleEmitter.SpawnVolumeEllipsoid
For spawning particles across or within an ellipsoid. |
class |
ParticleEmitter.SpawnVolumePoint
For spawning particles at a particular point in the parent Node's coordinate system. |
class |
ParticleEmitter.SpawnVolumeSphere
For spawning particles aross or within a sphere. |
Public constructors | |
|---|---|
ParticleEmitter(ViroContext viroContext, Surface surface)
This constructor is deprecated.
use |
|
ParticleEmitter(ViroContext viroContext, Quad quad)
Create a new ParticleEmitter with individual particles that resemble the provided |
Public methods | |
|---|---|
static
ParticleEmitter.ParticleEmitterBuilder
|
builder(ViroContext viroContext, Surface surface)
This method is deprecated.
use |
static
ParticleEmitter.ParticleEmitterBuilder
|
builder(ViroContext viroContext, Quad quad)
Builder for |
void
|
dispose()
Release native resources associated with this ParticleEmitter. |
Material.BlendMode
|
getBlendMode()
Return the |
float
|
getBloomThreshold()
Get the bloom threshold, the brightness at which particles from this ParticleEmitter will begin to bloom. |
int
|
getDelay()
Get the delay in milliseconds to apply between emission cycles. |
int
|
getDuration()
Get the duration of each emission cycle in milliseconds. |
List<ParticleEmitter.EmissionBurst>
|
getEmissionBursts()
Get the |
float[]
|
getEmissionRatePerMeter()
Get the number of particles emitted per meter traveled by this ParticleEmitter during an emission cycle. |
float[]
|
getEmissionRatePerSecond()
Get the number of particles emitted per second by this ParticleEmitter during an emission cycle. |
int
|
getMaxParticles()
Get the maximum number of live particles allowed for this ParticleEmitter. |
float[]
|
getParticleLifetime()
Get the lifetime of particles in milliseconds. |
boolean
|
getSpawnOnSurface()
Return true if particles are only generated on the surface of the ParticleEmitter's
|
ParticleEmitter.SpawnVolume
|
getSpawnVolume()
Return the {@link SpawnVolume, which defines the volume over which particles will be created for this ParticleEmitter. |
boolean
|
isFixedToEmitter()
Returns true if the particles in this ParticleEmitter are fixed to the emitter's location. |
boolean
|
isPaused()
Returns true if the ParticleEmitter is not running. |
void
|
pause()
Pause the ParticleEmitter. |
void
|
resetEmissionCycle()
Resets this ParticleEmitter to the beginning of its emission cycle. |
void
|
run()
Run the ParticleEmitter. |
void
|
setAccelerationModifier(ParticleEmitter.ParticleModifierVector modifier)
Set the acceleration of the particles generated by this ParticleEmitter. |
void
|
setBlendMode(Material.BlendMode blendMode)
Set the |
void
|
setBloomThreshold(float threshold)
Set the brightness value at which particles from this ParticleEmitter will begin to bloom. |
void
|
setColorModifier(ParticleEmitter.ParticleModifierColor modifier)
Set the color of the particles generated by this ParticleEmitter. |
void
|
setDelay(int delayMillis)
Set the delay in milliseconds to apply before this ParticleEmitter starts a new emission cycle. |
void
|
setDuration(int durationMillis)
Set the duration of each emission cycle in milliseconds. |
void
|
setEmissionBursts(List<ParticleEmitter.EmissionBurst> bursts)
Set |
void
|
setEmissionRatePerMeter(int min, int max)
Set the number of particles this ParticleEmitter spawns per meter traveled, during an emission cycle. |
void
|
setEmissionRatePerSecond(int min, int max)
Set the number of particles this emitter spawns per second, during an emission cycle. |
void
|
setExplosiveImpulse(float impulse, Vector position, float decelerationPeriod)
Set an explosive impulse, which simulates the effect of a detonation or other impulsive force. |
void
|
setFixedToEmitter(boolean fixed)
Set whether the particles generated from this ParticleEmitter are fixed to the emitter's location, or are free. |
void
|
setLoop(boolean loop)
Set to true if the emitter should restart emitting particles at the end of each emission cycle, after the delay. |
void
|
setMaxParticles(int maxParticles)
Set the maximum number of live particles that can exist at any moment from this ParticleEmitter. |
void
|
setOpacityModifier(ParticleEmitter.ParticleModifierFloat modifier)
Set the opacity of the particles generated by this ParticleEmitter. |
void
|
setParticleLifetime(int min, int max)
Set the lifetime of each particle, in milliseconds. |
void
|
setRotationModifier(ParticleEmitter.ParticleModifierFloat modifier)
Set the rotation of the particles generated by this ParticleEmitter. |
void
|
setScaleModifier(ParticleEmitter.ParticleModifierVector modifier)
Set the scale of the particles generated by this ParticleEmitter. |
void
|
setSpawnVolume(ParticleEmitter.SpawnVolume volume, boolean spawnOnSurface)
Set the |
void
|
setVelocityModifier(ParticleEmitter.ParticleModifierVector modifier)
Set the velocity of the particles generated by this ParticleEmitter. |
ParticleEmitter (ViroContext viroContext, Surface surface)
This constructor is deprecated.
use ParticleEmitter(ViroContext, Quad)
instead
Create a new ParticleEmitter with individual particles that resemble the provided Surface
. To be used, the ParticleEmitter needs to be added to a Node
through setParticleEmitter(ParticleEmitter)
. The ParticleEmitter will conform to all the
transforms of its parent Node, meaning it can be moved and oriented with the scene graph.
| Parameters | |
|---|---|
viroContext |
ViroContext : The ViroContext is required to generate particles. |
surface |
Surface : Surface representing how each individual particle should appear.
The Surface may be textured as well. |
ParticleEmitter (ViroContext viroContext, Quad quad)
Create a new ParticleEmitter with individual particles that resemble the provided Quad
. To be used, the ParticleEmitter needs to be added to a Node
through setParticleEmitter(ParticleEmitter)
. The ParticleEmitter will conform to all the
transforms of its parent Node, meaning it can be moved and oriented with the scene graph.
| Parameters | |
|---|---|
viroContext |
ViroContext : The ViroContext is required to generate particles. |
quad |
Quad : Quad representing how each individual particle should appear.
The Quad may be textured as well.
|
ParticleEmitter.ParticleEmitterBuilder builder (ViroContext viroContext, Surface surface)
This method is deprecated.
use ERROR(/ParticleEmitterBuilder#ParticleEmitterBuilder(ViroContext, Quad))
instead
Builder for ParticleEmitter
objects.
| Parameters | |
|---|---|
viroContext |
ViroContext |
surface |
Surface |
| Returns | |
|---|---|
ParticleEmitter.ParticleEmitterBuilder |
ParticleEmitter.ParticleEmitterBuilder builder (ViroContext viroContext, Quad quad)
Builder for ParticleEmitter
objects.
| Parameters | |
|---|---|
viroContext |
ViroContext |
quad |
Quad |
| Returns | |
|---|---|
ParticleEmitter.ParticleEmitterBuilder |
void dispose ()
Release native resources associated with this ParticleEmitter.
Material.BlendMode getBlendMode ()
Return the Material.BlendMode
used by particles from this
ParticleEmitter.
| Returns | |
|---|---|
Material.BlendMode |
The Material.BlendMode used by this ParticleEmitter.
|
float getBloomThreshold ()
Get the bloom threshold, the brightness at which particles from this ParticleEmitter will
begin to bloom. See setBloomThreshold(float)
for discussion.
| Returns | |
|---|---|
float |
The bloom threshold. |
int getDelay ()
Get the delay in milliseconds to apply between emission cycles.
| Returns | |
|---|---|
int |
The delay in milliseconds. |
int getDuration ()
Get the duration of each emission cycle in milliseconds.
| Returns | |
|---|---|
int |
The duration in milliseconds. |
List<ParticleEmitter.EmissionBurst> getEmissionBursts ()
Get the ParticleEmitter.EmissionBurst
s for this ParticleSystem, which define moments of instantaneous
particle creation. See setEmissionBursts(List)
for discussion.
| Returns | |
|---|---|
List<ParticleEmitter.EmissionBurst> |
List of each ParticleEmitter.EmissionBurst used in this ParticleSystem.
|
float[] getEmissionRatePerMeter ()
Get the number of particles emitted per meter traveled by this ParticleEmitter during an
emission cycle. This value is picked randomly from the returned uniform distribution. See
setEmissionRatePerMeter(int, int)
for discussion.
| Returns | |
|---|---|
float[] |
The float[] with the minimum and maximum number of particles emitted per meter. |
float[] getEmissionRatePerSecond ()
Get the number of particles emitted per second by this ParticleEmitter during an emission
cycle. This value is picked randomly from the returned uniform distribution. See setEmissionRatePerSecond(int, int)
for discussion.
| Returns | |
|---|---|
float[] |
The float[] with the minimum and maximum number of particles emitted per second. |
int getMaxParticles ()
Get the maximum number of live particles allowed for this ParticleEmitter. See setMaxParticles(int)
for discussion.
| Returns | |
|---|---|
int |
The maximum number of particles. |
float[] getParticleLifetime ()
Get the lifetime of particles in milliseconds. This lifetime of each particle is picked
randomly from the returned uniform distribution. See setParticleLifetime(int, int)
for discussion.
| Returns | |
|---|---|
float[] |
The float[] with the minimum and maximum lifetime of each particle, in milliseconds. |
boolean getSpawnOnSurface ()
Return true if particles are only generated on the surface of the ParticleEmitter's
ParticleEmitter.SpawnVolume
.
| Returns | |
|---|---|
boolean |
True if particles only spawn on the surface, false if they spawn within the volume as well. |
ParticleEmitter.SpawnVolume getSpawnVolume ()
Return the {@link SpawnVolume, which defines the volume over which particles will be created for this ParticleEmitter. See {@link #setSpawnVolume(SpawnVolume, boolean)} for discussion.
| Returns | |
|---|---|
ParticleEmitter.SpawnVolume |
The ParticleEmitter.SpawnVolume on or within which particles are generated.
|
boolean isFixedToEmitter ()
Returns true if the particles in this ParticleEmitter are fixed to the emitter's location.
See setFixedToEmitter(boolean)
for discussion.
| Returns | |
|---|---|
boolean |
True if the particles are fixed to the emitter location. |
boolean isPaused ()
Returns true if the ParticleEmitter is not running.
| Returns | |
|---|---|
boolean |
True if the ParticleEmitter is paused. |
void pause ()
Pause the ParticleEmitter. This will immediately cease the generation of new particles, but existing particles will live out their remaining lifetimes.
void resetEmissionCycle ()
Resets this ParticleEmitter to the beginning of its emission cycle. This will also clear all existing particles.
void run ()
Run the ParticleEmitter. This will wait for delay milliseconds then start the
first emission cycle. The cycle will continue for its set duration, and then
another cycle will start after the delay if loop is enabled. Emissions can be
stopped at any time by invoking pause()
.
void setAccelerationModifier (ParticleEmitter.ParticleModifierVector modifier)
Set the acceleration of the particles generated by this ParticleEmitter. The ParticleEmitter.ParticleModifierVector
provided will define the initial acceleration of the particles, and
may also indicate how acceleration will change over time or over distance. Each Vector
in the modifier defines the X, Y, and Z accelearation.
By default, ParticleEmitter radiates particles in a fountain-like fashion. By using setVelocityModifier(ParticleModifierVector)
and setAccelerationModifier(ParticleModifierVector)
a variety of more complex animations can be achieved. For example, falling, swaying snow can
be achieved with a fixed acceleration of -9.81 and a randomized initial horizontal velocity.
A similar configuration can be used to make steam particles emanate from a kettle.
>
| Parameters | |
|---|---|
modifier |
ParticleEmitter.ParticleModifierVector : The ParticleEmitter.ParticleModifierVector describing acceleration behavior for the
particles.
|
void setBlendMode (Material.BlendMode blendMode)
Set the Material.BlendMode
to use for particles from this ParticleEmitter. BlendMode
determines how a pixel's color, as it is being rendered, interacts with the color of the
pixel already in the framebuffer.
Default is ALPHA
.
| Parameters | |
|---|---|
blendMode |
Material.BlendMode : The BlendMode to use for this Material.
|
void setBloomThreshold (float threshold)
Set the brightness value at which particles from this ParticleEmitter will begin to bloom.
Bloom is an effect that makes surfaces appear to glow by applying a Gaussian blur and additive blend.
This value specifies at what 'brightness' the particles should start to bloom. Brightness is effectively the magnitude of the final color of a particle (modified for the human eye: specifically it is the dot product of the final color with (0.2126, 0.7152, 0.0722)).
For example, if this property is set to 0.0, then all particles will bloom. If this property is set to 1.0, then only those pixels of the particle whose brightness exceeds 1.0 (after lights are applied) will bloom.
Default is -1.0, which disables bloom.
| Parameters | |
|---|---|
threshold |
float : The bloom threshold value to set. Set to less than zero to disable bloom
entirely.
|
void setColorModifier (ParticleEmitter.ParticleModifierColor modifier)
Set the color of the particles generated by this ParticleEmitter. The ParticleEmitter.ParticleModifierColor
provided will define the initial color of the particles, and may
also indicate how color will change over time or over distance.
| Parameters | |
|---|---|
modifier |
ParticleEmitter.ParticleModifierColor : The ParticleEmitter.ParticleModifierColor describing color behavior for the
particles.
|
void setDelay (int delayMillis)
Set the delay in milliseconds to apply before this ParticleEmitter starts a new emission cycle. Particles are produced during each emission cycle.
Default is 0 milliseconds.
| Parameters | |
|---|---|
delayMillis |
int : The delay in milliseconds.
|
void setDuration (int durationMillis)
Set the duration of each emission cycle in milliseconds. Particles are produced continually during each emission cycle.
The default is 2000 milliseconds.
| Parameters | |
|---|---|
durationMillis |
int : The duration in milliseconds.
|
void setEmissionBursts (List<ParticleEmitter.EmissionBurst> bursts)
Set ParticleEmitter.EmissionBurst
s for this ParticleSystem for instantaneous particle creation. In
addition to emitting particles at a constant rate via setEmissionRatePerMeter(int, int)
and setEmissionRatePerSecond(int, int)
, certain particle effects may require
the ability to instantaneously spawn N number of particles all at once in a single
burst. Fireworks, sparks, and explosions are some examples. To specify a burst, create ParticleEmitter.EmissionBurst
objects. In each ParticleEmitter.EmissionBurst
you can specify a time (or distance
traveled) at which to burst a number of particles, in repetition if needed. These bursts are
done in conjunction with emission rates, and are also subjected to the same setMaxParticles(int)
constraint.
There are no bursts assigned by default.
| Parameters | |
|---|---|
bursts |
List : The ParticleEmitter.EmissionBurst bursts to use in this ParticleSystem.
|
void setEmissionRatePerMeter (int min, int max)
Set the number of particles this ParticleEmitter spawns per meter traveled, during an emission cycle. The value is chosen randomly from the uniform distribution defined by min and max.
How fast an emitter produces particles is determined by either setEmissionRatePerSecond(int, int)
or setEmissionRatePerMeter(int, int)
(in which
the particle output is proportional to how fast the emitter itself is moving). Depending on
the effect you wish to create, you may decide to one or both properties. For example, in a
situation where steam particles are emitted from a train upon movement, setEmissionRatePerMeter(int, int)
is the sensible choice. This is also true if you, say,
have a spaceship that emits more smoke as it accelerates.
Default value is min 0, max 0, meaning zero particles produced per meter traveled.
| Parameters | |
|---|---|
min |
int : The minimum number of particles to emit per meter. |
max |
int : The maximum number of particles to emit per meter.
|
void setEmissionRatePerSecond (int min, int max)
Set the number of particles this emitter spawns per second, during an emission cycle. The value is chosen randomly from the uniform distribution defined by min and max.
How fast an emitter produces particles is determined by either setEmissionRatePerSecond(int, int)
or setEmissionRatePerMeter(int, int)
(in which the
particle output is proportional to how fast the emitter itself is moving). Depending on the
effect you wish to create, you may decide to one or both properties. For example, in a
situation where steam particles are emitted from a train upon movement, setEmissionRatePerMeter(int, int)
is the sensible choice. This is also true if you, say, have
a spaceship that emits more smoke as it accelerates.
Default value is min 10, max 10.
| Parameters | |
|---|---|
min |
int : The minimum number of particles to emit per second. |
max |
int : The maximum number of particles to emit per second.
|
void setExplosiveImpulse (float impulse, Vector position, float decelerationPeriod)
Set an explosive impulse, which simulates the effect of a detonation or other impulsive force.
Impulsive forces are defined by a detonation position and an impulse. The impulse is
specified in newton seconds and determines the strength of the force. The detonation
point is set in the coordinate system of the ParticleEmitter's parent Node
. The
closer particles are to the detonation point, the larger their explosive force.
The behavior of an explosion may also be tuned with the decelerationPeriod parameter. This enables a "dampening deceleration effect" against the explosive impulse force, in order to slow down the explosion. The decelerationPeriod defines the timeframe in milliseconds within which the particles will decelerate from their initial velocity to 0.0 m/s. This is particularly useful for fireworks, which explode outward then slow down / are dampened after a specific length of time.
Note that setting an explosive impulse automatically invalidates any velocity set via setVelocityModifier(ParticleModifierVector)
, as an explosion directly manipulates an
object's velocity. Likewise, if a >decelerationPeriod is provided, it will
invalidate the acceleration set via setAccelerationModifier(ParticleModifierVector)
.
| Parameters | |
|---|---|
impulse |
float : The impulsive force, in newton seconds. |
position |
Vector : The detonation position. |
decelerationPeriod |
float : The deceleration period in milliseconds. Set to less than zero to
not use a deceleration period.
|
void setFixedToEmitter (boolean fixed)
Set whether the particles generated from this ParticleEmitter are fixed to the emitter's location, or are free. When true, Viro uses the emitter's current position to determine each particle's appearance and movement; when false, Viro uses each particle's individual spawn location.
When false, particles are not "locked" to the emitter: they can float away. For example, smoke particles from a moving train would continue floating upward from the location they were spawned. When true, the smoke particles would be "locked" to the train's emitter: they would always move with the train in reference to the emitter's location.
Default is true.
| Parameters | |
|---|---|
fixed |
boolean : True to fix particles to the emitter location.
|
void setLoop (boolean loop)
Set to true if the emitter should restart emitting particles at the end of each emission cycle, after the delay.
Default is true.
| Parameters | |
|---|---|
loop |
boolean : True to continually run emission cycles.
|
void setMaxParticles (int maxParticles)
Set the maximum number of live particles that can exist at any moment from this
ParticleEmitter. This includes particles created by setEmissionRatePerSecond(int, int)
, setEmissionRatePerMeter(int, int)
, and setEmissionBursts(List)
. When
the cap is reached, new particles will only be spawned as existing particles die off.
Default value is 500.
| Parameters | |
|---|---|
maxParticles |
int : The maximum number of life particles for this ParticleEmitter.
|
void setOpacityModifier (ParticleEmitter.ParticleModifierFloat modifier)
Set the opacity of the particles generated by this ParticleEmitter. The ParticleEmitter.ParticleModifierFloat
provided will define the initial opacity of the particles, and may
also indicate how the opacity will change over time or over distance.
| Parameters | |
|---|---|
modifier |
ParticleEmitter.ParticleModifierFloat : The ParticleEmitter.ParticleModifierFloat describing opacity behavior for the
particles.
|
void setParticleLifetime (int min, int max)
Set the lifetime of each particle, in milliseconds. The lifetime for each particle will be chosen randomly from the uniform distribution defined by min and max.
How long a particle lives for (or how fast a particle dies) is defined by its lifetime.
Specifying the particle lifetime and the particle emisssion rate (via setEmissionRatePerMeter(int, int)
or setEmissionRatePerSecond(int, int)
)
determines the eventual steady state of the ParticleEmitter. In this steady state, there will
be a roughly constant number of existing, spawned particles for the emitter.
Default value is min 2000, max 2000.
| Parameters | |
|---|---|
min |
int : The minimum lifetime of a particle, in milliseconds. |
max |
int : The maximum lifetime of a particle, in milliseconds.
|
void setRotationModifier (ParticleEmitter.ParticleModifierFloat modifier)
Set the rotation of the particles generated by this ParticleEmitter. The ParticleEmitter.ParticleModifierVector
provided will define the initial rotation of the particles, and may
also indicate how rotation will change over time or over distance. Each Vector
in the modifier defines the X, Y, and Z Euler angle rotation in radians.
| Parameters | |
|---|---|
modifier |
ParticleEmitter.ParticleModifierFloat : The ParticleEmitter.ParticleModifierVector describing rotation behavior for the
particles.
|
void setScaleModifier (ParticleEmitter.ParticleModifierVector modifier)
Set the scale of the particles generated by this ParticleEmitter. The ParticleEmitter.ParticleModifierVector
provided will define the initial scale of the particles, and may
also indicate how scale will change over time or over distance. Each Vector
in the modifier defines the X, Y, and Z scale.
| Parameters | |
|---|---|
modifier |
ParticleEmitter.ParticleModifierVector : The ParticleEmitter.ParticleModifierVector describing scale behavior for the
particles.
|
void setSpawnVolume (ParticleEmitter.SpawnVolume volume, boolean spawnOnSurface)
Set the ParticleEmitter.SpawnVolume
, which defines the volume over which particles will be created
for this ParticleEmitter.
By default, ParticleEmitter spawns particles at the location of the emitter. This is useful for effects tied to a single source, like smoke rising from a chimney. However, other effects may require more complex spawn volumes; for example, spawning snow or rain over an area of land.
By setting a spawn volume, you can specify the shape within which to spawn particles.
Supported shapes are ParticleEmitter.SpawnVolumeBox
with width, height, and length, ParticleEmitter.SpawnVolumeSphere
with radius, ParticleEmitter.SpawnVolumeEllipsoid
with x,y,z ellipsoid length, and
ParticleEmitter.SpawnVolumePoint
. All particles will spawn in a uniformly distributed pattern within
the shape.
Finally, there may be effects that require particles to spawn on the surface of a shape, rather than within it. For example, fireworks require particles to be spawned on the surface of a sphere. To achieve this effect, set spawnOnSurface to true. Particles will be spawned in a uniformly distributed fashion on the surface of the specified shape.
| Parameters | |
|---|---|
volume |
ParticleEmitter.SpawnVolume : The ParticleEmitter.SpawnVolume on or within which to generate particles. |
spawnOnSurface |
boolean : True to only spawn particles on the surface of the volume, false to
spawn particles within the volume as well.
|
void setVelocityModifier (ParticleEmitter.ParticleModifierVector modifier)
Set the velocity of the particles generated by this ParticleEmitter. The ParticleEmitter.ParticleModifierVector
provided will define the initial velocity of the particles, and may
also indicate how velocity will change over time or over distance. Each Vector
in the
modifier defines the X, Y, and Z velocity.
By default, ParticleEmitter radiates particles in a fountain-like fashion. By using setVelocityModifier(ParticleModifierVector)
and setAccelerationModifier(ParticleModifierVector)
a variety of more complex animations can be achieved. For example, falling, swaying snow can
be achieved with a fixed acceleration of -9.81 and a randomized initial horizontal velocity.
A similar configuration can be used to make steam particles emanate from a kettle.
>
| Parameters | |
|---|---|
modifier |
ParticleEmitter.ParticleModifierVector : The ParticleEmitter.ParticleModifierVector describing velocity behavior for the
particles.
|


Home
Search
×
subject
Topic
Register transfer language
computer organisation and architecture
Hard wired
computer organisation and architecture
micro programmed
computer organisation and architecture
not available?
Thinking in c++ volume 1 by Eckel.
Available soon
available soon
DLDMP
1st unit notes
2nd unit notes
3rd Unit notes
4rth chapter
5th chapter
Coa
Advances in computer systems Architectures
Bus and memory transfers
Bus structures
chapter 1.
Coa by carl hemacher 5th edition
coa by william stalling 10th latest Edition.
system Architecture by morris mano III edition.
computer Registers.
Flip flops.
Functional Units of a computer.
Hard wired control Unit.
Mirco programmed control Unit
Instrction cycle.
octal Memory.


class Solution: def slowestKey(self, releaseTimes: List[int], keysPressed: str) -> str: res = keysPressed[0] longest = releaseTimes[0] for i in range(1, len(keysPressed)): duration = releaseTimes[i] - releaseTimes[i-1] if duration > longest: longest = duration res = keysPressed[i] elif duration == longest: res = max(res, keysPressed[i]) return res


This sample queries an available XRDevices and prints out a brief summary of it. This sample does not render anything to the XRDevice.


?I
Cenchrus
brownii
Roem.
&
I
Schult.
Luis
Catas˛s
Guerra
2006
HERBARIUM
Ot
IOWA
STATE
UNIVERSITY
REVISION
OF|HE
GENUS
CENCHRUS
Cenchrus
brownii
R.
&
S.
NEW
YORK
BOTANICAL
QAfiO‚N
01044360
THE
NEW
YORK
BOTANICAL
GARDEN
EXPLORATION
OF
VIEQUES
ISLAND,
PORTO
RICO
_
SANTA
MARIA
J.
A.
SHAFER.
COLLECTOR
February
2,
1914
DETERMINED
BY
D.G.
DELISLE
01044360
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


Heron, Dunn lead St. John’s to 82-63 win over Columbia
NEW YORK (AP) - Mustapha Heron scored 15 points, Rasheem Dunn added 14 off the bench and St. John’s beat Columbia 82-63 on Wednesday night.
Julian Champagnie had 14 points and seven rebounds for the Red Storm (4-1), who bounced back from a 70-68 home loss to Vermont on Saturday. Marcellus Earlington chipped in with eight points and eight boards, and Josh Roberts led the team with 11 rebounds.
Mike Smith had 20 points, nine rebounds and six assists for the Lions (1-4). Jake Killingsworth added 11 points. Tai Bibbs had 10 points and six boards.
St. John’s faces Arizona State on Saturday. Columbia plays Rider on Saturday.
For more AP college basketball coverage: https://apnews.com/Collegebasketball and http://twitter.com/AP_Top25
This was generated by Automated Insights, http://www.automatedinsights.com/ap, using data from STATS LLC, https://www.stats.com
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


{{ include ('partials/page-header-bg.html', { title: 'Treatments' }) }} {{ include ('partials/intro-block.html', { text: 'Around X people have fertility treatment in the UK each year. Fertility treatments fall into three broad categories: drugs which boost the number of eggs a woman produces; assisted conception which involves manually fertilising your eggs outside the body or surgery to address a problem in the body, such as a blocked fallopian tube. Your treatment may involve one, two or all three of these approaches depending on your situation and the reason you’re having treatment. ' }) }}
Your GP or clinic should be able to advise you on the best treatment option for you. Some couples and individuals will start by trying one type of treatment, such as IVF, and if that’s not successful will then look at other options such as IUI, surrogacy or using donated eggs or sperm in their treatment. You might also want to consider having additional treatments such as embryo testing if you have a serious inherited disease in your family.
If you’re having fertility treatments there are a number of different options you might like to consider and discuss with your doctor.
{{ include('partials/spotlight-group.html', { cols: '4', panels: [ { title: 'IVF', body: 'IVF is the most common form of treatment. Around 50,000 women have IVF in the UK each year using either their partner or a donor’s sperm and that number continues to grow.', href: '/treatments/treatment-options/IVF' }, { title: 'Fertility drugs', body: 'Fertility drugs are often used in other treatments such as IVF and IUI, but they can also be used by themselves to increase the number of eggs or sperm available (because you have an irregular cycle for example).' }, { title: 'IUI', body: 'Intrauterine insemination is the main treatment used by people who are using donor sperm in their treatment, including single women and female couples. Around X women have IUI treatment each year. ' } ] }) }} {{ include('partials/spotlight-group.html', { cols: '4', panels: [ { title: 'Surgery', body: 'In some cases, surgery can be used to correct or reverse sterilisation. So fallopian tubes can be unblocked using keyhole surgery and for men who cannot produce sperm (if they have had a vasectomy for example), sperm can be collected surgically for use in fertility treatment.' }, { title: 'Surrogacy', body: 'Surrogacy is an option if you have a medical condition which makes it dangerous or impossible for you to give birth such as problems in the womb or if you’ve had multiple miscarriages. It’s also the used by gay couples who want to have a family. ' }, { title: 'Less common treatments ', body: 'A small number of people have less common treatments including gamete intra fallopian transfer (GIFT) and reproductive immunology. Not all of these have been proven to work well so make sure you have all the facts before agreeing to treatment. ' } ] }) }}


Suebel Seal offers effective Sealing Solutions for various Industrial Applications with it's in-house designing and module making... Read More
Now you can get selected seals from 30,000 different standard seals in 1 hour. Seals delivered...faster than anybody... Read More
Spareage seals offers OEM's the possibility of obtaining a non-standard Seal without compromising on cost... Read More
The programme is suitable for Users of Seals, Sales/Purchase team members, Techno-commercial Personnel.... Read More
we have been awarded as one of the top 100 mid size companies of india .
Yet another feather in the cap. Mr Nitin Poojari CEO Spareage Solutions , seen here, receiving an award of excellence, on behalf of Mr. Dilprit Sabharwal, Managing Director....
We are looking for people passionate about accelerating innovation in all disciplines to join us. If you have that passion, we want to hear from you! - See more at:
Read More


about = {}
root_path = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(root_path, "textacy", "about.py")) as f:
exec(f.read(), about)
// NOTE: Package configuration, including the name, metadata, and other options,
import setuptools
if __name__ == "__main__":
setuptools.setup()


{% load i18n %} {% blocktrans with name=user.name %}
Hello {{ name }}!
It appears that your post has been cross-posted to another site: {{ comment }}
This is typically not recommended as it runs the risk of annoying people in both communities.
{% endblocktrans %}


Define Basis
Identification code
Institutional unique identifier for the preservation plan
Document Types
This is a a general description of the set of objects you are creating a preservation plan for.
Original technical environment
The original set of software and hardware that was used to create and render the objects.
This description should be as detailed as possible to allow a solid comparison between environments and objects.
Plan Name
Please provide a name for the preservation plan.
Plan Description
This is a short description of the planning activity, basically a short summary.
Responsible Planner
Responsible person for the planning activity. Please provide full name, job title, and contact.
Organisation
Name of the organisation that is carrying out the planning activity.
Mandate
Mandate of the repository (see
TRAC A1.1)
Planning Purpose
What is the purpose of the current planning activity?
Are you, for example, revising an existing plan because of changed environment factors or new objects?
Or are you defining a first plan for a set of objects that you have just received?
Identification of the designated community or communities
and their associated knowledge base(s) (
TRAC A3.1)
Applying policies
Relevant polices for preservation planning
activites (
TRAC A3.3) - which policies are influencing your planning activity?
Relevant organisational procedures and workflows
Relevant procedures, rules, manuals, handbooks
and workflows for preservation planning endeavours (
TRAC A3.3)
Contracts and agreements specifying preservation rights
Relevant Contracts and deposit agreements of preservation rights (
TRAC A5.2)
Reference to agreements of maintenance and access
Relevant contracts and deposit agreements specifying all appropriate aspects of maintenance and access of the collection. (e.g. submission agreements, deposit agreements)
This is especially relevant for data which are owned by third parties. Agreements may cover restrictions or requirements for access and maintenance, e.g. provide DIP in specific format or repository is responsible for error fixing.
Relations
Are there any relations to other preservation plans? Is this plan for example based on another one replacing another plan, etc.?
Events that triggered this preservation planning activity (eg. new objects in the collection,
a periodic review of the plan, changes in environment or requirements).
The following types of triggers are foreseen:
| New collection | A plan is created for a new set of objects. |
| Periodic Review | A scheduled review has led to the decision that an existing plan shall be revised. |
| Changed Environment | Contextual influence factors have changed that justify a revision of a plan. |
| Changed Objective | The goals of the institution have changed and require revising an existing plan. |
| Changed Collection Profile | The profile of a set of objects has changed in such a way that current measures are not sufficient to keep the objects alive. |
Policy File Upload
You can upload your XML policy file here which will then be displayed and stored with the preservation project.
Define Sample Records
About
Sample Objects are important for the experimentation phase.
Collection ID
Identification code of the collection, or a description that identifes it uniquely, if no code is available.
Description
Description of the set of objects for which a preservation is created.
Type of objects
What type of objects does the collection contain?
Number of Objects
Number of objects currently in the considered collection.
Expected growth rate
The expected growth rate of the collection (e.g. 100 objects per day).
Description of the sample records
General description of the sample records and reasons for the specific selection of the sample records out of the whole set of objects.
Description
Description of this specific sample record (What does it contain, why was it chosen, characteristics of the object,...)
Full Name
Full name of the sample object.
PUID
The Pronom Unique Identifier of the Sample Record. This can be determined by the DROID tool.
The PUID can be used for discovering applicable preservation actions that can operate on this object format in the later stages of evaluating potential actions (Define Alternatives).
Format Name
The name of the format of the Sample Record.
Format Version
The format version of the Sample Record.
Format Mime-Type
The Mime-Type of the Sample Record.
Format default extension
The common file extension of the Sample Record, such as 'jpg' for JPEG images.
Type of objects
What type of objects does the collection contain?
Type of objects
What type of objects does the collection contain?
Define Alternatives
Name of Alternative
Uniquely identifying short name of the potential strategy that is to be evaluated
Description of alternative
The description should include required hardware, software and parameter settings.
Reason for considering
Why was this specific alternative included in the evaluation procedure? Reasons might include previous experience with the selected tools
which might come from registries such as the Planets PA registry, constraints influencing the tool selection, etc.
Config Settings
Configuration settings of tools and services of the alternative
Indicator of necessary resources
Resources needed for executing and evaluating this alternative.
Develop Experiment
Develop experiment description
Document the used hardware, software, parameters and the process to carry out the experiment as well as the mechanism to retrieve the results for each experiment.
Develop experiment settings
This field contains the actual parameter values used for calling the tool/service that you are evaluating. If you use an external tool yourself and specify the parameters manually, please document them here carefully.
Develop experiment parameters
Preservation Components may need parameters to run. The number and type of parameters is specified in the component. Component developers may provide common values as predefined parameters.
Run Experiment
Run experiment description
Documentation about running the experiments for every sample object.
Report
This text area contains a summary of the reports aggregated over all sample objects.
For automated migration services, usually the commandline output of the migration tools is
automatically aggregated and displayed here. Emulators will have different logging output.
If a preservation action service fails with an error, this will be recorded here together with
available information on the type of error, if applicable and available.
Resulting Files
The resulting files after the experiments have been run. (eg. for migration the migrated files).
For migration web services that are executed by the planning tool, these files will be retrieved automatically. For all experiments that you are carrying out yourself, please upload all resulting files and documentation here.
Create Executable Plan
Triggers and conditions
Enter here what triggers the execution and the conditions under which the preservation action will be carried out.
Validate and QA
What actions have to be carried out to validate the preservation action and what documents have to be supplied to quality assure the execution.
Location of records
In this field you should describe a path to the records. For automated execution of the plan this has to be entered in a for the execution tool understandable way.
Parameters for tool
These are the parameters and settings of the execution tool. For automated execution of the plan this has to be entered in a for the execution tool understandable way.
Define Preservation Plan
Currency
The currency used for the cost model figures.
CIG (Integrate new solution)
Costs of integration of the new solution. Contains costs for developing, software and hardware. Part of the Life-Cost-Model for digital preservation.
CPE (Perform PA)
Total costs of performing the Preservation Action over the whole collection. Part of the Life-Cost-Model for digital preservation.
CQA (Quality Assure PA)
Total costs of Quality Assurance for Preservation Action over the whole collection. Part of the Life-Cost-Model for digital preservation.
CRM (Record PA Metadata)
Total costs of recording metadata about the performed preservation action for the whole collection. Part of the Life-Cost-Model for digital preservation.
PA Total (CIG+CPE+CQA+CRM)
Total costs for the Preservation Action. This should be a sum of CIG, CPE, CQA and CRM. Part of the Life-Cost-Model for digital preservation.
Reingest
Total costs for the reingest of the objects on which the preservation action has been performed. Part of the Life-Cost-Model for digital preservation.
TCO
Total Cost of Ownership. If you use this model for calculating the costs of your preservation action and re-ingest, enter the amount here.
Remarks about the figures. If you use a costmodel different to TCO or Life, you can enter the data here as well.
Responsible person for execution
Enter the person responsible for executing the preservation plan here.
Responsible person for monitoring
Enter the person responsible for approving the preservation plan here.
Events that trigger a new preservation planning activity (eg. new objects in the collection, a periodic review of the plan, changes in environment or requirements).
The following types of triggers are foreseen:
| Periodic Review | A review scheduled for this plan. |
| Changed Environment | Contextual influence factors change that justify a revision of this plan. |
| Changed Objective | The goals of the institution change and require revising this plan. |
| Changed Collection Profile | The profile of a set of objects changes in such a way that the defined measures are not sufficient to keep the objects alive. |


Boulder, CO
Though most of my extended family is from Missouri, I was born in Boulder, Colorado, at Boulder County Hospital. My mother lived in Boulder for a few years in the early 1980s, but we returned to Missouri early enough in my life that I don't have any recollection of living there. Still, it's a beautiful place that I still like to claim as my original home. We returned frequently over the years to visit family friends, and to explore Boulder Canyon and nearby Rocky Mountain National Park.
Ironton, MO
My grandparents on both sides lived most of their lives in various small towns in Iron County. When I was young, both maternal and paternal grandparents lived on opposite sides of Ironton, a quaint town on the edge of the beautiful Arcadia Valley. Upon moving back from Colorado, we lived nearby in Ironton for a short time.
Saint Louis, MO
My preschool years were spent crawling around in a four-family flat on Arsenal, half a block east of Grand and Tower Grove Park. I do have some memories from these years, including hot summer nights with the windows open and a fan on high, trying to piece together dinner that didn't involve turning on the oven or stove.
Fenton, MO
From age 5 to 18 I lived in a suburb on the far southrn edge of the St. Louis metropolitan area. It was just what you might expect: subdivisions, baseball teams, big box stores, and lots of TV. Most of my fond memories from these years involve my family. Pictured here is me with my brother, mother, and grandfather.
Kirksville, MO
From 2000-2005 I was an undergraduate at Truman State University, a little-known but quite wonderful public liberal arts school in northern Missouri, a few minutes drive from the Iowa border. The permanent population of Kirksville was roughly 15,000, while the school had an enrollment of 6,000. Needless to say, it wasn't much of a traditional college town. But the town had character, and was small enough to make a car almost completely unecessary on a day-to-day basis.
London, UK
During my undergrad years, I spent 5 months studying in England. Technically, I lived in Hampton Wick, a southwestern suburb of London that sits along the Thames River and is walking distance from Hampton Court Palace, home of Henry VIII.
Allendale, MI
In the summer of 2003, I lived in this small town about halfway between Grand Rapids and Lake Michigan. Summers in Michigan are a dream, with their long days, relatively mild temps, and plenty of outdoor recreation at close access.
While there, I worked with students and faculty at Grand Valley State University on mathematics research, the result of which is my only published research paper to-date.
Lincoln, NE
I lived in Lincoln, Nebraska in the summer of 2005, preparing for graduate school, which would start that fall. I lived with about a dozen other math students in the dorms, which were otherwise empty (as was much of this college town).
Long Island, NY
From 2005 to 2008 I lived in a few towns on the north shore of Long Island: Stony Brook, Port Jefferson, and Sound Beach. At the time, I was a graduate student at Stony Brook University. This part of Long Island is about 60 miles east of New York City (about 2 hours by train or car to Manhattan), but feels like a world away. The coastline is beautiful, and the east end of long island closely matches the expectations created by movies and literature of an idyllic, quaint stretch of small towns, farms, farm stands, and beaches.
Saint Louis, MO
We come to the present day. After leaving New York in 2008, I returned to St. Louis, this time planting my feet within the city limits for the first time. Over the years I lived in a few different parts of the city, including Dogtown and Old North, but I've spend the majority of my time in the city in the Cherokee / Jefferson area, at various apartments in Benton Park and Gravois Park.


OSM MARKER & COORDINATE TESTING
-- Manual Coordinate Entry --
Latitude:
Longitude:
Click anywhere in the map to add a marker.
Markers do not persist across sessions/users.


Home Page
Francisco José MacAllister
Studies
Other events
Contact
I am Francisco MacAllister
But my friends call me Mac
Get to know me
… Here is a little about me…
My family
My new dog
My favorite food
My favorite hobby


| 1 | package fr.sii.ogham.testing.extension.common; | |
| 2 | ||
| 3 | import java.io.PrintWriter; | |
| 4 | import java.io.StringWriter; | |
| 5 | ||
| 6 | /** | |
| 7 | * Simple logger that writes header, success and failure using a | |
| 8 | * {@link StringWriter}. The {@link StringWriter} is passed to the constructor | |
| 9 | * to ba able to read the written strings from the external. | |
| 10 | * | |
| 11 | * <p> | |
| 12 | * This is mainly used for tests | |
| 13 | * | |
| 14 | * @author Aurélien Baudet | |
| 15 | * | |
| 16 | */ | |
| 17 | public class StringPrinter implements Printer { | |
| 18 | private final StringWriter writer; | |
| 19 | private final boolean writeMarker; | |
| 20 | ||
| 21 | /** | |
| 22 | * | |
| 23 | * @param writer | |
| 24 | * the writer that can be shared | |
| 25 | * @param writeMarker | |
| 26 | * true to write marker | |
| 27 | */ | |
| 28 | public StringPrinter(StringWriter writer, boolean writeMarker) { | |
| 29 | super(); | |
| 30 | this.writer = writer; | |
| 31 | this.writeMarker = writeMarker; | |
| 32 | } | |
| 33 | ||
| 34 | @Override | |
| 35 | public void printHeader(String marker, String header) { | |
| 36 |
2
1. printHeader : negated conditional → NO_COVERAGE 2. printHeader : negated conditional → SURVIVED |
if (writeMarker) { |
| 37 | writer.append("[marker:" + marker + "]\n"); | |
| 38 | } | |
| 39 | writer.append(header + "\n\n"); | |
| 40 | } | |
| 41 | ||
| 42 | @Override | |
| 43 | public void printSucess(String marker, String success) { | |
| 44 |
2
1. printSucess : negated conditional → NO_COVERAGE 2. printSucess : negated conditional → SURVIVED |
if (writeMarker) { |
| 45 | writer.append("[marker:" + marker + "]\n"); | |
| 46 | } | |
| 47 | writer.append(success + "\n\n"); | |
| 48 | } | |
| 49 | ||
| 50 | @Override | |
| 51 | public void printFailure(String marker, String failure, Throwable e) { | |
| 52 |
2
1. printFailure : negated conditional → SURVIVED 2. printFailure : negated conditional → NO_COVERAGE |
if (writeMarker) { |
| 53 | writer.append("[marker:" + marker + "]\n"); | |
| 54 | } | |
| 55 | writer.append("Test failure:" + e + "\n"); | |
| 56 |
2
1. printFailure : removed call to java/lang/Throwable::printStackTrace → SURVIVED 2. printFailure : removed call to java/lang/Throwable::printStackTrace → NO_COVERAGE |
e.printStackTrace(new PrintWriter(writer)); |
| 57 | writer.append(failure + "\n\n"); | |
| 58 | } | |
| 59 | ||
| 60 | } | |
Mutations | ||
| 36 |
1.1 2.2 |
|
| 44 |
1.1 2.2 |
|
| 52 |
1.1 2.2 |
|
| 56 |
1.1 2.2 |


Go to ChurchofJesusChrist.org and sign into your profile. Then navigate to the directory. Look for this icon ( ) to use.


Hello There!
I am a FrontEnd Developer.
I am Abhishek Baghel. I had done my bachelor's from Manav Rachna International University and senior secondary from SM Arya Public School. I am a vivid reader and likes to write sometimes. I am hardworking and quick learner and open to learn new technologies(Although I take some time !!). If opportunity given, I would love to showcase my talent ans skills to your reputed company.
91-9899048588
<EMAIL_ADDRESS>178 LIG FLat Pocket 3
Paschim puri
New Delhi
110063


[§271G-4] Application of chapter, interstate, or foreign commerce. This chapter shall not apply to commerce with foreign nations or to interstate commerce, except insofar as the application is permitted under the Constitution and laws of the United States. [L 1974, c 94, pt of §1]


By Team pioneers
SJSU ID:
SJSU ID: 010694970
SJSU ID: 010752157
SJSU ID: 010735686
Guided By Si Thu Aung


Well, trying to escape the ~90 degrees heat I sneaked into a local multiplex that showed artsy films, and was pleasantly surprised at how much I liked the film.
The movie is set in a forlorn town in Idaho, where two conjoined twins, Blake and Francis (played by the Polish brothers, who also co-wrote and directed the film as well), have checked into a ramshackle motel. Well, Blake and Francis are literally joined at the hip and share three legs and two arms between them.
Most of the story is narrated from the viewpoint of the beautiful hooker (played by newcomer Michele Hicks), who has been summoned to the brothers' room in the opening shot of the movie. Apparently, the brothers are celebrating their birthday, and they have decided to give themselves a gift on the occasion.
Understandably, startled by the brothers, and flees the room, but returns to retrieve her purse and gradually warms up to them. She learns that Francis is sick (but not Blake!!!) w/ flu, and manages to get hold of a doctor to treat him.
Well, I won't describe what transpires thereafter as I don't want to spoil the experience of those who haven't seen the movie yet, but suffice it to say that plot isn't this movie's forte. The movie is rich w/ visual metaphors like the two dollar bill, and in some ways, too rich if you ask me.
The movie loses focus during the second half when it delves too deep into the hooker's problems, but in my opinion, the sheer originality of the film, and the first half, which offers some rather keen insights into the twins' lives, well make it worth the price of admission.
Atul
Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Post a picture of your dog
OR scroll through pictures to find your dream dog date
Meet them at the park, or go for a puppacino


Software creates it, makes it grow. It's structure surrounds us and binds us. Semantic beings are we, not this crude tagged text.
 Here, between you...me...the Mac...the Unix...everywhere! Yes, even between this land and that other operating system!
Originally published on 2005-11-24 at http://www.jroller.com/wipu/entry/only_different_in_your_mind under category Art of programming


syclink¶ ↑
syclink can be used to create link list and turn them into an html representation.
Detailed information about the usage can be found at README.md
syclink¶ ↑
NAME
syclink - Create a link list and display it as an html page
SYNOPSIS
syclink [global options] command [command options] [arguments...]
VERSION
0.0.1
GLOBAL OPTIONS
--help - Show this message --version - Display the program version -w, --website=WEBSITE - Website to operate on (default: none)
COMMANDS
add - Add a link to the website delete - Remove one or more links file - Add links from a file to the website find - Find a link help - Shows a list of commands or help for one command list - List and optionally filter links update - Update a link website - Operate on websites
NAME
website - Operate on websites
SYNOPSIS
syclink [global options] website [create] syclink [global options] website remove WEBSITE_PATTERN syclink [global options] website show [-e|--exact] WEBSITE
COMMANDS
create - Create html representation of website (default) remove - Remove one or more websites show - Show all websites or search for websites


--- title: Certified Scrum Master excerpt: I just achieved my Professional Scrum Master (PSM I) certification at Scrum.org date: '2018-10-07 14:17:38 +0100' categories: - Agile - Motivation - Teams ---
I just achieved my Professional Scrum Master (PSM I) certification at Scrum.org.
I recommend it to everyone interested in helping teams create great products, and in gaining a better understanding of Scrum and the Scrum Master role. You might even bust some myths about Scrum.
Thanks One Agency Sweden AB for the awesome tips and support!


New Clients
23
New Projects
169
Open Projects
311
New Invoices
117
Daliy Sales
$12,000
Weekly Sales
$5,000
Monthly Sales
$10,000
Yearly Sales
$9,000
Card title
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhereCard title
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhereCard title
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhereCard title
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhereContent types
The building block of a card is the .card
.card-body
Use it whenever you need a padded section within a card.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Titles, text, and links
Card titles are used by adding .card-title
& .card-subtitle
for subtitle of card.
Card title
Card subtitle
Some quick example text to build on the card title and make up the bulk of the card's content.
Card link Another linkHeader and footer
Add an optional header and/or footer within a card.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereHeader and footer
Add an optional header and/or footer within a card.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSize Using grid markup
Using the grid, wrap cards in columns and rows as needed..col-1 to .col-12
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereText alignment
You can quickly change the text alignment.text-center .text-right
.
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereUsing utilities
Using the utility, you can give direct width class to card like.w-25, w-50, w-75, w-100
This card has width of 75%
With supporting text below as a natural lead-in to additional content.
Go somewhereThis card has width of 50%
With supporting text below as a natural lead-in to additional content.
Go somewhereSize Using grid markup
Using the grid, wrap cards in columns and rows as needed..col-1 to .col-12
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereSpecial title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereCard styles
Cards include various options for customizing their backgrounds, borders, and color..card-primary info, warning, danger
Card Title
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereCard Title
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereCard Title
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereCard Title
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereCard styles
Cards include various options for customizing their backgrounds, borders, and color..card-primary info, warning, danger
Card Title
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhereCard Title
Special title treatment
With supporting text below as a natural lead-in to additional content.
Go somewhere


November settled the 3 of December total expenses=350€ + December settled the 7 of January total expenses=450€ +


ADDR2LINE(1) GNU Development Tools ADDR2LINE(1) NAME addr2line - convert addresses into file names and line numbers. SYNOPSIS addr2line [-a|--addresses] [-b bfdname|--target=bfdname] [-C|--demangle[=style]] [-e filename|--exe=filename] [-f|--functions] [-s|--basename] [-i|--inlines] [-p|--pretty-print] [-j|--section=name] [-H|--help] [-V|--version] [addr addr ...] DESCRIPTION addr2line translates addresses into file names and line numbers. Given an address in an executable or an offset in a section of a relocatable object, it uses the debugging information to figure out which file name and line number are associated with it. The executable or relocatable object to use is specified with the -e option. The default is the file a.out. The section in the relocatable object to use is specified with the -j option. addr2line has two modes of operation. In the first, hexadecimal addresses are specified on the command line, and addr2line displays the file name and line number for each address. In the second, addr2line reads hexadecimal addresses from standard input, and prints the file name and line number for each address on standard output. In this mode, addr2line may be used in a pipe to convert dynamically chosen addresses. The format of the output is FILENAME:LINENO. The file name and line number for each address is printed on a separate line. If the -f option is used, then each FILENAME:LINENO line is preceded by a FUNCTIONNAME line which is the name of the function containing the address. If the -a option is used, then the address read is first printed. If the file name or function name can not be determined, addr2line will print two question marks in their place. If the line number can not be determined, addr2line will print 0. OPTIONS The long and short forms of options, shown here as alternatives, are equivalent. -a --addresses Display address before function names or file and line number information. The address is printed with a 0x prefix to easily identify it. -b bfdname --target=bfdname Specify that the object-code format for the object files is bfdname. -C --demangle[=style] Decode (demangle) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different mangling styles. The optional demangling style argument can be used to choose an appropriate demangling style for your compiler. -e filename --exe=filename Specify the name of the executable for which addresses should be translated. The default file is a.out. -f --functions Display function names as well as file and line number information. -s --basenames Display only the base of each file name. -i --inlines If the address belongs to a function that was inlined, the source information for all enclosing scopes back to the first non-inlined function will also be printed. For example, if "main" inlines "callee1" which inlines "callee2", and address is from "callee2", the source information for "callee1" and "main" will also be printed. -j --section Read offsets relative to the specified section instead of absolute addresses. -p --pretty-print Make the output more human friendly: each location are printed on one line. If option -i is specified, lines for all enclosing scopes are prefixed with (inlined by). @file Read command-line options from file. The options read are inserted in place of the original @file option. If file does not exist, or cannot be read, then the option will be treated literally, and not removed. Options in file are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The file may itself contain additional @file options; any such options will be processed recursively. SEE ALSO Info entries for binutils. COPYRIGHT Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". binutils-2.22-system 2015-01-05 ADDR2LINE(1)


Nikita Tikhomirov
MSc student at the Moscow State University
Laboratory of Systematics and Geography of Aquatic Plants
Papanin Institute for Biology of Inland Waters Russian Academy of Sciences
152742 Borok, Nekouz district, Yaroslavl region, Russia
Personal information
Date of birth
20/10/1998
Family status
Single
Nationality
Russian
Research interests
Topics
Evolution, biodiversity, biogeography
Methods
Bio- and geoinformatics, plant morphology and anatomy, field surveys
Education
2020–2022
Lomonosov Moscow State University
- MSc, department of Ecology and Plant Geography
2016–2020
Lomonosov Moscow State University
- BSc, department of Ecology and Plant Geography
2012–2016
Moscow South-West High School #1543
- Specialization in biology
Academic positions
2020–present
Papanin Institute for Biology of Inland Waters Russian Academy of Sciences
- Senior laboratory assistant, Laboratory of Systematics and Geography of Aquatic Plants
Achievements
2021–2022
Vladimir Potanin Foundation Fellowship for talented Master’s students
2020
Best Young Scientist’s Report, IX International conference on aquatic macrophytes “Hydrobotany 2020” (Borok, Russia, 17—21 October 2020)
2020
Lomonosov Moscow State University scholarship for students with notable achievements in science, social activities, sports or art
2016–2022
Merit scholarship, Faculty of Biology, Lomonosov Moscow State University
Publications
Books: 1
Articles: 11
In proceedings: 3
2021
- Ivanova, M. O., Volkova, P. A., Burlakov, Y. A., Kopylov-Guskov, Y. O., Tikhomirov, N. P., & Bobrov, A. A. (2021). Hide and seek on the central Kuril Island Simushir: Firstly recorded vascular plant species are confined to specific scattered habitats. Journal of Asia-Pacific Biodiversity, 1–6. https://doi.org/10.1016/j.japb.2021.06.005
- Tikhomirov, N. P., Volkova, P. A., Neretina, T. V., & Bobrov, A. A. (2021). Variable yet vague: Questioning the utility of PHYB for barcoding in Potamogeton. Aquatic Botany, 168, 103308. https://doi.org/10.1016/j.aquabot.2020.103308
2020
- Abramova, L. A., Volkova, P. A., Zubkova, M. A., & Tikhomirov, N. P. (2020). Vascular plants of the Nizhne-Svirskii state nature reserve (annotated list). Flora and fauna of state nature reserves. Vol. 139 [in Russian]. Tsentr gumanitarnykh initsiativ SPb.
- Bobrov, A. A., Chemeris, E. V., Volkova, P. A., Mochalova, O. A., Kopylov-Guskov, Y. O., Movergoz, E. A., Grigoryan, M. Y., Tikhomirov, N. P., & Ivanova, M. O. (2020). The diversity of aquatic vascular plants of Russia, the role of hybridization in its emergence [in Russian]. Proceedings of the IX International Conference on Aquatic Macrophytes "Hydrobotany 2020" (Borok, Russia, 17—21 October 2020), 20–22.
- Tikhomirov, N. P., Volkova, P. A., Glagoleva, E. S., Neretina, T. V., & Bobrov, A. A. (2020). Potential of a nuclear gene PHYB as a barcoding marker in genus Potamogeton [in Russian]. Proceedings of the IX International Conference on Aquatic Macrophytes "Hydrobotany 2020" (Borok, Russia, 17—21 October 2020), 158–159.
- Volkova, P. A., Ivanova, M. O., Dadykin, I. A., Tikhomirov, N. P., Grigoryan, M. Y., & Bobrov, A. A. (2020). Annotated list of aquatic vascular plants of the Southern Kurils [in Russian]. Botanicheskij Zhurnal, 105(11), 1064–1074. https://doi.org/10.31857/S0006813620110095
- Volkova, P. A., Ivanova, M. O., Dadykin, I. A., Tikhomirov, N. P., Grigoryan, M. Y., Kopylov-Guskov, Y. O., & Bobrov, A. A. (2020). Unexpected burst of new data on vascular plants flora for the Lesser Kuril Ridge and the whole Kuril archipelago. Journal of Asia-Pacific Biodiversity, 13(4), 738–744. https://doi.org/10.1016/j.japb.2020.06.014
2019
- Sofronova, E. V., Afonina, O. M., Antipin, V. K., Belkina, O. A., Boychuk, M. A., Czernyadjeva, I. V., Doroshina, G. Y., Dyachenko, A. P., Fedosov, V. E., Ignatov, M. S., Ignatova, E. A., Kholod, S. S., Kolesnikova, M. A., Koltysheva, D. E., Komarova, A. S., Konstantinova, N. A., Koroleva, N. E., Koroteeva, T. I., Kozhin, M. N., … Zakharova, A. G. (2019). New bryophyte records. 13. Arctoa, 28(2), 231–250. https://doi.org/10.15298/arctoa.28.22
- Volkova, P. A., Tikhomirov, N. P., Ivanova, M. O., Dadykin, I. A., Kopylov-Guskov, Y. O., & Bobrov, A. A. (2019). Floristic findings on the Onekotan island clarify biogeographic subdivision of the Northern Kurils, Russian Far East. Journal of Asia-Pacific Biodiversity, 12(4), 698–709. https://doi.org/10.1016/j.japb.2019.09.001
2018
- Tikhomirov, N. P., Ivanova, M. O., & Volkova, P. A. (2018). Additions to the flora of the Commander Islands from the collections of the Moscow State University herbarium (MW) [in Russian]. Byulleten Moskovskogo Obshchestva Ispytatelej Prirody. Otdel Biologicheskij, 123(6), 74–76.
- Volkova, P. A., Kopylov-Guskov, Y. O., Tikhomirov, N. P., Ivanova, M. O., & Bobrov, A. A. (2018). Notes on the flora of the Mednyj island (Commander Islands) [in Russian]. Botanicheskij Zhurnal, 103(4), 528–540.
2017
- Abramova, L. A., Tikhomirov, N. P., Ivanova, M. O., & Volkova, P. A. (2017). Grid mapping of the flora of Udomlya district, Tver region: occurrences of newfound and rare vascular plants species [in Russian]. Fitoraznoobrazie Vostochnoj Evropy, 10(1), 50–53.
2016
- Volkova, P. A., Abramova, L. A., Grigoryan, M. Y., Ivanova, M. O., Sekretova, E. K., & Tikhomirov, N. P. (2016). Influence of anthropogenic disturbance on the number and composition of plant species in sparsely populated areas: a case study of Udomlya district (Tver region, European Russia). Evolutionary Ecology Research, 17, 699–712.
- Volkova, P. A., Abramova, L. A., Grigoryan, M. Y., Ivanova, M. O., Sekretova, E. K., & Tikhomirov, N. P. (2016). Influence of anthropogenic disturbance on biodiversity: results of grid mapping of the Udomlya district (Tver region) flora [in Russian]. Proceedings of the Colloquium "Floristic Studies of the Middle Russian Flora", 27–32.
- Volkova, P. A., Bobrov, A. A., Kopylov-Guskov, Y. O., Tikhomirov, N. P., & Mochalova, O. A. (2016). Notes on the flora of the Commander Islands [in Russian]. Botanicheskij Zhurnal, 101(7), 829–842.