lapa.utils.io

Module Contents

Functions

read_polyA_cluster(path: str)

Read poly(A) cluster file generated by LAPA.

read_tss_cluster(path: str)

Read tss cluster file generated by LAPA.

read_talon_read_annot(path: str, usecols=('read_name', 'chrom', 'read_start', 'read_end', 'strand', 'annot_gene_id', 'annot_transcript_id', 'dataset'))

Read TALON read_annot file

read_talon_read_annot_three_prime_count(path: str)

Read three_prime ends of TALON read_annot file.

_read_talon_read_annot_three_prime_count(df)

read_talon_read_annot_five_prime_count(path: str)

Read three_prime ends of TALON read_annot file.

_read_talon_read_annot_five_prime_count(df)

_read_talon_read_counts(df)

read_chrom_sizes(chrom_size_file: str) → Dict

Read chrom_sizes file as dictionary of chroms as key and sizes as value.

bw_from_pyranges(gr: pyranges.PyRanges, value_col: str, chrom_sizes: str, bw_pos_file: str, bw_neg_file: str)

Save pyranges as bigwig file.

Attributes

cluster_col_order

Columns of poly(A) clusters bed file.

tss_cluster_col_order

Columns of tss clusters bed file.

lapa.utils.io.cluster_col_order = ['Chromosome', 'Start', 'End', 'polyA_site', 'count', 'Strand', 'Feature', 'gene_id', 'tpm',...

Columns of poly(A) clusters bed file.

Type

List[str]

lapa.utils.io.tss_cluster_col_order = ['Chromosome', 'Start', 'End', 'tss_site', 'count', 'Strand', 'Feature', 'gene_id', 'tpm',...

Columns of tss clusters bed file.

Type

List[str]

lapa.utils.io.read_polyA_cluster(path: str)

Read poly(A) cluster file generated by LAPA.

Parameters

path – Path to LAPA poly(A) cluster bed file.

lapa.utils.io.read_tss_cluster(path: str)

Read tss cluster file generated by LAPA.

Parameters

path – Path to LAPA TSS cluster bed file.

lapa.utils.io.read_talon_read_annot(path: str, usecols=('read_name', 'chrom', 'read_start', 'read_end', 'strand', 'annot_gene_id', 'annot_transcript_id', 'dataset'))

Read TALON read_annot file

Parameters
  • path – Path to TALON read_annot.

  • usecols – Only read subset of columns.

lapa.utils.io.read_talon_read_annot_three_prime_count(path: str)

Read three_prime ends of TALON read_annot file.

Parameters

path – Path to TALON read_annot.

lapa.utils.io._read_talon_read_annot_three_prime_count(df)
lapa.utils.io.read_talon_read_annot_five_prime_count(path: str)

Read three_prime ends of TALON read_annot file.

Parameters

path – Path to TALON read_annot.

lapa.utils.io._read_talon_read_annot_five_prime_count(df)
lapa.utils.io._read_talon_read_counts(df)
lapa.utils.io.read_chrom_sizes(chrom_size_file: str) Dict

Read chrom_sizes file as dictionary of chroms as key and sizes as value.

Parameters

chrom_size_file – Path to chromosome sizes file.

lapa.utils.io.bw_from_pyranges(gr: pyranges.PyRanges, value_col: str, chrom_sizes: str, bw_pos_file: str, bw_neg_file: str)

Save pyranges as bigwig file.

Parameters
  • gr – pr.PyRanges object to save.

  • value_col – Value column of the file to store.

  • chrom_size_file – Path to chrom_sizes file or chrom_sizes as dictionary.

  • bw_pos_file – Bigwig destination path to save positive strand scores.

  • bw_neg_file – Bigwig destination path to save negative strand scores.