sheynkman-lab / biosurfer

"Surf" the biological network, from genome to transcriptome to proteome and back to gain insights into human disease biology.
MIT License
0 stars 0 forks source link

Possibility - Expression class to describe the abundance of isoform and elements #29

Open gsheynkman opened 3 years ago

gsheynkman commented 3 years ago

Possibility - class which represents the abundance of the isoform (or isoform sub-element, such as a junction or exon) in human tissues, cell lines, or disease-relevant samples.

Original code (now deleted) input the GTEx data and had transcript abundances across ~30 human tissues (see below).

This class may be helpful for comparing abundances of events (e.g., exon skipping) versus whole-isoforms. It may be helpful in comparing short-read-based versus long-read-based expression values.

It could also be used to plot expression visualizations in the isoform imager module. For example - Farilie's Swan program has an example.


    def __init__(self, expr_dict):
        self.expr_dict = expr_dict # tissue -> rpkm
        self.avg_expr = self.compute_avg_expr()

    def __getitem__(self, tiss):
        # when expr_obj fetch by key (tissue), return value
        return self.expr_dict[tiss]

    def compute_avg_expr(self):
        tot = 0
        for k, v in self.expr_dict.items():
            v = float(v)
            tot += v
        avg_expr = tot/len(self.expr_dict)
        return avg_expr```