hit Module

platform:Unix
synopsis:Create the class HIT which represents a TFBS hit.
class hit_module.HIT(seq_record, start, end, strand, score, tffm=None, tffm_matched_state=-1)[source]

Define the representation of a TFBS hit.

__eq__(other)[source]

Implement the == operator. The comparison looks at the score.

__ge__(other)[source]

Implement the >= operator. The comparison looks at the score.

__gt__(other)[source]

Implement the > operator. The comparison looks at the score.

__init__(seq_record, start, end, strand, score, tffm=None, tffm_matched_state=-1)[source]

Create an instance of the HIT.

Parameters:
  • seq_record (Bio.SeqRecord) – Sequence containing the hit.
  • start (int) – Start position of the hit.
  • end (int) – End position of the hit.
  • strand (str) – Strand of the hit on the sequence. It should be either ‘+’ or ‘-‘).
  • score (float) – TFFM score of the hit.
  • tffm (TFFM) – TFFM used to predict the hit (default: None).
  • tffm_matched_state (int) – Matching state in the TFFM to predict the hit (default: -1, i.e. no TFFM).
Warning:

start and end are 1-based.

Warning:

The seq_record attribute is not the actual sequence of the hit but the whole sequence containing the hit.

Todo:

Raise an error when the strand is wrong.

__le__(other)[source]

Implement the <= operator. The comparison looks at the score.

__len__()[source]

Give the length of the TFBS hit.

Returns:The length of the TFBS hit.
Return type:int
__lt__(other)[source]

Implement the < operator. The comparison looks at the score.

__module__ = 'hit_module'
__ne__(other)[source]

Implement the != operator. The comparison looks at the score.

__str__()[source]

Give the string representation of the TFBS hit.

Returns:The string representing the hit in the following format: start end strand sequence tffm-name tffm-state score
Return type:str
sequence()[source]

Give the sequence of the TFBS hit.

Returns:The sequence of the TFBS hit.
Return type:str
hit_module.get_start_end_strand(position, seq_record, tffm, negative)[source]

Get the start and end positions of a TFBS hit given its end position on the positive strand.

Parameters:
  • position (int) – End position of the TFBS hit on the positive strand of the sequence.
  • seq_record (Bio.SeqRecord) – The actual sequence.
  • tffm (TFFM) – The TFFM used to predict the TFBS hit.
  • negative – Boolean set to True if the TFBS hit is on the negative strand of the sequence and False otherwise.
Returns:

The start and end positions and the strand.

Return type:

tuple(int, int, str)

Note:

The strand is ‘+’ if the hit is on the positive strand and ‘-‘ otherwise.

Warning:

The input position is given 0-based as extracted from TFFM computations but the output start and end are 1-based since it is a more conventionnal way to print the TFBS hit positions.

Module author: Anthony Mathelier <amathelier@cmmt.ubc.ca>

Previous topic

tffm Module

Next topic

drawing Module

This Page