outrigger.commandline module

class outrigger.commandline.CommandLine(input_options=None)[source]

Bases: object

Methods

do_usage_and_die(str) Cleanly exit if incorrect parameters are given
index()
psi()
validate()
do_usage_and_die(str)[source]

Cleanly exit if incorrect parameters are given

If a critical error is encountered, where it is suspected that the program is not being called with consistent parameters or data, this method will write out an error string (str), then terminate execution of the program.

index()[source]
psi()[source]
validate()[source]
class outrigger.commandline.Index(**kwargs)[source]

Bases: outrigger.commandline.Subcommand

Attributes

folders
gtf_folder
index_folder
junction_reads_filename
junctions_folder
output_folder
splice_abbrevs
gffutils_db  
gtf_filename  
sj_out_tab  

Methods

csv() Create a csv file of compiled splice junctions
execute()
filter_junctions_on_reads(spliced_reads)
get_event_attributes(db, event_df, splice_type)
junction_metadata(spliced_reads, csv) Get just the junction info from the concatenated read files
make_events_by_traversing_graph(event_maker, db) Search the splice graph for alternative exons
make_exon_junction_adjacencies(metadata, db) Get annotated exon_cols next to junctions in data
make_graph(junction_exon_triples, db) Create graph database of exon-junction adjacencies
make_junction_reads_file()
maybe_make_db() Get GFFutils database from file or create from a gtf
maybe_make_folder(folder)
maybe_overwrite(filename) Ensures that filename is not overwritten unless user-specified
write_new_gtf(db)
execute()[source]
get_event_attributes(db, event_df, splice_type)[source]
make_events_by_traversing_graph(event_maker, db)[source]

Search the splice graph for alternative exons

make_exon_junction_adjacencies(metadata, db)[source]

Get annotated exon_cols next to junctions in data

static make_graph(junction_exon_triples, db)[source]

Create graph database of exon-junction adjacencies

max_de_novo_exon_length = 100
splice_abbrevs
write_new_gtf(db)[source]
class outrigger.commandline.Psi(**kwargs)[source]

Bases: outrigger.commandline.SubcommandAfterIndex

Attributes

folders
gtf_folder
index_folder
input_index Where to read the index from
junction_reads_filename
junctions_folder
output_folder
psi_folder
splice_type_folders
gffutils_db  
gtf_filename  
junction_id_col  
reads_col  
sample_id_col  
sj_out_tab  

Methods

csv() Create a csv file of compiled splice junctions
execute() Calculate percent spliced in (psi) of splicing events
filter_junctions_on_reads(spliced_reads)
junction_metadata(spliced_reads, csv) Get just the junction info from the concatenated read files
make_junction_reads_file()
maybe_get_validated_events(splice_abbrev)
maybe_make_db() Get GFFutils database from file or create from a gtf
maybe_make_folder(folder)
maybe_overwrite(filename) Ensures that filename is not overwritten unless user-specified
maybe_read_junction_reads()
validate_junction_reads_data(junction_reads)
execute()[source]

Calculate percent spliced in (psi) of splicing events

folders
junction_id_col = None
maybe_get_validated_events(splice_abbrev)[source]
maybe_read_junction_reads()[source]
psi_folder
reads_col = None
required_cols = {'--reads-col': None, '--sample-id-col': None, '--junction-id-col': None}
sample_id_col = None
splice_type_folders
validate_junction_reads_data(junction_reads)[source]
class outrigger.commandline.Subcommand(**kwargs)[source]

Bases: object

Attributes

folders
gtf_folder
index_folder
junction_reads_filename
junctions_folder
output_folder
gffutils_db  
gtf_filename  
sj_out_tab  

Methods

csv() Create a csv file of compiled splice junctions
filter_junctions_on_reads(spliced_reads)
junction_metadata(spliced_reads, csv) Get just the junction info from the concatenated read files
make_junction_reads_file()
maybe_make_db() Get GFFutils database from file or create from a gtf
maybe_make_folder(folder)
maybe_overwrite(filename) Ensures that filename is not overwritten unless user-specified
csv()[source]

Create a csv file of compiled splice junctions

debug = False
filter_junctions_on_reads(spliced_reads)[source]
folders
force = False
gffutils_db = None
gtf_filename = None
gtf_folder
ignore_multimapping = False
index_folder
static junction_metadata(spliced_reads, csv)[source]

Get just the junction info from the concatenated read files

junction_reads_filename
junctions_folder
make_junction_reads_file()[source]
maybe_make_db()[source]

Get GFFutils database from file or create from a gtf

maybe_make_folder(folder)[source]
maybe_overwrite(filename)[source]

Ensures that filename is not overwritten unless user-specified

  • If the file doesn’t exist, return “True”, as in “yes, please overwrite” even though there wasn’t really a file there, but the action is still to create the file in the next step
  • If the file exists and the user specified nothing, exit the program and complain that either –force or –resume must be specified
  • If the file exists and the user specified –force, then return True
  • If the file exists and the user specified –resume, then return False so that the file is not overwritten
Parameters:

filename : str

Path to a file that you may want to overwrite

Returns:

if_overwrite : bool

If True, then the next step in the program has the go-ahead to “overwrite” or create the file. If False, the file exists and the user doesn’t want to overwrite it

min_reads = 10
output_folder
reads_col = 'reads'
resume = False
sj_out_tab = None
class outrigger.commandline.SubcommandAfterIndex(**kwargs)[source]

Bases: outrigger.commandline.Subcommand

Can use different index folder than outrigger_output/index

Attributes

folders
gtf_folder
index_folder
input_index Where to read the index from
junction_reads_filename
junctions_folder
output_folder
gffutils_db  
gtf_filename  
sj_out_tab  

Methods

csv() Create a csv file of compiled splice junctions
filter_junctions_on_reads(spliced_reads)
junction_metadata(spliced_reads, csv) Get just the junction info from the concatenated read files
make_junction_reads_file()
maybe_make_db() Get GFFutils database from file or create from a gtf
maybe_make_folder(folder)
maybe_overwrite(filename) Ensures that filename is not overwritten unless user-specified
folders
input_index

Where to read the index from

exception outrigger.commandline.Usage(msg)[source]

Bases: Exception

Used to signal a Usage error, evoking a usage statement and eventual exit when raised

class outrigger.commandline.Validate(**kwargs)[source]

Bases: outrigger.commandline.SubcommandAfterIndex

Attributes

folders
gtf_folder
index_folder
input_index Where to read the index from
junction_reads_filename
junctions_folder
output_folder
gffutils_db  
gtf_filename  
sj_out_tab  

Methods

csv() Create a csv file of compiled splice junctions
execute()
exon_pair_splice_sites(exonA, exonB, ...)
filter_junctions_on_reads(spliced_reads)
individual_exon_splice_sites(exon, ...)
junction_metadata(spliced_reads, csv) Get just the junction info from the concatenated read files
make_junction_reads_file()
maybe_make_db() Get GFFutils database from file or create from a gtf
maybe_make_folder(folder)
maybe_overwrite(filename) Ensures that filename is not overwritten unless user-specified
execute()[source]
exon_pair_splice_sites(exonA, exonB, splice_abbrev)[source]
individual_exon_splice_sites(exon, splice_abbrev, direction)[source]
outrigger.commandline.main()[source]