Example #1
0
class Epic(JsonObject):
    """ Epic model """
    id_ = IntegerProperty(name='id')
    done = BooleanProperty()
    key = IntegerProperty()
    name = StringProperty()
    color = ObjectProperty(EpicColor)
class AcceptedMessage(JsonObject):

    message_id = IntegerProperty(required=True)
    from_field = ObjectProperty(User, name='from', required=True)
    date = IntegerProperty()
    chat = ObjectProperty(Chat, required=True)
    text = StringProperty(required=True)
Example #3
0
class PrimerOutput(JsonObject):
    sequence = StringProperty(required=True)
    start = IntegerProperty(required=True)
    length = IntegerProperty(required=True)
    temperature = FloatProperty(required=True)
    gc_content = FloatProperty(required=True)
    degenerate_codons = ListProperty(str, required=True)
    overlap_with_following = BooleanProperty(default=False, required=False)
Example #4
0
class Version(JsonObject):
    """ Version model """
    id_ = IntegerProperty(name='id')
    project_id = IntegerProperty(name='projectId')
    name = StringProperty()
    description = StringProperty()
    archived = BooleanProperty()
    released = BooleanProperty()
    release_date = DateTimeProperty(name='releaseDate')
Example #5
0
class Sprint(JsonObject):
    """ Spring model """
    id_ = IntegerProperty(name='id')
    state = StringProperty(name='state')
    name = StringProperty(name='name')
    start_date = DateTimeProperty(name='startDate')
    end_date = DateTimeProperty(name='endDate')
    complete_date = DateTimeProperty(name='completeDate')
    origin_board_id = IntegerProperty(name='originBoardId')
Example #6
0
class MessageContainer(JsonObject):
    # retry section
    # Flow should be next
    # try to send message -> received response with retry_after -> put to queue back
    # and set retry_after and set create_time
    retry_after = IntegerProperty(exclude_if_none=True)
    create_time = IntegerProperty(exclude_if_none=True)
    retry_count = IntegerProperty(exclude_if_none=True)
    message_type = StringProperty(choices=['error', 'response'], required=True)
    message = ObjectProperty(Message, required=True)
Example #7
0
class Version(JsonObject):
    """ Version model """
    id_ = IntegerProperty(name='id')
    projectId = IntegerProperty()
    name = StringProperty()
    description = StringProperty()
    archived = BooleanProperty()
    released = BooleanProperty()
    releaseDate = CustomDateTimeProperty(
        datetime_format="%Y-%m-%d %H:%M:%S.%z")
    startDate = CustomDateTimeProperty(datetime_format="%Y-%m-%d %H:%M:%S.%z")
Example #8
0
class PASResult(JsonObject):
    fragment = StringProperty(required=True)
    start = IntegerProperty(required=True)
    end = IntegerProperty(required=True)
    length = IntegerProperty(required=True)
    overlap = StringProperty(required=False)
    overlap_Tm = FloatProperty(required=False)
    overlap_GC = FloatProperty(required=False)
    overlap_length = IntegerProperty(required=False)
    mutations = ListProperty(PASMutationFormatted, required=False)
    oligos = ListProperty(PASOligoOutput, required=True)
Example #9
0
class Command(JsonObject):
    operation = StringProperty(
        choices=['create', 'delete', 'select', 'list', 'current'],
        required=True)
    subject = StringProperty(choices=['file', 'sheet', 'topic'], required=True)
    name = StringProperty()
    virtual_id = IntegerProperty()
    user_id = IntegerProperty()
    chat_id = IntegerProperty()

    def __eq__(self, other):
        return self.operation == other.operation and self.subject == other.subject and self.name == other.name and self.virtual_id == other.virtual_id and self.user_id == other.user_id and self.chat_id == other.chat_id
