Skip to content
Snippets Groups Projects
Commit 9b28fdc0 authored by aknecht2's avatar aknecht2
Browse files

Updated autodoc and rst for genome.

parent 7cf140fa
No related branches found
No related tags found
1 merge request!25Resolve "Method Auto Doc"
......@@ -3,18 +3,22 @@ import chipathlon.conf
from Pegasus.DAX3 import File, PFN
class Genome(object):
"""
:param assembly: Version of genome used for building i.e. hg19, grch38p6, mm9
:type assembly: string
:param tool: Tool used to create the genome.
:type tool: string
:param base_file: Main genome file probably a .fna or .fa file.
:type base_file: string
:param chrom_sizes: Chromsome sizes file.
:type chrom_sizes: string
The genome handles loading and validating genome files on the disk.
It servers as a helper class to make managing genome input files
much easier.
"""
def __init__(self, assembly, tool, base_file, chrom_sizes):
"""
:param assembly: Version of genome used for building i.e. hg19, grch38p6, mm9
:type assembly: string
:param tool: Tool used to create the genome.
:type tool: string
:param base_file: Main genome file probably a .fna or .fa file.
:type base_file: string
:param chrom_sizes: Chromsome sizes file.
:type chrom_sizes: string
"""
self.assembly = assembly
self.tool = tool
self.base_file = base_file
......@@ -38,7 +42,7 @@ class Genome(object):
def is_valid(self):
"""
Checks if the run is valid.
Checks if the genome is valid.
"""
return len(self.errors) == 0
......@@ -49,18 +53,39 @@ class Genome(object):
return "\n".join(self.errors)
def get_base_file(self):
"""
:returns: The full name of the base file.
"""
return self.files.get("base_file")
def get_chrom_sizes(self):
"""
:returns: The full name of the chromosome sizes file.
"""
return self.files.get("chrom.sizes")
def get_additional_files(self):
"""
:returns: A list of all additional genome indices.
For bwa returns the file names of the .amb, .ann, .bwt, .pac, and .sa
files. For bowtie2 returns the file names of the .1.bt2, .2.bt2,
.3.bt2, .4.bt2, .rev.1.bt2, and .rev.2.bt2 files.
"""
return self.files.get("additional_files")
def get_chr_fasta_files(self):
"""
:returns: A list of all individual chromsome fasta files (if they exist)
"""
return self.files.get("chr_fasta")
def get_all_files(self):
"""
:returns: A list of all files: The base file, the chromsome sizes
file, all additional genome indices, and all individual chromosme
fasta files.
"""
return [self.get_base_file(), self.get_chrom_sizes()] + self.get_additional_files() + self.get_chr_fasta_files()
def _load_prefixes(self):
......
Genome
==============
Genome Class
^^^^^^^^^^^^^
.. autoclass:: chipathlon.genome.Genome
:members:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment