Regions module

Module providing functions for working with files revolving around GenomicRegion objects.

genomic_regions.files.write_bed(file_name, regions, mode='w', **kwargs)

Write GenomicRegion objects to BED file.

Parameters
  • file_name – Path to output BED file

  • regionslist of GenomicRegion objects

  • mode – File mode. Default: ‘w’

  • kwargs – Keyword arguments passed to GenomicRegion.as_bed_line

Returns

Path to output BED file

genomic_regions.files.write_bigwig(file_name, regions, mode='w', score_field='score', chromosome_sizes=None)

Write GenomicRegion objects to BigWig file.

Parameters
  • file_name – Path to output BigWig file

  • regionslist of GenomicRegion objects

  • mode – File mode. Default: ‘w’

  • score_field – Attribute from each object to use as interval score.

  • chromosome_sizes – Dictionary of the form {chromosome: size}

Returns

Path to output BigWig file

genomic_regions.files.write_gff(file_name, regions, mode='w', **kwargs)

Write GenomicRegion objects to GFF file.

Parameters
  • file_name – Path to output GFF file

  • regionslist of GenomicRegion objects

  • mode – File mode. Default: ‘w’

  • kwargs – Keyword arguments passed to GenomicRegion.as_gff_line

Returns

Path to output GFF file