Example #10
0
class ListOrdersFilters(JsonObject):
    """
    status_choices = ['WAITING', 'NOT_PAID', 'PAID', 'REVERTED']
    paymentMethod = ['DEBIT_CARD', 'BOLETO', 'ONLINE_BANK_FINANCING',
                     'ONLINE_BANK_DEBIT', 'WALLET']
    """
    createdAt = DateProperty(exclude_if_none=True)
    paymentMethod = StringProperty(exclude_if_none=True)
    value = StringProperty(exclude_if_none=True)
    status = StringProperty(exclude_if_none=True)
    limit = IntegerProperty(exclude_if_none=True)
    offset = IntegerProperty(exclude_if_none=True)
Example #11
0
class QCLMConfig(JsonObject):
    min_primer_size = IntegerProperty(default=23)
    opt_primer_size = IntegerProperty(default=23)
    max_primer_size = IntegerProperty(default=60)

    min_gc_content = FloatProperty(default=40)
    opt_gc_content = FloatProperty(default=50)
    max_gc_content = FloatProperty(default=60)

    min_three_end_size = IntegerProperty(default=10)
    opt_three_end_size = IntegerProperty(default=10)
    max_three_end_size = IntegerProperty(default=40)

    min_five_end_size = IntegerProperty(default=10)
    opt_five_end_size = IntegerProperty(default=10)
    max_five_end_size = IntegerProperty(default=40)

    min_temperature = FloatProperty(default=75)
    max_temperature = FloatProperty(default=90)

    gc_clamp = IntegerProperty(default=1)
    use_degeneracy_codon = BooleanProperty(default=True)
    codon_usage_frequency_threshold = FloatProperty(default=0.1)

    # Search only for solutions with non-overlapping primers?
    non_overlapping_primers = BooleanProperty(default=False)

    # Should we use the primer3 to check generated primers?
    use_primer3 = BooleanProperty(default=True)

    # The allowed range for primer melting temperatures, in deg C
    temp_range_size = FloatProperty(default=5)

    # Temperature calculator configuration
    temperature_config = ObjectProperty(TemperatureConfig,
                                        default=create_default_qclm_temperature_config())

    # Weights used for non_optimality calculation.
    temp_weight = FloatProperty(default=16)         # for 1 deg C difference from the reaction temperature
    primer_size_weight = FloatProperty(default=4)   # for 1 base difference from the optimal primer size
    three_end_size_weight = FloatProperty(default=8)
    five_end_size_weight = FloatProperty(default=1)
    gc_content_weight = FloatProperty(default=0)
    mutation_coverage_weight = FloatProperty(default=160)  # multiplies (1- <total mutation coverage>)
    # For primers which break the hairpin/primer-dimer temperature constraints
    hairpin_temperature_weight = FloatProperty(default=32)         # for each deg C higher
    primer_dimer_temperature_weight = FloatProperty(default=32)    #   formation temperature

    # Step for iteration over possible melting temperature thresholds, in deg C
    temp_threshold_step = FloatProperty(default=1)

    organism=StringProperty(default="e-coli")
Example #12
0
class SSMOutput(JsonObject):
    input_data = ObjectProperty(SSMInput, required=True)
    results = ListProperty(SSMMutationOutput, required=True)
    full_sequence = StringProperty(required=True)
    goi_offset = IntegerProperty(required=True)
    new_sequence_start = IntegerProperty(required=True)

    forward_flanking_primer_temperature = FloatProperty(required=True)
    reverse_flanking_primer_temperature = FloatProperty(required=True)
    min_three_end_temperature = FloatProperty()
    max_three_end_temperature = FloatProperty()
    min_overlap_temperature = FloatProperty()
    max_overlap_temperature = FloatProperty()
