API documentation

cpg_islands Package

cpg_islands – Finding CpG islands in genetic sequences.

metadata Module

cpg_islands.metadata — Project metadata

Information describing the project.

models Module

presenters Module

utils Module

cpg_islands.utils — Miscellaneous utilities

class cpg_islands.utils.Event[source]

Bases: list

Event subscription.

A list of callable objects. Calling an instance of this will cause a call to each item in the list in ascending order by index.

Example Usage: >>> def f(x): ... print ‘f({0})’.format(x) >>> def g(x): ... print ‘g({0})’.format(x) >>> e = Event() >>> e() >>> e.append(f) >>> e(123) f(123) >>> e.remove(f) >>> e() >>> e += (f, g) >>> e(10) f(10) g(10) >>> del e[0] >>> e(2) g(2)

views Module

cpg_islands.views — View interfaces

class cpg_islands.views.BaseAppView[source]

Bases: object

file_load_requested = Event([])

Called when the user requests to load a file. Callbacks should look like:

callback(file_path)
Parameters:file_path (str) – path the the file to load
show_results()[source]

Show the results view.

show_seq_input()[source]

Show the sequence input view.

start()[source]

Start the view.

class cpg_islands.views.BaseEntrezView[source]

Bases: object

load_requested = Event([])
query_changed = Event([])
result_selected = Event([])
search_requested = Event([])
set_query_translation(query_translation)[source]

Set the query text which has been translated to Entrez search terms.

Parameters:query_translation (str) – the translated query
set_result(results)[source]

Set the list of sequence ids.

Parameters:result (list) – list of sequence ids
set_selected_seq(seq_str)[source]

Set the selected sequence.

Parameters:seq_str (str) – the sequence data
set_seq_desc(desc)[source]

Set the selected sequence’s description.

Parameters:desc (str) – sequence’s description
set_seq_len(len_str)[source]

Set the length of the sequence.

Parameters:len (str) – sequence length as a string
set_seq_locus(locus, ncbi_url)[source]

Set the selected sequence’s locus and URL to access on NCBI. Basically, identify the sequence on NCBI.

Parameters:
  • locus (str) – sequence’s locus
  • ncbi_url (str) – URL to sequence on NCBI
set_suggestion(suggestion)[source]

Set the suggestions based on spelling.

Parameters:result (str) – the encoded text
class cpg_islands.views.BaseResultsView[source]

Bases: object

clear_subseq()[source]

Clear subsequence field.

highlight_global_seq(start, end)[source]

Highlight the subsequence within the global sequence.

Parameters:
  • start (str) – start index of the currently selected island
  • end (str) – end index of the currently selected island
island_selected = Event([])
set_algo_name(algo_name)[source]

Set the name of the algorithm used.

Parameters:algo_name (str) – the algorithm name
set_end(end_str)[source]

Set end index of the island

Parameters:end_str (str) – end index of island
set_exec_time(exec_time_str)[source]

Set the execution time of the algorithm.

Parameters:exec_time_str – execution time as a string
set_gc_ratio(gc_ratio_str)[source]

Set GC ratio of the island.

Parameters:gc_ratio_str – GC ratio of island
set_global_seq(seq_str)[source]

Set the global sequence string.

Parameters:seq_str (str) – DNA sequence of feature
set_islands(islands)[source]

Set the CpG island locations.

Parameters:islands (list of tuple) – CpG island locations
set_length(length_str)[source]

Set length of the island.

Parameters:length (str) – length of island
set_obs_exp_cpg_ratio(obs_exp_cpg_ratio_str)[source]

Set observed/expected CpG ratio of the island.

Parameters:obs_exp_cpg_ratio_str (str) – observed/expected ratio
set_start(start_str)[source]

Set start index of the island.

Parameters:start_str (str) – start index of island
set_subseq(seq_str)[source]

Set the subsequence.

Parameters:seq_str (str) – DNA sequence of island
class cpg_islands.views.BaseSeqInputView[source]

Bases: object

set_algorithms(algorithm_names)[source]

Set the list of algorithm names.

Parameters:algorithm_names (list of str) – list of algorithm names
set_island_size(island_size_str)[source]

Set the size of the CpG island.

Parameters:island_size (str) – number of bases in the island as a string
set_min_gc_ratio(min_gc_ratio)[source]

Set minimum GC ratio.

Parameters:min_gc_ratio (str) – the ratio of Guanine/Cytosine as a string
set_min_obs_exp_cpg_ratio(min_obs_exp_cpg_ratio)[source]

Set the minimum observed/expected CpG ratio.

Parameters:min_gc_ratio (str) – the ratio of Guanine/Cytosine as a string
set_seq(seq_str)[source]

Set the sequence text.

Parameters:seq_str (str) – the sequence in string form
show_error(message)[source]

Show the user an error dialog.

Parameters:message (str) – error message
submitted = Event([])

Called when the form is submitted, i.e., submit is clicked by the user. Callbacks should look like:

callback(seq_str, island_size_str, min_gc_ratio_str)
Parameters:
  • seq_str (str) – the sequence as a string
  • island_size_str (str) – number of bases which an island may contain
  • min_gc_ratio_str (str) – the ratio of GC to other bases

Table Of Contents

Related Topics

This Page