Skip to content

Commit

Permalink
GitBook: [master] 8 pages and 15 assets modified
Browse files Browse the repository at this point in the history
  • Loading branch information
fairliereese authored and gitbook-bot committed Jun 9, 2020
1 parent 69f61ef commit 3f02eb8
Show file tree
Hide file tree
Showing 22 changed files with 71 additions and 71 deletions.
Binary file added .gitbook/assets/alt_3 (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/alt_5 (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/exon_skipping (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/intron_retention (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/teaching_1 (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/teaching_10 (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/teaching_11 (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .gitbook/assets/teaching_2.png
Binary file not shown.
Binary file added .gitbook/assets/teaching_3 (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .gitbook/assets/teaching_4.png
Binary file not shown.
Binary file removed .gitbook/assets/teaching_5.png
Binary file not shown.
Binary file removed .gitbook/assets/teaching_6.png
Binary file not shown.
Binary file removed .gitbook/assets/teaching_7.png
Binary file not shown.
Binary file added .gitbook/assets/teaching_8 (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/teaching_9 (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ After installation with pip, to enable visualizations using dashed edges, run th
* [Input file format specifications](faqs/file_formats.md)

## Comprehensive Documentation
For full documentaion, please visit [our website](https://freese.gitbook.io/swan/)

For full documentaion, please visit [our website](https://freese.gitbook.io/swan/)

Logo by the wonderful [Eamonn Casey](https://www.instagram.com/designsbyeamonn/)

4 changes: 3 additions & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
* [File format specifications](faqs/file_formats.md)

## Code documentation
* [swan_vis.SwanGraph()](docs/swangraph.md)

* [swan\_vis.SwanGraph\(\)](code-documentation/swangraph.md)

128 changes: 60 additions & 68 deletions docs/swangraph.md → code-documentation/swangraph.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## Classes
# swan\_vis.SwanGraph\(\)

## swan.Swangraph\(\)

### swan.Swangraph()
```python
SwanGraph(file=None)
```
```

A graph class to represent a transcriptome and perform plotting and analysis from it

```
```text
Attributes:
datasets (list of str):
Expand Down Expand Up @@ -43,16 +43,17 @@ Attributes:
transcript expression test
```

### Methods
## Methods

### add\_abundance

#### add_abundance
```python
add_abundance(self, counts_file, count_cols, dataset_name, tid_col='annot_transcript_id')
```

Adds abundance information to an existing dataset in the SwanGraph.
```

```text
Parameters:
counts_file (str): Path to tsv counts matrix
Expand All @@ -62,31 +63,30 @@ Parameters:
Default='annot_transcript_id'
```

### add\_annotation

#### add_annotation
```python
add_annotation(self, fname)
```

Adds an annotation from input fname to the SwanGraph.
```

```text
Parameters:
fname (str): Path to annotation GTF
```

### add\_dataset


#### add_dataset
```python
add_dataset(self, col, fname, dataset_name=None, whitelist=None, annot=None, counts_file=None, count_cols=None, tid_col='annot_transcript_id', include_isms=False)
```

Add transcripts from a dataset from either a GTF or a TALON database.

```
```text
Parameters:
col (str): Name of column to add data to in the SwanGraph
fname (str): Path to GTF or TALON db
Expand All @@ -111,16 +111,15 @@ Parameters:
Default=False
```

### de\_gene\_test


#### de_gene_test
```python
de_gene_test(self, dataset_groups)
```

Runs a differential expression test on the gene level.

```
```text
Parameters:
dataset_groups (list of list of str, len 2): Grouping of datasets
Expand All @@ -133,19 +132,17 @@ Returns:
test (pandas DataFrame): A summary table of the differential
expression test, including p and q-values, as well
as log fold change.
```

### de\_transcript\_test


#### de_transcript_test
```python
de_transcript_test(self, dataset_groups)
```

Runs a differential expression test on the transcript level.

```
```text
Parameters:
dataset_groups (list of list of str, len 2): Grouping of datasets
Expand All @@ -160,48 +157,45 @@ Returns:
as log fold change.
```

### find\_es\_genes

#### find_es_genes
```python
find_es_genes(self)
```

Finds all unique genes containing novel exon skipping events.
Requires that an annotation has been added to the SwanGraph.

```
Finds all unique genes containing novel exon skipping events. Requires that an annotation has been added to the SwanGraph.

```text
Returns:
es_genes (list of str): A list of gene ids from the SwanGraph with
at least one novel exon skipping event
```

### find\_ir\_genes

#### find_ir_genes
```python
find_ir_genes(self)
```

Finds all unique genes containing novel intron retention events.
Requires that an annotation has been added to the SwanGraph.
Finds all unique genes containing novel intron retention events. Requires that an annotation has been added to the SwanGraph.

```
```text
Returns:
ir_genes (list of str): A list of gene ids from the SwanGraph with
at least one novel intron retention event
```

### find\_isoform\_switching\_genes

#### find_isoform_switching_genes
```python
find_isoform_switching_genes(self, q=0.05, n_genes=None)
```

Finds isoform switching genes; genes that are not differentially expressed but contain at least one transcript that is.
Requires that de_gene_test and de_transcript_test have been run.

```
Finds isoform switching genes; genes that are not differentially expressed but contain at least one transcript that is. Requires that de\_gene\_test and de\_transcript\_test have been run.

```text
Parameters:
q (float): q-value threshold to declare a gene/transcript
Expand All @@ -218,15 +212,15 @@ Returns:
categorized as isoform switching
```

### gen\_report

#### gen_report
```python
gen_report(self, gids, prefix, datasets='all', dataset_groups=False, dataset_group_names=False, novelty=False, heatmap=False, tpm=False, include_qvals=False, q=0.05, include_unexpressed=False, indicate_dataset=False, indicate_novel=False, browser=False, order='expression')
```

Generates a PDF report for a given gene or list of genes according to the user's input.
```

```text
Parameters:
gids (str or list of str): Gene ids or names to generate
Expand Down Expand Up @@ -298,16 +292,15 @@ Parameters:
'tid' if not
```

### get\_de\_genes

#### get_de_genes
```python
get_de_genes(self, q=0.05, n_genes=None)
```

Subsets the differential gene expression test summary table based on a q-value cutoff.
Requires that de_gene_test has already been run.

```
Subsets the differential gene expression test summary table based on a q-value cutoff. Requires that de\_gene\_test has already been run.

```text
Parameters:
q (float): q-value threshold to declare a gene as significant
Expand All @@ -323,15 +316,15 @@ Returns:
significance threshold
```

### get\_de\_transcripts

#### get_de_transcripts
```python
get_de_transcripts(self, q=0.05, n_transcripts=None)
```

Subsets the differential transcript expression test summary table based on a q-value cutoff. Requires that de_transcript_test has already been run.
```
Subsets the differential transcript expression test summary table based on a q-value cutoff. Requires that de\_transcript\_test has already been run.

```text
Parameters:
q (float): q-value threshold to declare a transcript as significant
Expand All @@ -344,19 +337,18 @@ Returns:
tids (list of str): List of transcript ids that pass the
significance threshold
test (pandas DataFrame): Summary table of transcripts that pass
the significance threshold
the significance threshold
```

### plot\_each\_transcript


#### plot_each_transcript
```python
plot_each_transcript(self, tids, prefix, indicate_dataset=False, indicate_novel=False, browser=False)
```

Plot each input transcript and automatically save figures.
```

```text
Parameters:
tids (list of str): List of transcript ids to plot
Expand All @@ -375,15 +367,15 @@ Parameters:
indicate_novel
```

### plot\_each\_transcript\_in\_gene

#### plot_each_transcript_in_gene
```python
plot_each_transcript_in_gene(self, gid, prefix, indicate_dataset=False, indicate_novel=False, browser=False)
```

Plot each transcript in a given gene and automatically save figures.
```

```text
Parameters:
gid (str): Gene id or gene name to plot transcripts from
Expand All @@ -402,16 +394,15 @@ Parameters:
indicate_novel
```

### plot\_graph

#### plot_graph
```python
plot_graph(self, gid, indicate_dataset=False, indicate_novel=False, prefix=None)
```

Plots a gene summary SwanGraph for an input gene.
Does not automatically save the figure by default!

```
Plots a gene summary SwanGraph for an input gene. Does not automatically save the figure by default!

```text
Parameters:
gid (str): Gene ID to plot for (can also be gene name but
Expand All @@ -429,15 +420,15 @@ Parameters:
Default: None, won't automatically save
```

### plot\_transcript\_path

#### plot_transcript_path
```python
plot_transcript_path(self, tid, indicate_dataset=False, indicate_novel=False, browser=False, prefix=None)
```

Plots a path of a single transcript isoform through a gene summary SwanGraph.
```

```text
Parameters:
tid (str): Transcript id of transcript to plot
Expand All @@ -457,17 +448,18 @@ Parameters:
Default: None, won't automatically save
```

### save\_graph

#### save_graph
```python
save_graph(self, prefix)
```

Saves the current SwanGraph in pickle format with the .p extension.
```

```text
Parameters:
prefix (str): Path and filename prefix. Resulting file will
be saved as prefix.p
```
```

3 changes: 3 additions & 0 deletions faqs/understanding_swan_vis.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Understanding Swan visualizations

Swan utilizes a representation of transcript structure and alternative splicing that most people aren't familiar with. The goal of this guide is to help the user understand and interpret the graphical output format from Swan, in a step-by-step manner.

## Table of contents
Expand Down Expand Up @@ -55,3 +57,4 @@ Exon skipping in a SwanGraph consists of an intronic \(pink\) edge that complete
In a SwanGraph, intron retention is the opposite of exon skipping. It is seen when an exonic \(green\) edge completely spans an intronic \(pink\) edge. This means that an intronic region from one transcript model has been included in a different transcript model.

![](../.gitbook/assets/intron_retention.png)

1 change: 1 addition & 0 deletions tutorials/analysis_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Swan has several analysis options to use.

Table of contents

* [Differential gene expression](analysis_tools.md#differential-gene-expression-tests)
* [Differential transcript expression](analysis_tools.md#differential-transcript-expression-tests)
* [Isoform switching](analysis_tools.md#isoform-switching)
Expand Down
1 change: 1 addition & 0 deletions tutorials/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ First, if you haven't already, make sure to [install Swan](../#installation). Af
Then, download the data and the reference transcriptome annotation from [here](https://hpc.oit.uci.edu/~freese/swan_files/). The bash commands to do so are given below.

Table of contents

* [Example data download](getting_started.md#download-example-data)
* [Starting and initializing your SwanGraph](getting_started.md#starting-up-swan-and-initializing-your-swangraph)
* [Add transcript models \(GTF\) and abundance info](getting_started.md#adding-transcript-models-gtf-and-abundance-information-at-the-same-time)
Expand Down
Loading

0 comments on commit 3f02eb8

Please sign in to comment.