Example #13
0
class Plasmid(JsonObject):
    gene_start_in_plasmid = IntegerProperty(default=None)
    gene_end_in_plasmid = IntegerProperty(default=None)
    plasmid_sequence = StringProperty(required=True)

    def get_five_end(self, gene_of_interest, forward_primer):
        self.check_sequence_occurrences(forward_primer, "Forward primer")

        if self.gene_start_in_plasmid is None:
            self.check_sequence_occurrences(gene_of_interest,
                                            "Gene of interest")
            gene_start = self.plasmid_sequence.find(gene_of_interest)
        else:
            gene_start = self.gene_start_in_plasmid

        forward_position = self.plasmid_sequence.find(forward_primer)

        if forward_position <= gene_start:
            return self.plasmid_sequence[forward_position:gene_start]
        else:
            return self.plasmid_sequence[
                forward_position:] + self.plasmid_sequence[:gene_start]

    def get_three_end(self, gene_of_interest, reverse_primer):
        reverse_complement = Seq.reverse_complement(reverse_primer)
        self.check_sequence_occurrences(reverse_complement, "Reverse primer")

        if self.gene_end_in_plasmid is None:
            self.check_sequence_occurrences(gene_of_interest,
                                            "Gene of interest")
            gene_end = self.plasmid_sequence.find(gene_of_interest) + len(
                gene_of_interest)
        else:
            gene_end = self.gene_end_in_plasmid
        reverse_position = self.plasmid_sequence.find(reverse_complement)
        reverse_primer_end = reverse_position + len(reverse_primer)

        if reverse_primer_end > gene_end:
            return self.plasmid_sequence[gene_end:reverse_primer_end]
        else:
            return self.plasmid_sequence[gene_end:] + \
                   self.plasmid_sequence[:reverse_primer_end]

    def check_sequence_occurrences(self, sequence, name):
        occurrences = self.plasmid_sequence.count(sequence)

        if occurrences != 1:
            if occurrences == 0:
                raise ValueError("{} was not found in plasmid".format(name))
            else:
                raise ValueError("{} position is ambiguous".format(name))
Example #14
0
class PASMutationSite(JsonObject):
    """ List of mutations at a given amino acid position """
    position = IntegerProperty(required=True)
    # List of mutation. Each mutation is a amino acid IUPAC code, or a DNA codon.
    mutations = ListProperty(PASMutation, required=True)
    # frequency = FloatProperty(required=True)

    def __gt__(self, other):
        if type(other) == int:
            return self.position > other
        return self.position > other.position

    def __lt__(self, other):
        if type(other) == int:
            return self.position < other
        return self.position < other.position

    def __eq__(self, other):
        if type(other) == int:
            return self.position == other
        return self.position == other.position

    # def __hash__(self):
    #     return hash(str(self.position))

    def get_mutations_str_list(self):
        return [mut.mutation for mut in self.mutations]
Example #15
0
class Usage(JsonObject):
    """An Urjanet "Usage" object.

    From Urjanet's documentation:
      | The Usage table stores commodity-specific consumption data.
      | Here, you will find information such as consumption amounts,
      | read types, present and previous meter readings, and units
      | of measure.
    """

    # The primary key of the Usage object in the Urjanet database
    PK = IntegerProperty(required=True)

    # A string description of the usage measurement
    UsageActualName = StringProperty()

    # The measured amount of usage
    UsageAmount = DecimalProperty()

    # The rate component, e.g. "on peak", "off peak", etc.
    RateComponent = StringProperty()

    # The measurement type, "general_consumption", "demand", or "reactive_consumption"
    MeasurementType = StringProperty()

    # Unit of measure, typically kW or kWh
    EnergyUnit = StringProperty()

    # The start date for the usage measurement
    IntervalStart = DateProperty()

    # The end date for the usage measurement
    IntervalEnd = DateProperty()
Example #16
0
class PrimerOutput(JsonObject):
    direction = StringProperty(required=True)
    normal_order_sequence = StringProperty(required=True)
    normal_order_start = IntegerProperty(required=True)
    three_end_temperature = FloatProperty(required=True)
    gc_content = FloatProperty(required=True)
    parameters_in_range = BooleanProperty(required=True)
Example #17
0
class Project(JsonObject):
    key = StringProperty()
    id_ = IntegerProperty(name='id')
    name = StringProperty()
    public = BooleanProperty()
    type_ = StringProperty(name='type')
    description = StringProperty(default="")
