coalispr.bedgraph_analyze.tracks¶
This module produces annotation tracks to display with bedgraph plots.
Attributes¶
Classes¶
A class to represent a track of segments. |
|
A class to represent a track of countable segments. |
|
A Track class to represent a track with annotation info from a GTF file. |
Functions¶
|
Get reference label for segment with clickpoint. |
|
Get reference labels for segment. |
Module Contents¶
- coalispr.bedgraph_analyze.tracks.logger¶
- class coalispr.bedgraph_analyze.tracks.Track(chrnam)¶
A class to represent a track of segments.
A track provides input for a
matplotlib.collections.PolyCollection(formerlymatplotlib.collections.BrokenBarHCollection) used incoalispr.bedgraph_analyze.bedgraph_plotting.- chrnam¶
The name of the chromosome for which the track is made
- Type:
str
- df1, df2
Tuple of pandas dataframes, for strand 1 (PLUS) and strand 2 (MINUS).
- Type:
pandas.DataFrame, pandas.DataFrame
- df¶
Pandas dataframe, used for obtaining segment information.
- Type:
pandas.DataFrame
- chrnam¶
- df = None¶
- textlist(clickp)¶
Show list of information for regions under the cursor.
- Parameters:
clickp (int) – X-coordinate of point under cursor; registered after mouse-click.
- Returns:
List of information associated with segments under the cursor.
- Return type:
list
- get_segments(df)¶
Return list of segments with information that form the track.
- Parameters:
df (pandas.DataFrame) – A pandas dataframe with segment information
- Returns:
List of lower boundaries and length of segments, parseable by
matplotlib.collections.BrokenBarHCollection.- Return type:
list
- get_ctext(clickp)¶
Decribe (first) region under the cursor after clicking (if any).
- Parameters:
clickp (int) – X-coordinate of point under cursor; registered after mouse-click.
- Returns:
Text associated with first entry of listed regions under cursor.
- Return type:
str
- class coalispr.bedgraph_analyze.tracks.SegmentTrack(chrnam, tag)¶
Bases:
TrackA class to represent a track of countable segments.
- chrnam¶
The name of the chromosome for which the track is made
- Type:
str
- tag¶
Kind of data (TAGCOLL or TAGUNCOLL) to annotate.
- Type:
str
- dfs, dfa
Tuple of pandas dataframes, for strand 1 (plus) and strand 2 (minus).
- Type:
pandas.DataFrame, pandas.DataFrame
- df¶
Pandas dataframe, used for obtaining segment information.
- Type:
pandas.DataFrame
- tag¶
- df¶
- textlist(clickp)¶
Show list of information for regions under the cursor.
- Parameters:
clickp (int) – X-coordinate of point under cursor; registered after mouse-click.
- Returns:
List of information associated with segments under the cursor.
- Return type:
list
- class coalispr.bedgraph_analyze.tracks.GTFtrack(chrnam, kind, strand)¶
Bases:
TrackA Track class to represent a track with annotation info from a GTF file.
- kind¶
The kind of GTF information, for reference, or regions with SPECIFIC or UNSPECIFIC reads.
- Type:
str
- strand¶
The strand with the segment the annotation refers to.
- Type:
str
- kind¶
- strand¶
- textlist(clickp)¶
Get list of information for regions under the cursor.
Method overwrites that of parent, using another function.
- Parameters:
clickp (int) – X-coordinate of point under cursor; registered after mouse-click.
- Returns:
List of information associated with segments under the cursor.
- Return type:
list
- coalispr.bedgraph_analyze.tracks.ref_at_clickpoint(chrnam, clickp, kind)¶
Get reference label for segment with clickpoint.
- Parameters:
chrnam (str) – The name of the chromosome for which GTF info is retrieved.
clickp (int) – The click point of the segment under the cursor.
kind (str) – The kind of specified reads for which a GTF could be prepared: (SPECIFIC, UNSPECIFIC, REFERENCE)
- Returns:
Lists with gene_id’s from the GTF described by
kind; one list for each strand of chromosomechrnam,- Return type:
tuple of lists
- coalispr.bedgraph_analyze.tracks.ref_in_segment(chrnam, segm, kind, ref)¶
Get reference labels for segment.
- Parameters:
chrnam (str) – The name of the chromosome for which GTF info is retrieved.
segm ((int,int)) – The segment to check.
kind (str) – The kind of specified reads for which a GTF could be prepared: (SPECIFIC, UNSPECIFIC)
ref (bool) – Include general REFERENCE GTF for annotations (slow). 0: No; 1: Yes.
- Returns:
Lists with gene_id’s from the GTF described by
kind; one list for each strand of chromosomechrnam.- Return type:
tuple of lists