Example #18
0
class Debug(JsonObject):
    """ Represent a Debug menu """

    log_level = IntegerProperty(default=0)
    show_elapsed_time = BooleanProperty(default=False)
    show_received_bytes = BooleanProperty(default=False)
    show_arguments = BooleanProperty(default=False)
    show_url = BooleanProperty(default=False)
Example #19
0
class User(JsonObject):
    name = StringProperty()
    emailAddress = StringProperty()
    id_ = IntegerProperty(name='id')
    displayName = StringProperty()
    active = BooleanProperty()
    slug = StringProperty()
    type_ = StringProperty(name="type")
Example #20
0
class PullRequest(JsonObject):
    id_ = IntegerProperty(name='id')
    version = IntegerProperty()
    title = StringProperty()
    description = StringProperty()
    state = StringProperty()
    open_ = BooleanProperty(name="open")
    closed = BooleanProperty()
    createdDate = EpochProperty()
    updatedDate = EpochProperty()
    fromRef = ObjectProperty(Ref)
    toRef = ObjectProperty(Ref)
    locked = BooleanProperty()
    author = ObjectProperty(PullRequestUser)
    reviewers = ListProperty(PullRequestUser, default=[])
    participants = ListProperty(PullRequestUser, default=[])
    properties = ObjectProperty(PullRequestProperties)
Example #21
0
class PASMutationFormatted(JsonObject):
    position = IntegerProperty(required=True)
    mutated_amino = StringProperty(required=True)
    wild_type_amino = StringProperty(required=False)
    wild_type_codon = StringProperty(required=False)
    mutated_codon = StringProperty(required=True)
    frequency = FloatProperty(required=True)
    wild_type = BooleanProperty(required=True)
Example #22
0
class Repo(JsonObject):
    slug = StringProperty()
    id_ = IntegerProperty(name='id')
    name = StringProperty()
    smcId = StringProperty()
    state = StringProperty()
    statusMessage = StringProperty()
    forkable = BooleanProperty()
    public = BooleanProperty()
Example #23
0
class ShippingAddress(JsonObject):
    street = StringProperty(required=True)
    streetNumber = StringProperty(required=True)
    complement = IntegerProperty(exclude_if_none=True)
    district = StringProperty(required=True)
    city = StringProperty(required=True)
    state = StringProperty(required=True)
    country = StringProperty(required=True)
    zipCode = StringProperty(required=True)
Example #24
0
class ReportsForm(JsonObject):
    time = DateTimeProperty()
    completion_time = DateTimeProperty()
    start_time = DateTimeProperty()
    duration = IntegerProperty()
    submission_time = DateTimeProperty()
    xmlns = StringProperty()
    app_id = StringProperty()
    user_id = StringProperty()
    username = StringProperty()
Example #25
0
class StatusCategory(JsonObject):
    """ StatusCategory model for Status """
    id_ = IntegerProperty(name='id')
    key = StringProperty()
    colorName = StringProperty()
    name = StringProperty()

    def color(self):
        """ Convert to termcolor """
        if self.colorName == 'blue-gray':
            return 'blue'
        return self.colorName
Example #26
0
class Report(CaseReportMixin, JsonObject):
    month = IntegerProperty(required=True)
    year = IntegerProperty(required=True)
    block = StringProperty(required=True)

    def __init__(self, *args, **kwargs):
        super(Report, self).__init__(*args, **kwargs)
        self._extra_row_objects = []

    _data_provider = None

    @property
    def data_provider(self):
        return self._data_provider

    @property
    def datespan(self):
        return DateSpan.from_month(self.month, self.year, inclusive=True)

    def set_extra_row_objects(self, row_objects):
        self._extra_row_objects = row_objects
Example #27
0
class TaxJarLineItem(JsonObject):
    # NB: SmartCalcs can return either string or integer
    # `id` is a valid property, but isn't enforced here
    # id = StringProperty()

    product_identifier = StringProperty()
    description = StringProperty()

    quantity = IntegerProperty()

    unit_price = TaxJarFloatProperty()
    discount = TaxJarFloatProperty()
    sales_tax = TaxJarFloatProperty()
Example #28
0
class StagingMeterData(JsonObject):
    usage_point = (
        IntegerProperty()
    )  # DEPRECATED : OID of usage point objects in green button staging.
    usage_point_id = StringProperty()  # Use this instead.
    duration = IntegerProperty()
    address = ObjectProperty(StagingAddress)
    account_number = StringProperty()
    service_id = StringProperty()
    utility = StringProperty()
    tariff = StringProperty()
    commodity = StringProperty()

    def is_complete(self):
        record = self.to_json()
        record.pop("usage_point")
        return all(x is not None for x in record.values())

    def __eq__(self, other):
        if not isinstance(other, StagingMeterData):
            return False

        return self.to_json() == other.to_json()
Example #29
0
class Charge(JsonObject):
    """An Urjanet "Charge" object.

    From the Urjanet documentation:
      | The Charge table includes information related to the
      | line-item charges on your utility bill. Here, you can
      | find details such as charges names, rates, and currencies.
      | If a charge is associated with more than one meter, Urjanet
      | will prorate the charge based on the usage amount.

    Note especially the description of proration, which can
    manifest in some somewhat difficult to interpret data.
    """

    # The primary key of the Charge object in the Urjanet database
    PK = IntegerProperty(required=True)

    # The line item name
    ChargeActualName = StringProperty()

    # The charge amount in dollars
    ChargeAmount = DecimalProperty()

    # The usage associated with this charge, if any
    ChargeUnitsUsed = DecimalProperty()

    # The units on the usage associated with this charge
    UsageUnit = StringProperty()

    # The rate associated with this charge (e.g. price per unit of usage)
    ChargeRatePerUnit = DecimalProperty()

    # The name of any third party provider (e.g. a CCA entity)
    # This is useful for identifying CCA charges
    ThirdPartyProvider = StringProperty()

    # TODO: Explain this flag in more detail. It may be a somewhat
    # misleading field. For now, avoid using it.
    IsAdjustmentCharge = BooleanProperty()

    # The start date for the period the charge applies to
    IntervalStart = DateProperty()

    # The end date for the period the charge applies to
    IntervalEnd = DateProperty()

    ChargeId = StringProperty()
Example #30
0
class Meter(JsonObject):
    """An Urjanet "Meter" object

    From Urjanet's documentation:
      | The Meter table organizes usage information into specific
      | "points" of service. Urjanet's definition of a meter is not
      | limited to physical meters. The meter table captures data
      | such as service types, tariffs, and usage periods.
    """

    # The primary key of the Meter object in the Urjanet database
    PK = IntegerProperty(required=True)

    # The tariff assigned to the meter.
    # Note: this is drawn from text in a PDF, and is not guaranteed
    # to have a consistent format (that is, tariff's on separate meters
    # cannot reliably be compared in a direct fashion)
    Tariff = StringProperty()

    # The service type of the meter (e.g. electric, natural_gas)
    ServiceType = StringProperty()

    # The "Point of Delivery" identifier for the meter. Interpretation
    # of this field varies for different utilities. For Pacific Gas &
    # Electric, this corresponds to a service ID.
    PODid = StringProperty()

    # The meter number for the meter. Interpretation of this field varies
    # for different utilities.
    MeterNumber = StringProperty()

    # The start/end dates for the Meter object. These fields are a little
    # difficult to interpret. Roughly speaking, they define, respectively, the
    # earliest and latest date for which usage/charge information is available
    # for the meter on a given statement. While this is usually set correctly,
    # there are times where individual charge/usage date ranges do not fully
    # interect with their parent meter.
    IntervalStart = DateProperty()
    IntervalEnd = DateProperty()

    # The charges associated with this meter
    charges = ListProperty(Charge)

    # The usage values associated with this meter
    usages = ListProperty(Usage)